Hello all,
Ik need a little help from someone who knows perl scripting.
We use a S.M.A.R.T HDD check script that is working almost perfectly. (see attachment)
This perl script was found on the nagios-exchange site, and i've added a small portion to also warn if a Reallocated Sector is found. This all works perfectly.
But we had some HDD's that gave a lot of ATA errors but still the smart check passed on all flags.
Because it checks the attributes raw_value and the report on Health line OK or !OK. But apperently the ATA errors are not reported by smartctl as !OK .
So I found created a linux command line to find howmany ATA Errors are reported by smartctl:
smartctl -a /dev/sda | grep 'ATA Error' | cut -d " " -f 4
This only give back a number if ATA Errors are found. And just nothing if none are found.
Now I love to add this to this same check_smart script. with the right already buildin reports of other warnings and errors.
who can help me on this part of the script.??
This would be awesome..
thanks already.
Stefan Lelieveld, @Viacom Netherlands
Need help on perl scripting with addind check in check_smart
-
shlelieveld
- Posts: 4
- Joined: Thu Nov 14, 2013 5:24 am
Need help on perl scripting with addind check in check_smart
You do not have the required permissions to view the files attached to this post.
BT-IT-Specialist Viacom Amsterdam
Re: Need help on perl scripting with addind check in check_s
Are you just looking to run that system command within perl? You can just use exec() for that. Or system(). Or backticks.
http://stackoverflow.com/questions/7999 ... m-and-exec
If you're looking for help with modifying the script we can help with smaller things, but re-writing the script or adding functionality is creeping into the realm of custom development. Is there something specific you'd like? Please elaborate.
http://stackoverflow.com/questions/7999 ... m-and-exec
If you're looking for help with modifying the script we can help with smaller things, but re-writing the script or adding functionality is creeping into the realm of custom development. Is there something specific you'd like? Please elaborate.
Former Nagios employee