'How to setup azure alert when Disk Space is 90% for a linux VM

I'm trying to build an alert in Azure for my Linux VM. I want to understand which query to run to trigger an alert when the disk space is 90%. I refered several examples in this forum and outside. Most of them are for a Windows VM. I want to know if the same works for Linux as well.

I would also want an alert when /var or /opt directories in Linux VM have reached 90% capacity.

Please help



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source