parent
f9d3f81616
commit
b3f251e937
3 changed files with 21 additions and 0 deletions
@ -0,0 +1,7 @@ |
|||||||
|
# Discover S.M.A.R.T. capable hard drives |
||||||
|
# The only macro returned is {#SMARTDRIVE} and value is like /dev/sda |
||||||
|
UserParameter=hardward.disk.smart.discovery,/usr/bin/sudo /var/lib/zabbix/bin/disco_smart_sudo |
||||||
|
|
||||||
|
# Takes two args: the drives to check, and the value to get |
||||||
|
# eg: hardward.disk.smart[/dev/sda,Reallocated_Sector_Ct] |
||||||
|
UserParameter=hardward.disk.smart[*],/usr/bin/sudo /var/lib/zabbix/bin/check_smart_sudo $1 $2 |
@ -0,0 +1,2 @@ |
|||||||
|
#!/bin/sh |
||||||
|
/usr/sbin/smartctl -A $1 | grep $2 | tail -1| cut -c 88- | cut -f1 -d' ' |
@ -0,0 +1,12 @@ |
|||||||
|
#!/bin/bash |
||||||
|
|
||||||
|
echo -e "{\n\t\"data\":[\n\n" |
||||||
|
for DISK in $(smartctl --scan-open | cut -d' ' -f1); do |
||||||
|
smartctl -A $DISK >/dev/null 2>&1 |
||||||
|
if [ $? -eq 0 ]; then |
||||||
|
echo -e "\t{\n" |
||||||
|
echo -e "\t\t\"{#SMARTDRIVE}\":\"$DISK\"" |
||||||
|
echo -e "\t}" |
||||||
|
fi |
||||||
|
done |
||||||
|
echo -e "\n\t]\n}\n" |
Loading…
Reference in new issue