skip to Main Content

I have Azure Linux VMs for which i want to configure Azure-Monitor Alerts when my /root,/etc and /var volumes are more than 90% utilized. Please suggest way to achieve this.

2

Answers


  1. You can run a KQL to achieve this.

    For example,

    InsightsMetrics
    | where Computer in (
    "CH1-UBNTVM", //Linux
    "DC10.na.contosohotels.com" // Windows
    )
    | where Namespace == "LogicalDisk"
    | where Name == "FreeSpacePercentage"
    | extend Disk=tostring(todynamic(Tags)["vm.azm.ms/mountId"])
    | summarize arg_max(TimeGenerated, *) by Disk, Computer
    | project TimeGenerated, Disk, Computer, Val
    | where Val > 90
    

    enter image description here

    More info can be found here :- https://learn.microsoft.com/en-us/answers/questions/831491/how-to-setup-azure-alert-when-disk-space-is-90-for.html

    Thanks

    Login or Signup to reply.
  2. Do you want to enlarge the disk space of your Azure VM?

    I do know you want to enlarge your VM partition.

    All the code, please log in your virtual machine, input in terminal, thanks!

    Just use the code df -iThto check your VM disk space, output just like below:

    Filesystem     Type     Inodes IUsed IFree IUse% Mounted on
    udev           devtmpfs   117K   378  116K    1% /dev
    tmpfs          tmpfs      123K   721  122K    1% /run
    /dev/sda1      ext4       2.3M  297K  2.0M   13% /
    tmpfs          tmpfs      123K     1  123K    1% /dev/shm
    tmpfs          tmpfs      123K     4  123K    1% /run/lock
    tmpfs          tmpfs       25K   120   25K    1% /run/user/1000
    

    Which partitions mounted at your /root, /etc and /var?

    You can find the result from the display of df -hTi.

    Enlarge or extend or resize your Azure VM follow below:

    First, you need to know which partition mounted at your less disk target direction, e.g: /root;

    Second, you need to enlarge or extend or resize that target partition;

    Third, expand your disks on Azure Linux VM, please refer:

    Expand virtual hard disks on a Linux VM with the Azure CLI(Azure Linux VM Document)

    OVER!

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search