NSClient++ and monitor hdd SMART
-
ThinkFast86
- Posts: 26
- Joined: Fri Jul 24, 2015 5:30 am
NSClient++ and monitor hdd SMART
Ηι all,
I'd like to ask you if there is any way to monitor over Nagios core on Linux server the HDD health?
I know that i can monitor the usage of hdd but is there any other way to monitor health or i have to do my own script?
I am already using NSClient++ on some hosts for monitoring the usage of hdd so i prefer to use this or you can tell me another way.
Thank you in advance.
I'd like to ask you if there is any way to monitor over Nagios core on Linux server the HDD health?
I know that i can monitor the usage of hdd but is there any other way to monitor health or i have to do my own script?
I am already using NSClient++ on some hosts for monitoring the usage of hdd so i prefer to use this or you can tell me another way.
Thank you in advance.
Re: NSClient++ and monitor hdd SMART
There is a default plugin called 'check_ide_smart' that should be installed on your Nagios box. Though I'm not 100% sure how to set NSClient++ up to work with that script, it's the one that you need.
Check for the plugin:
Check for the plugin:
Code: Select all
/usr/local/nagios/libexec/check_ide_smart --help-
ThinkFast86
- Posts: 26
- Joined: Fri Jul 24, 2015 5:30 am
Re: NSClient++ and monitor hdd SMART
How can i make a service with this plugin? Is it working with snmp?
Do i must make a new service with this command?
Do i must make a new service with this command?
Re: NSClient++ and monitor hdd SMART
What is the version of Nagios Core are you running?
Do you want to monitor the SMART settings for the Nagios Core system or a remote system?
If you do want to monitor a remote system, what types of systems are they and the OS version they are running?
The check_ide_smart plugin will only work if it is installed on the local system, it cannot monitor a remote system's HDD.
Do you want to monitor the SMART settings for the Nagios Core system or a remote system?
If you do want to monitor a remote system, what types of systems are they and the OS version they are running?
The check_ide_smart plugin will only work if it is installed on the local system, it cannot monitor a remote system's HDD.
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
ThinkFast86
- Posts: 26
- Joined: Fri Jul 24, 2015 5:30 am
Re: NSClient++ and monitor hdd SMART
The version of Nagios is 4.0.8.
Yes i want to monitor remote systems and that systems have Windows 8 as OS.
No i don't want to monitor the SMART from Nagios.
Is that possible?
Yes i want to monitor remote systems and that systems have Windows 8 as OS.
No i don't want to monitor the SMART from Nagios.
Is that possible?
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: NSClient++ and monitor hdd SMART
Using NSClient++ and check_nrpe I think you could do a WMI check.
First, I found some information about SMART and WMI here:
http://www.gregorystrike.com/2012/08/03 ... -remotely/
Then, in NSClient++ you need the modules enabled:
Then I think this command would be a good starting point:
NOTE: I tested this with NSClient++ 0.3.9.330 and 0.4.1.105. From memory I think the newer versions of NSClient++ have issues with the CheckWMI module.
First, I found some information about SMART and WMI here:
http://www.gregorystrike.com/2012/08/03 ... -remotely/
Then, in NSClient++ you need the modules enabled:
Code: Select all
[/modules]
CheckWMI = enabled
NRPEServer = enabledCode: Select all
Command:
./check_nrpe -H win2008r2-01 -c CheckWMI -a 'Query=Select DeviceID,Status from win32_DiskDrive'
Output:
DeviceID=\\.\PHYSICALDRIVE0Status=OKDeviceID=\\.\PHYSICALDRIVE1Status=OKDeviceID=\\.\PHYSICALDRIVE2Status=OKDeviceID=\\.\PHYSICALDRIVE3Status=OK|'wmi query'=4As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
ThinkFast86
- Posts: 26
- Joined: Fri Jul 24, 2015 5:30 am
Re: NSClient++ and monitor hdd SMART
At the command line it works great and returns the same results as your.
When i creat the service for the host i receive the error message "WMIQuery failed: ExecQuery of '' failed: unknown error: 1: Incorrect function. "
And if i use CheckWMIvalue instead of CheckWMI i receive the error : Unknown argument: -a "Query
Do you know why the syntax of the service is like this:
When i creat the service for the host i receive the error message "WMIQuery failed: ExecQuery of '' failed: unknown error: 1: Incorrect function. "
And if i use CheckWMIvalue instead of CheckWMI i receive the error : Unknown argument: -a "Query
Do you know why the syntax of the service is like this:
Code: Select all
[icode]define service{
use generic-service
host_name windows 8
service_description SMART
check_command check_nrpe!CheckWMI!-a "Query=Select DeviceID,Status from win32_DiskDrive"
contacts nagiosadmin
notification_interval 60
notification_period 24x7
}Re: NSClient++ and monitor hdd SMART
One thing you could try is to use single quotes in your command.
Change this from
to
in your service chack to see if the resolves it for you.
Could you post how your check_nrpe command is defined in your commands.cfg file?
Make sure you don't have the -a argument defined twice in the command.
Change this from
Code: Select all
check_command check_nrpe!CheckWMI!-a "Query=Select DeviceID,Status from win32_DiskDrive"Code: Select all
check_command check_nrpe!CheckWMI!-a 'Query=Select DeviceID,Status from win32_DiskDrive'Could you post how your check_nrpe command is defined in your commands.cfg file?
Make sure you don't have the -a argument defined twice in the command.
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
ThinkFast86
- Posts: 26
- Joined: Fri Jul 24, 2015 5:30 am
Re: NSClient++ and monitor hdd SMART
Like this:
Code: Select all
define command{
command_name check_nrpe
command_line /usr/lib/nagios/plugins/check_nrpe -H '$HOSTADDRESS$' -c '$ARG1$' -a '$ARG2$'
}-
ThinkFast86
- Posts: 26
- Joined: Fri Jul 24, 2015 5:30 am
Re: NSClient++ and monitor hdd SMART
I receive again the same error message:
WMIQuery failed: ExecQuery of '' failed: unknown error: 1: Incorrect function
WMIQuery failed: ExecQuery of '' failed: unknown error: 1: Incorrect function