Has anyone successfully monitored the percent free of a standard windows logical hard disk. I have tried various syntax however it fails with the following error depending on the syntax.
eg: check_command check_ncpa_agent! -t abc -M api/disk/logical/C:|/used_percent --warning 10 --critical 20
error: (Return code of 127 is out of bounds - plugin may be missing)
eg: check_command check_ncpa_agent! -t abc -M api/disk/logical/C:%7C/used_percent --warning 10 --critical 20
error: UNKNOWN: Error occurred while running the plugin.
if i run the command directly on the server from a web gui it works..
_https://localhost:5693/api/disk/logical/C:%7C/used_percent?token=abc&warning=1&critical=2&check=true
output:
{
"value": {
"returncode": 2,
"stdout": "CRITICAL: Used_percent was 26.8%|'used_percent_0'=26.8%;1;2"
}
}
ncpa error while trying to monitor hard disks.
ncpa error while trying to monitor hard disks.
Last edited by jsbsmd on Wed Feb 05, 2014 1:40 pm, edited 1 time in total.
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: ncpa error while trying to monitor hard disks.
What is returned when you run the following from the nagios CLI?:
Do you not have a check_ncpa.py plugin on your nagios server?
Code: Select all
/path/to/check_ncpa.py -H <windows.server.address> -t <token> api/disk/logical/C:Re: ncpa error while trying to monitor hard disks.
i do have check_ncpa.py installed. below is the output both both syntax versions.
root@ubuntu-server:/usr/local/nagios/libexec# ./check_ncpa.py -H procim-server2 -t abc -M 'api/disk/logical/C:|/used_percent' --warning 10 --critical 20 -v
And error was encountered:
[Errno socket error] [Errno -2] Name or service not known
root@ubuntu-server:/usr/local/nagios/libexec# ./check_ncpa.py -H procim-server2 -t abc -M 'api/disk/logical/C:%7C/used_percent' --warning 10 --critical 20 -v
And error was encountered:
unsupported format character 'C' (0x43) at index 53
root@ubuntu-server:/usr/local/nagios/libexec# ./check_ncpa.py -H procim-server2 -t abc -M 'api/disk/logical/C:|/used_percent' --warning 10 --critical 20 -v
And error was encountered:
[Errno socket error] [Errno -2] Name or service not known
root@ubuntu-server:/usr/local/nagios/libexec# ./check_ncpa.py -H procim-server2 -t abc -M 'api/disk/logical/C:%7C/used_percent' --warning 10 --critical 20 -v
And error was encountered:
unsupported format character 'C' (0x43) at index 53
Re: ncpa error while trying to monitor hard disks. solved!!
it was a mixure of syntax and hostname.
fyi:
define service{
use generic-service
host_name server2
service_description Drive Percentage D:\ warning:80 critical:90
check_command check_ncpa_agent! -t abc -M 'api/disk/logical/D:|/used_percent' -w 80 -c 90
#notification_interval 0
}
fyi:
define service{
use generic-service
host_name server2
service_description Drive Percentage D:\ warning:80 critical:90
check_command check_ncpa_agent! -t abc -M 'api/disk/logical/D:|/used_percent' -w 80 -c 90
#notification_interval 0
}
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: ncpa error while trying to monitor hard disks.
Ah! Excellent, once you get the hang of the NCPA syntax it is quite easy to work with.