check_ncpa-py json error

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
Kasper
Posts: 12
Joined: Sun Apr 07, 2013 10:39 am
Location: Denmark, Koege
Contact:

check_ncpa-py json error

Post by Kasper »

Hi.

Executing check_ncpa.py gives me this error:

kasper@gf:/usr/local/nagios/libexec$ ./check_ncpa.py -vvv -H webserver -t 'athome' 'cpu/percent'
Unable to parse json output
And error was encountered:
local variable 'rjson' referenced before assignment

I am pretty sure that there is not a variable initialization error as everyone else would suffer from the same issue.

I have checked that i have python-cjson and python-simplejson installed, do you have any other suggestions?

BR.

Kasper
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: check_ncpa-py json error

Post by tmcdonald »

What OS and version are you running this on? I know some repositories do not have the stock python-json so they use python-simplejson instead, and there might be some compatibility issues there.
Former Nagios employee
Kasper
Posts: 12
Joined: Sun Apr 07, 2013 10:39 am
Location: Denmark, Koege
Contact:

Re: check_ncpa-py json error

Post by Kasper »

I'm running this from ubuntu 12.04.4

I think theres a check in the top of the script, using simplejson if theres no json:
try:
import json
except:
import simplejson as json

If simplejson wasn't supported, it should be mentioned, and the script would'nt be made like this? (my opinion)

/Kasper
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: check_ncpa-py json error

Post by sreinhardt »

Well, I'm sure Nick wouldn't have put it in as an acceptable alternative to standard json, if it wouldn't work. But I will definitely check with him and try some testing of it.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Kasper
Posts: 12
Joined: Sun Apr 07, 2013 10:39 am
Location: Denmark, Koege
Contact:

Re: check_ncpa-py json error

Post by Kasper »

Hi.

How do i get in contact with Nick?

/Kasper
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: check_ncpa-py json error

Post by sreinhardt »

You can post to the github issues page: https://www.github.com/nagiosenterprises/ncpa, otherwise once we see him, we will ask. He's got personal stuff this week.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Kasper
Posts: 12
Joined: Sun Apr 07, 2013 10:39 am
Location: Denmark, Koege
Contact:

Re: check_ncpa-py json error

Post by Kasper »

Hi.
Just to let anyone who might be interested know, Scot contacted me by mail and suggested to get the newest version of the plugin, as the issue i had was from an old version.
I got the new version, and it works.
I got the first version from here: http://assets.nagios.com/downloads/ncpa/check_ncpa.py

/Kasper
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: check_ncpa-py json error

Post by sreinhardt »

Great! Thanks for posting back to let us know its resolved.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Locked