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
check_ncpa-py json error
Re: check_ncpa-py json error
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
Re: check_ncpa-py json error
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
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
-
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: check_ncpa-py json error
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.
Re: check_ncpa-py json error
Hi.
How do i get in contact with Nick?
/Kasper
How do i get in contact with Nick?
/Kasper
-
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: check_ncpa-py json error
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.
Re: check_ncpa-py json error
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
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
-
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: check_ncpa-py json error
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.