email notification from disk_space_usage

Hi, I am trying to modify the netdata alerts regarding the disk_space_usage template. I would like to get the alert when the disk has less than 500mb free.

I tried to modify it, reading and interpreting the documentation plus chatgpt help and I changed it this way:

     calc: $avail
    units: MB
    every: 1m
     warn: $this < 500 && $this > 250 # Alert when free space is between 250 MB and 500 MB
     crit: $this <= 250 # Critical alert when free space is 250 MB or less
    delay: up 1m down 15m multiplier 1.5 max 1h
  summary: Disk ${label:mount_point} has low available space
     info: Disk ${label:mount_point} has ${this} MB available space
       to: sysadmin

But it doesn’t work and sends me wrong alerts, mentioning that we have 12 mbs free when it is not. I can’t find much information in the documentation, or I’m not finding it, could you please guide me?

Hi @soldanes

Disk space units are GB, so in your example it will be warning if available space is under 500GB.

You have to convert GB to MB, so it should look to something like this:

    template: disk_space_usage
          on: disk.space
       class: Utilization
        type: System
   component: Disk
chart labels: mount_point=!/dev !/dev/* !/run !/run/* !HarddiskVolume* *
        calc: $avail
       units: GB
       every: 1m
        warn: $this < 0.488
        crit: $this < 0.244
     summary: Disk ${label:mount_point} has low available space
        info: Total available space of disk ${label:mount_point}
          to: sysadmin

I hope this helps you out.