:
Do a S.M.A.R.T status test with smartctl tool on all the system’s disks and create a module for each.
To use it, save it with name “smart_status” on plugins folder on pandora agent, and add the following line on the configuration file:
module_plugin smart_status
Author: Manuel Angel Fernandez
His blog: http://rastreador.com.es/
Module data
#!/bin/bash
OK="PASSED"
for i in $(smartctl --scan | awk {'print $1'})
do
SMART=$(smartctl -H $i | grep "SMART overall-health self-assessment test result"|tr -d " " |awk '{split($0,a,":");print a[2]}')
if [ $SMART != $OK ]
then
OUT="1"
DESC="ERROR ON DISK $i"
else
OUT="0"
DESC="Check of HD $i errors with smart"
fi
echo "<module>";
echo "<name>< ![CDATA[Smart $i]]></name>";
echo "<type>< ![CDATA[generic_data]]></type>";
echo "<data>< ![CDATA[$OUT]]></data>";
echo "<description>< ![CDATA[$DESC]]></description>";
echo "<min_critical>1</min_critical>";
echo "</module>"; done
(Visited 733 times, 1 visits today)