performance counter not working with ncpa

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
bharvell
Posts: 2
Joined: Wed Feb 27, 2019 4:34 pm

performance counter not working with ncpa

Post by bharvell »

I'm trying to convert all of my checks from using nsclient to ncpa. I only have two checks left that look at a performance counter and I'm having trouble making it work with ncpa.

This works with check_nt
/usr/local/nagios/libexec//check_nt -H host01 -p 12489 -s TOKEN -v COUNTER -l "\\MSMQ Queue(host01\private$\queue.reportdata)\Messages in Queue","Reportdata","Messages" -w 1 -c 2

According to this page
https://support.nagios.com/kb/article/p ... s-779.html

This should work

/usr/local/nagios/libexec/check_ncpa.py -H host01 -t TOKEN -M 'windowscounters/MSMQ Queue(host01\private$\queue.reportdata)\Messages in Queue'

However I"m getting this message

UNKNOWN: An error occured connecting to API. (HTTP error: '500 INTERNAL SERVER ERROR')

Running the example for available memory comes back fine with check_ncpa.py so it's something with the MSMQ counters it doesn't like. Is this a bug with check_ncpa?
bharvell
Posts: 2
Joined: Wed Feb 27, 2019 4:34 pm

Re: performance counter not working with ncpa

Post by bharvell »

Sorry for responding to my on post, but since I know this will come up. I tried both \ and / for the path with no luck for either.
gsmith
Posts: 1253
Joined: Tue Mar 02, 2021 11:15 am

Re: performance counter not working with ncpa

Post by gsmith »

Hi

There was one more "\" you didn't try reversing to "/" :)

on Windows:

Code: Select all

typeperf "\MSMQ Queue(win-0v5rl4ot9c4\private$\admin_queue$)\Messages in Queue"
from Nagios:

Code: Select all

./check_ncpa.py -H 192.168.23.87 -t 'gjstoken' -P 5693  -M "windowscounters/MSMQ Queue(WIN-0V5RL4OT9C4\private$\admin_queue$)/Messages in Queue" -w 1 -c 2
so change yours from:

Code: Select all

/usr/local/nagios/libexec/check_ncpa.py -H host01 -t TOKEN -M 'windowscounters/MSMQ Queue(host01\private$\queue.reportdata)\Messages in Queue'
to:

Code: Select all

/usr/local/nagios/libexec/check_ncpa.py -H host01 -t TOKEN -M 'windowscounters/MSMQ Queue(host01\private$\queue.reportdata)/Messages in Queue'
Thanks
Locked