Page 1 of 1

ncpa error while trying to monitor hard disks.

Posted: Wed Feb 05, 2014 12:43 pm
by jsbsmd
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"
}
}

Re: ncpa error while trying to monitor hard disks.

Posted: Wed Feb 05, 2014 1:40 pm
by slansing
What is returned when you run the following from the nagios CLI?:

Code: Select all

/path/to/check_ncpa.py -H <windows.server.address> -t <token> api/disk/logical/C:
Do you not have a check_ncpa.py plugin on your nagios server?

Re: ncpa error while trying to monitor hard disks.

Posted: Wed Feb 05, 2014 2:17 pm
by jsbsmd
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

Re: ncpa error while trying to monitor hard disks. solved!!

Posted: Wed Feb 05, 2014 4:36 pm
by jsbsmd
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
}

Re: ncpa error while trying to monitor hard disks.

Posted: Thu Feb 06, 2014 11:46 am
by slansing
Ah! Excellent, once you get the hang of the NCPA syntax it is quite easy to work with.