Page 1 of 1

Beware of spaces in checks with new NCPA

Posted: Wed Dec 21, 2016 3:54 pm
by vAJ
I found something, not a bug, but an improvement, that doesn't appear to be referenced in the changelogs for check_ncpa (component) or NCPA (agent) 2.0.

Previous versions of check_ncpa you had to use %20 instead of spaces. This was most common in PerfMon counter checks. The newer script does not and allows spaces:

DOESN'T WORK (now just returns 0 value):

Code: Select all

 /usr/local/nagios/libexec/check_ncpa.py -H $HOST$ -t $TOKEN$ -P 5693 -M "windowscounters/MSMQ Queue(brhpmsgp1/private\$/p_ps2hrp_data)/Messages%20in%20Queue" 
Updated:

Code: Select all

/usr/local/nagios/libexec/check_ncpa.py -H $HOST$ -t $TOKEN$ -P 5693 -M "windowscounters/MSMQ Queue(brhpmsgp1/private$/p_ps2hrp_data)/Messages in Queue" 

FYI - Hope this helps. Check your service checks when upgrading this component. And MAJOR THANKS to the Devel team for releasing a much needed NCPA upgrade!

I feel like George Bailey running around the town yelling Merry Christmas ;)

**EDIT: reference to escaping characters was removed. I show in the updated check that I removed the escape for the $. This works both ways with check_ncpa.py v1.0.2

Re: Beware of spaces in checks with new NCPA

Posted: Thu Dec 22, 2016 1:32 pm
by avandemore
Thank you for the feedback. It has been reported to the developers.

Re: Beware of spaces in checks with new NCPA

Posted: Thu Dec 22, 2016 1:37 pm
by rkennedy
In addition to what @avandemore mentioned, Jake said the documentation has been updated.

Re: Beware of spaces in checks with new NCPA

Posted: Thu Dec 22, 2016 7:03 pm
by vAJ
Thanks guys.

And just to be clear, I'm glad for the change. This is in no way a bug. This is good design and moving the ball forward. Greatly appreciated.

Lock it!

Re: Beware of spaces in checks with new NCPA

Posted: Tue Dec 27, 2016 10:10 am
by rkennedy
We appreciate the feedback!

/locked