hey all
well i created a nice script, which returns me the % of used space of a disk..
i saved it in /opt/zabbix/hd_voll:
----------------------------------------------------
#!/bin/bash
host=$1
disk=$2
mulfix=1000000000 #because bash dosnt know floats...
SUSED=$(snmpget -P e -O q $host public host.hrStorage.hrStorageTable.hrStorageEntry.hrSto rageUsed.$disk | cut -f2 -d" )
STOTAL=$(snmpget -P e -O q $host public host.hrStorage.hrStorageTable.hrStorageEntry.hrSto rageSize.$disk | cut -f2 -d ")
#echo "tot: $STOTAL"
#echo "use: $SUSED"
if [ "$STOTAL" = "0" ]
then printf 'ERROR\n'
else
if [ "$STOTAL" = "" ]
then printf 'ERROR\n'
exit 1;
fi
divres=$((100 * $mulfix / $STOTAL))
resultm=$(($divres * $SUSED))
resultUnrounded=$(($resultm / ($mulfix/10))) # a primitive rounding algo...
resultUnroundedA=$(($resultUnrounded + 5))
result=$(($resultUnroundedA /10))
echo $result
----------------------------------------------------
when i run it from the command line, it workss fine:
abcmgmt:/ # /opt/zabbix/hd_voll server01 4
66
so i edited /etc/zabbix/agentd.conf, i changed the following:
a) increased the timeout
# Spend no more than Timeout seconds on processing
# Must be between 1 and 30
Timeout=30
b)added the user parameter
UserParameter=DiskFree[SERVER01],/opt/zabbix/hd_voll server01 4
now i restartet zabbix...
in the web interface, i add a new item, type is "zabbix_agent" and the key i enter is "DiskFree[SNFSERVER01]", status "monitored", type of information is "numeric"...
the host is monitored and working fine (other snmp items)... but my script never gets checked... output from latest values:
DiskFree - - - Graph Trend Compare
no errors... any hints?
ps i testet it on zabbix v1.0 and v1.1a2
regards
michael
well i created a nice script, which returns me the % of used space of a disk..
i saved it in /opt/zabbix/hd_voll:
----------------------------------------------------
#!/bin/bash
host=$1
disk=$2
mulfix=1000000000 #because bash dosnt know floats...
SUSED=$(snmpget -P e -O q $host public host.hrStorage.hrStorageTable.hrStorageEntry.hrSto rageUsed.$disk | cut -f2 -d" )
STOTAL=$(snmpget -P e -O q $host public host.hrStorage.hrStorageTable.hrStorageEntry.hrSto rageSize.$disk | cut -f2 -d ")
#echo "tot: $STOTAL"
#echo "use: $SUSED"
if [ "$STOTAL" = "0" ]
then printf 'ERROR\n'
else
if [ "$STOTAL" = "" ]
then printf 'ERROR\n'
exit 1;
fi
divres=$((100 * $mulfix / $STOTAL))
resultm=$(($divres * $SUSED))
resultUnrounded=$(($resultm / ($mulfix/10))) # a primitive rounding algo...
resultUnroundedA=$(($resultUnrounded + 5))
result=$(($resultUnroundedA /10))
echo $result
----------------------------------------------------
when i run it from the command line, it workss fine:
abcmgmt:/ # /opt/zabbix/hd_voll server01 4
66
so i edited /etc/zabbix/agentd.conf, i changed the following:
a) increased the timeout
# Spend no more than Timeout seconds on processing
# Must be between 1 and 30
Timeout=30
b)added the user parameter
UserParameter=DiskFree[SERVER01],/opt/zabbix/hd_voll server01 4
now i restartet zabbix...
in the web interface, i add a new item, type is "zabbix_agent" and the key i enter is "DiskFree[SNFSERVER01]", status "monitored", type of information is "numeric"...
the host is monitored and working fine (other snmp items)... but my script never gets checked... output from latest values:
DiskFree - - - Graph Trend Compare
no errors... any hints?
ps i testet it on zabbix v1.0 and v1.1a2
regards
michael

. do the following
Comment