Welcome to the Pandora FMS Module Library

 
This is a library with modules, documentation and tools for Pandora FMS users, both public Open Source and Enterprise. Please use your support credentials (same as used to enter support/ticketing system) in the menu to your right. You will be granted access to a resourceful module library, such as Oracle, VMware, JBoss and others, ready to be used in production enviroments, with official professional support from Artica. If you do not own an enterprise account, you still can browse and download lots of modules, you can even register a free account and contribute with your own modules/tools for other public users.

Home > Miscelaneous

S.M.A.R.T status

Author: Create in: 03/27/2014 Update in: 03/28/2014
Rating:
Module type : Agent plugin


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