Monitoring of Windows server Disk Space by Size, rather than by percentage
My requirement is to monitor Disk Space by Size and Change the Threshold from % to values in windows Server, from the support forum i followed instruction from the link and used a vb script for getting the disk usage in GB but on integrating with nagios is getting error: "UNKNOWN: No handler for that command "
Vb scipt for disk utilication from GB is take from the link https://exchange.nagios.org/directory/P ... ce/details
Please find the nsc.ini where i mention the script
[/settings/external scripts/wrapped scripts]
allow arguments=true
check_disk_gb-=cscript.exe //T:30 //NoLogo "scripts\\check_disk.vbs" /w:40 /c:20 /d:C /u:GB
i there any thing to be added for running the script
Monitoring of Disk Space by Size, rather than by percentage
Re: Monitoring of Disk Space by Size, rather than by percent
Most probably you will need to move your command to the [/settings/external scripts/scripts] section. It is also possible that you forgot to enable external scripts module under [/modules]:
To be sure, we will need to see the entire nsclient.ini file. Please remove sensitive info, i.e. passwords, IP addresses.
Is there any reason that you are not using the check_nrpe with check_drivesize (instead of a custom script)?
Example:
For more info: https://support.nagios.com/kb/article/d ... s-770.html
Code: Select all
CheckExternalScripts = 1
Is there any reason that you are not using the check_nrpe with check_drivesize (instead of a custom script)?
Example:
Code: Select all
[root@main-nagios-xi libexec]# ./check_nrpe -H x.x.x.x -c check_drivesize -a drive=C: 'warning=used>100G' 'critical=used>150G' show-all 'perf-config=*(unit:G)' detail-syntax='{${drive_or_name} ${used} used / ${size} total}' top-syntax='${status}: ${problem_list}'
OK: {C: 77.395GB used / 107.47GB total}|'C: used'=77.39539G;100;150;0;107.46972 'C: used %'=72%;93;139;0;100
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Monitoring of Disk Space by Size, rather than by percent
Thanks very much for your quick response and will try using your method.
Re: Monitoring of Disk Space by Size, rather than by percent
I tried with the command given in previous comment,but getting an error"CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.
i am running this from my nagios core server.
i am running this from my nagios core server.
Re: Monitoring of Disk Space by Size, rather than by percent
Can you post the nsclient.ini and nsclient.log? Please remove sensitive info, i.e. passwords, IP addresses.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Monitoring of Disk Space by Size, rather than by percent
Please find the attached nsclient and nsclient log file,tried both but getting error from client server working as expeccted but while running from nagios server throwing error.
Exception processing request: Request contained arguments (not currently allowed, check the allow arguments option).
CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.
Exception processing request: Request contained arguments (not currently allowed, check the allow arguments option).
CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.
- Attachments
-
- nsclient.log
- (5.71 KiB) Downloaded 511 times
-
- nsclient.ini
- (7.32 KiB) Downloaded 509 times
Re: Monitoring of Disk Space by Size, rather than by percent
The following error:
lines to BOTH, the [/settings/NRPE/server] AND [/settings/external scripts] section, and restart the nsclient++ service.
Can you show us the check that you are running on the nagios server against the Windows machine, along with the output of it? Are you using check_nrpe with the check_drivesize command or you are calling the "check_disk_gb-" script?
If you are using the second option, you will need to change this:
to this:
provided, the "check_disk.vbs" script is located in the NSClient++ scripts directory. I don't have this script, so I can't test it in-house but the arguments are "hardcoded", so you should be able to just run (on the nagios server):
Note: Don't forget that every time you make changes in the nsclient.ini file, you need to restart the nsclient++ service, so that the changes can take effect. Also, you are missing many options in the config file. If needed, you could add all of the "defaults" by running the following command from the Windows CMD as administrator:
See the top section of the nsclient.ini file.
can be usually resolved if you add:Exception processing request: Request contained arguments (not currently allowed, check the allow arguments option).
Code: Select all
allow arguments = 1
allow nasty characters = 1
Can you show us the check that you are running on the nagios server against the Windows machine, along with the output of it? Are you using check_nrpe with the check_drivesize command or you are calling the "check_disk_gb-" script?
If you are using the second option, you will need to change this:
Code: Select all
[External Scripts]
check_disk_gb-=cscript.exe //T:30 //NoLogo check_disk.vbs /w:52 /c:30 /d:C /p /u:GB
Code: Select all
[/settings/external scripts/scripts]
check_disk_gb = cscript.exe //T:30 //NoLogo scripts\check_disk.vbs /w:52 /c:30 /d:C /p /u:GB
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H <ip address> -c check_disk_gb
Code: Select all
nscp settings --generate --add-defaults --load-all
Be sure to check out our Knowledgebase for helpful articles and solutions!