From bc40534bce7d67d80f5994e10292471b7c3b655d Mon Sep 17 00:00:00 2001 From: Fabian Schlenz Date: Sat, 5 Sep 2020 14:42:20 +0200 Subject: [PATCH] Added field 'running' to qemu.disk. --- .../local/emhttp/plugins/zabbix_agent/scripts/disk.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/files/usr/local/emhttp/plugins/zabbix_agent/scripts/disk.sh b/files/usr/local/emhttp/plugins/zabbix_agent/scripts/disk.sh index f2516a6..12be1a2 100755 --- a/files/usr/local/emhttp/plugins/zabbix_agent/scripts/disk.sh +++ b/files/usr/local/emhttp/plugins/zabbix_agent/scripts/disk.sh @@ -9,7 +9,7 @@ while read line; do if [ $found = 1 ]; then [ $fsFree -ge 0 ] && [ $fsSize -ge 0 ] && fsUsed=$(( $fsSize - $fsFree )) echo -n '{"device":"'$device'", "name":"'$name'", "status":"'$status'", "temp":'$temp', "size":'$size', "num_reads":'$num_reads', ' - echo -n '"num_writes":'$num_writes', "num_errors":'$num_errors', "type":"'$type'", "fs_size":'$fsSize', "fs_free":'$fsFree', "fs_used":'$fsUsed', ' + echo -n '"num_writes":'$num_writes', "num_errors":'$num_errors', "type":"'$type'", "fs_size":'$fsSize', "fs_free":'$fsFree', "fs_used":'$fsUsed', "running":'$running', ' break else device='' @@ -24,6 +24,7 @@ while read line; do fsSize=-1 fsFree=-1 fsUsed=-1 + running=-1 fi else while IFS="=" read key value; do @@ -41,6 +42,12 @@ while read line; do [ $key = "type" ] && type="$value" [ $key = "fsSize" ] && fsSize=$(( $value * 1024 )) [ $key = "fsFree" ] && fsFree=$(( $value * 1024 )) + if [ $key = "color" ]; then + case "$value" in + green-on) running=1;; + green-blink) running=0;; + esac + fi done <<< "$line" fi done < <(cat /var/local/emhttp/disks.ini ; echo "[empty]")