check_ncpa and combined results

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
vAJ
Posts: 456
Joined: Thu Nov 08, 2012 5:09 pm
Location: Austin, TX

check_ncpa and combined results

Post by vAJ »

Scratching my head over this one, folks.

Trying to get combined values back using check_ncpa.py (0.3.5).

API call works great: /api/disk/logical/C:%7C?check=1&units=G

Code: Select all

{
  "value": {
    "returncode": 0, 
    "stdout": "OK: used_percent was 89% -- total_size was 64Gb -- used was 57Gb -- free was 7Gb | 'used_percent_0'=89%;;;"
  }
}
But I'm not able to get it to work in the script call.

Code: Select all

-t 'mytoken' -P 5693 -M 'disk/logical/C:|?check=1&&units=G'
Isn't cutting it.

Thoughts?
Andrew J. - Do you even grok?
vAJ
Posts: 456
Joined: Thu Nov 08, 2012 5:09 pm
Location: Austin, TX

Re: check_ncpa and combined results

Post by vAJ »

Aha. Leave it without defining a metric for disk and it defaults to used_percent. Set your unit to desired (B, M, G) and you're all set.

Code: Select all

-t 'mytoken' -P 5693 -M 'disk/logical/C:|/' -u M -w 80 -c 90
Andrew J. - Do you even grok?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: check_ncpa and combined results

Post by lmiltchev »

Yes, this should work:

Code: Select all

[root@localhost libexec]# ./check_ncpa.py -H x.x.x.x -t 'token' -P 5693 -M 'disk/logical/C:|/' -u M -w 80 -c 90
OK: used_percent was 38% -- total_size was 115394Mb -- used was 44087Mb -- free was 71307Mb | 'used_percent_0'=38%;80;90;
Let us know if it is safe to lock the thread.
Be sure to check out our Knowledgebase for helpful articles and solutions!
vAJ
Posts: 456
Joined: Thu Nov 08, 2012 5:09 pm
Location: Austin, TX

Re: check_ncpa and combined results

Post by vAJ »

Lock it up!
Andrew J. - Do you even grok?
Locked