Home Directory Plugins Operating Systems Windows NRPE Check S.M.A.R.T or PFA errors

Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

Check S.M.A.R.T or PFA errors

Rating
3 votes
Favoured:
0
Hits
104947
Files:
FileDescription
smartpfa.vbsvbs file for checking smart
Nagios CSP

Meet The New Nagios Core Services Platform

Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.

Monitoring Made Magically Better

  • Nagios Core on Overdrive
  • Powerful Monitoring Dashboards
  • Time-Saving Configuration Wizards
  • Open Source Powered Monitoring On Steroids
  • And So Much More!
This VBS based script checks if any SCSI and IDE disks are reporting SMART/PFA errors. In that case it returns a CRITICAL warning and lists the amount of disks reporting error. If the computer does not report any SMART monitoring, a warning is issued
Nagio/NRPE_NT VBS Script to check for harddisks about to fail, using MSStorageDriver_FailurePredictStatus from WMI

Usage
check_smartpfa
Example:
check_smartpfa
Sample Output:
OK : No PFA/S.M.A.R.T errors detected


EASY HOWTO:

1-Place the script
Copy the script to "c:nrpe_ntpluginsv2" or whatever location your NRPE_NT .vbs are at.

2-Set nrpe_nt.cfg
Inside the NRPE_NT Client Server add the command line in the file nrpe_nt.cfg:
command[check_smartpfa]=cscript.exe //nologo //T:60 c:nrpe_ntpluginsv2smartpfa.vbs

3-Restart the nrpe_nt service
net stop nrpe_nt
net start nrpe_nt

4-Define the command inside nagios
$USER1$/check_nrpe -H $HOSTADDRESS$ -c check_smartpfa

Absolutely no warranties!

In case you find a flawed harddisk using this utility, please post a review! It is near impossible to test this script without access to a failing disk.

Only known bug is that some computers simply don't have this WMI class populated. In that case a warning is issued, you should not be lulled into a false sense of security.
Reviews (3)
bysnakepit-97, January 8, 2021
there's something that configure in pluggin in server nagios?

(No output on stdout) stderr: execvp(/usr/local/nagios/libexec/check_nrpe_smart, ...) failed. errno is 2: No such file or directory
byxrated, December 28, 2013
This will just use the general overall-health attribute in Smart but a disk with broken sectors is still reported as PASSED, so this is not a reliable method of early detecting as with Smart Attributes 5,196,197,198
byMajed, August 31, 2011
of course i don't have a failing disk to see a critical state but it shows in nagios
OK : No PFA/S.M.A.R.T errors detected
here how i set it up:
1. Copy smartpfa.vbs into nsclient directory into scripts folder
2. Paste the following line into nsclient.ini file in the [wrapped scripts] sectioncheck_smartpfa=smartpfa.vbs /nologo /T:60
3. Restart nscleint in cmd type: net stop nsclientpp then net start nsclientpp
4. In nagios define the command $USER1$/check_nrpe_smart -H $HOSTADDRESS$ -c check_smartpfa
5. In services define: define service{
use generic-service
host_name myworkstation
service_description nrpe smart
check_command check_nrpe_smart
}