check_ncpa.py - ugly output

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
christimpaler
Posts: 8
Joined: Wed Jan 09, 2013 1:38 am

check_ncpa.py - ugly output

Post by christimpaler »

Hi,
we are currently moving from NRPE to NCPA.
When using check_ncpa.py I thing the output is a little ugly:

Code: Select all

./check_ncpa.py -H <HOST> --token=<TOKEN> -M 'memory/virtual/used' -u G
b"OK: Used was 61.98 GB | 'used'=61.98GB;;;"
As you can see the output is prefixed with b' which is really annoying.

Do you face the same issue? Is this intended?
Thanks.
Regards
C.I.
User avatar
jbrunkow
Posts: 441
Joined: Fri Mar 13, 2020 10:45 am

Re: check_ncpa.py - ugly output

Post by jbrunkow »

I just ran a test on my own server and I am not getting the b" preceding the output. See my output below.

Code: Select all

OK: Used was 0.19 GB | 'used'=0.19GB;;;
We could take a look at your check_ncpa.py script to see if we can discern why it is doing this. You could send the script to me so that I can examine it, or you could look at it yourself (if you know BASH) with a text editor.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
christimpaler
Posts: 8
Joined: Wed Jan 09, 2013 1:38 am

Re: check_ncpa.py - ugly output

Post by christimpaler »

Hello.
To get check_ncpa.py to work on RHEL8 I changed the Shebang-line from

Code: Select all

#!/usr/bin/env python
to

Code: Select all

#!/usr/bin/env python3
Now I changed the first line of check_ncpa.py back to

Code: Select all

#!/usr/bin/env python
, because I am now running on RHEL7.
And it works!!!

Strange.
Case can be closed.
Thx for your help.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: check_ncpa.py - ugly output

Post by benjaminsmith »

HI,
Strange.
Case can be closed.
Thx for your help
Super. Thanks for posting the solution!
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked