From b6fb20f982b0ac6232bd4c0965e33bb62840a93c Mon Sep 17 00:00:00 2001 From: Jens Harbott Date: Thu, 28 Mar 2019 10:22:54 +0000 Subject: [PATCH] Add monitoring for filesystems other than root We have hosts with an extra volume mounted to e.g. /opt, we want to monitor disk space for those volumes, too. For reference, this is how a sample list of hrStorageDescr looks like before filtering: $ php -q add_graphs.php --host-id=$HOST_ID --list-snmp-values --snmp-field=hrStorageDescr Known values for hrStorageDescr for host 350: (name) / /dev/shm /opt /opt/dib_tmp/dib_build.yFIsY6K6/mnt/tmp/yum /run /run/lock /run/user/0 /sys/fs/cgroup Cached memory Memory buffers Physical memory Shared memory Swap space Virtual memory Change-Id: Ia75448f68a0cee50a3a164a483869ab526bb8ad7 --- modules/openstack_project/files/cacti/create_graphs.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/openstack_project/files/cacti/create_graphs.sh b/modules/openstack_project/files/cacti/create_graphs.sh index c773adcd06..3d9341c313 100644 --- a/modules/openstack_project/files/cacti/create_graphs.sh +++ b/modules/openstack_project/files/cacti/create_graphs.sh @@ -54,8 +54,11 @@ function add_ds_graph { SNMP_QUERY_ID=`php -q add_graphs.php --host-id=$HOST_ID --list-snmp-queries | \ grep "SNMP - Get Mounted Partitions"|cut -f 1` +for mountpoint in $(php -q /usr/share/cacti/cli/add_graphs.php --host-id=$HOST_ID --snmp-field=hrStorageDescr --list-snmp-values | \ + grep /|grep -v -e dev -e dib_tmp -e run -e sys) ; do add_ds_graph "Host MIB - Available Disk Space" "Available Disk Space" \ - "hrStorageDescr" "/" + "hrStorageDescr" "$mountpoint" +done SNMP_QUERY_ID=`php -q add_graphs.php --host-id=$HOST_ID --list-snmp-queries | \ grep "SNMP - Interface Statistics"|cut -f 1`