DEV Community

minnogit
minnogit

Posted on

Modificare allarme di spazio libero per un disco in Netdata

Dall'interfaccia web di Netdata, in alto a destra, si vedono gli allarmi e, nei dettagli di ognuno, sono specificati i relativi file di configurazione.

Image description

Ad es., dai dettagli sopra si vede che l'allarme è configurato nel file /opt/netdata/usr/lib/netdata/conf.d/health.d/disks.conf

Se vogliamo che l'allarme per il disco /mnt/disco_utenti abbia regole diverse rispetto a quelle per gli altri dischi, possiamo modificare la configurazione così:

nano /opt/netdata/usr/lib/netdata/conf.d/health.d/disks.conf
Enter fullscreen mode Exit fullscreen mode
  1. Escludo il disco /mnt/disco_utenti dalla configurazione attuale modificando la lista families:
# -----------------------------------------------------------------------------
# low disk space

# checking the latest collected values
# raise an alarm if the disk is low on
# available disk space

 template: disk_space_usage
       on: disk.space
    class: Utilization
     type: System
component: Disk
       os: linux freebsd
    hosts: *
 families: !/mnt/disco_utenti !/mnt/disco_utenti !/dev !/dev/* !/run !/run/* *
     calc: $used * 100 / ($avail + $used)
    units: %
    every: 1m
     warn: $this > (($status >= $WARNING ) ? (80) : (90))
     crit: $this > (($status == $CRITICAL) ? (90) : (98))
    delay: up 1m down 15m multiplier 1.5 max 1h
     info: disk ${label:mount_point} space utilization
       to: sysadmin
Enter fullscreen mode Exit fullscreen mode
  1. Aggiungo alla configurazione una nuova sezione per l'allarme del disco /mnt/disco_utenti:
# -----------------------------------------------------------------------------
# low disk space

# checking the latest collected values
# raise an alarm if the disk is low on
# available disk space

 template: disk_space_usage
       on: disk.space
    class: Utilization
     type: System
component: Disk
       os: linux freebsd
    hosts: *
 families: /mnt/disco_utenti
     calc: $used * 100 / ($avail + $used)
    units: %
    every: 10m
     warn: $this > (($status >= $WARNING ) ? (96) : (98))
     crit: $this > (($status == $CRITICAL) ? (98) : (99))
    delay: up 1m down 15m multiplier 1.5 max 1h
     info: disk ${label:mount_point} space utilization
       to: sysadmin

 template: disk_inode_usage
      on: disk.inodes
    class: Utilization
     type: System
component: Disk
       os: linux freebsd
    hosts: *
 families: !/dev !/dev/* !/run !/run/* *
     calc: $used * 100 / ($avail + $used)
    units: %
    every: 1m
     warn: $this > (($status >= $WARNING)  ? (80) : (90))
     crit: $this > (($status == $CRITICAL) ? (90) : (98))
    delay: up 1m down 15m multiplier 1.5 max 1h
     info: disk ${label:mount_point} inode utilization
       to: sysadmin
Enter fullscreen mode Exit fullscreen mode

Riavviare Netdata:

systemctl restart netdata
Enter fullscreen mode Exit fullscreen mode

AWS GenAI LIVE image

Real challenges. Real solutions. Real talk.

From technical discussions to philosophical debates, AWS and AWS Partners examine the impact and evolution of gen AI.

Learn more

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more