Error check_nna.py
Error check_nna.py
Hi there,
When I run check_nna.py command I get the following error:
UNKNOWN - Error occurred while running the plugin
On the command line with the verbose option, the following error is displayed:
And error was encountered:
local variable 'text_type' referenced before assignment
Any idea what may be happening?
Thank you a lot
When I run check_nna.py command I get the following error:
UNKNOWN - Error occurred while running the plugin
On the command line with the verbose option, the following error is displayed:
And error was encountered:
local variable 'text_type' referenced before assignment
Any idea what may be happening?
Thank you a lot
Re: Error check_nna.py
Hi!
That's a bug in the script that we should hopefully have fixed in the next release.
What it should have told you instead is that the option --source NAME (AKA -S NAME) or --sourcegroup NAME (AKA -G NAME) must be specified.
You may be running this under Python 3, which this plugin isn't compatible with. What's the output from this command:
That's a bug in the script that we should hopefully have fixed in the next release.
What it should have told you instead is that the option --source NAME (AKA -S NAME) or --sourcegroup NAME (AKA -G NAME) must be specified.
You may be running this under Python 3, which this plugin isn't compatible with. What's the output from this command:
Code: Select all
python --versionIf you didn't get an 8% raise over the course of the pandemic, you took a pay cut.
Discussion of wages is protected speech under the National Labor Relations Act, and no employer can tell you you can't disclose your pay with your fellow employees.
Discussion of wages is protected speech under the National Labor Relations Act, and no employer can tell you you can't disclose your pay with your fellow employees.
Re: Error check_nna.py
Hi there!
Thank you a lot for your answer.
We have updated python,
python --version
Python 3.6.8
The command output is now as follows
./check_nna.py -H 10.16.70.11 -K 6b35edcce726bfdc1e5233608d48c85ac9c7af2 --source VMFABRICNETFLOW --exists --secure --verbose
File "./check_nna.py", line 159
print "DOWN - The " + text_type + " you are trying to use doesn't exist"
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("DOWN - The " + text_type + " you are trying to use doesn't exist")?
Thanks
Thank you a lot for your answer.
We have updated python,
python --version
Python 3.6.8
The command output is now as follows
./check_nna.py -H 10.16.70.11 -K 6b35edcce726bfdc1e5233608d48c85ac9c7af2 --source VMFABRICNETFLOW --exists --secure --verbose
File "./check_nna.py", line 159
print "DOWN - The " + text_type + " you are trying to use doesn't exist"
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("DOWN - The " + text_type + " you are trying to use doesn't exist")?
Thanks
Re: Error check_nna.py
Do you have python2 installed on your machine?
Code: Select all
which -a python2
python2 --versionIf you didn't get an 8% raise over the course of the pandemic, you took a pay cut.
Discussion of wages is protected speech under the National Labor Relations Act, and no employer can tell you you can't disclose your pay with your fellow employees.
Discussion of wages is protected speech under the National Labor Relations Act, and no employer can tell you you can't disclose your pay with your fellow employees.
Re: Error check_nna.py
Hi there!
Yes,
which -a python2
/usr/bin/python2
python2 --version
Python 2.7.5
That's the problem, right?
Thanks!
Yes,
which -a python2
/usr/bin/python2
python2 --version
Python 2.7.5
That's the problem, right?
Thanks!
Re: Error check_nna.py
The way I see it you can solve this one of three ways:
Option 0
Fix the symlink so that /usr/bin/python points to python2 - This is the default on CentOS, Ubuntu, Debian, etc. Not sure why your system has it pointing to python3:
Option 1
Modify check_nna.py so that the first line reads #!/usr/bin/env python2. This won't fix the other scripts that assume "python" means "python2".
Option 2
Update check_nna.py so that it runs in Python 3.x and send it my way so I can submit a merge request to our internal code depot, then wait for the next release.
Option 0
Fix the symlink so that /usr/bin/python points to python2 - This is the default on CentOS, Ubuntu, Debian, etc. Not sure why your system has it pointing to python3:
Code: Select all
ln -sf python2 /usr/bin/pythonModify check_nna.py so that the first line reads #!/usr/bin/env python2. This won't fix the other scripts that assume "python" means "python2".
Option 2
Update check_nna.py so that it runs in Python 3.x and send it my way so I can submit a merge request to our internal code depot, then wait for the next release.
If you didn't get an 8% raise over the course of the pandemic, you took a pay cut.
Discussion of wages is protected speech under the National Labor Relations Act, and no employer can tell you you can't disclose your pay with your fellow employees.
Discussion of wages is protected speech under the National Labor Relations Act, and no employer can tell you you can't disclose your pay with your fellow employees.
Re: Error check_nna.py
Hi there
I'm confused with your answer.
You have told me that the plugin does not work with python 2, why change the script to point to that version?
Thanks
I'm confused with your answer.
You have told me that the plugin does not work with python 2, why change the script to point to that version?
Thanks
Re: Error check_nna.py
If I implied that, I'm sorry. That's not what I'm saying.nagmites wrote:You have told me that the plugin does not work with python 2
The plugin does not work in Python 3. In fact, many plugins that Nagios uses are designed to run in Python 2.x, and will need to be re-written if they are to run in Python 3. Much of the code in those plugins assumes that /usr/bin/python is Python 2.x (the default on CentOS), and not Python 3.x (in your machine's case).
/usr/bin/python should be Python 2 or plugins will break.
Again, the fix for this:
Code: Select all
ln -sf python2 /usr/bin/pythonIf you didn't get an 8% raise over the course of the pandemic, you took a pay cut.
Discussion of wages is protected speech under the National Labor Relations Act, and no employer can tell you you can't disclose your pay with your fellow employees.
Discussion of wages is protected speech under the National Labor Relations Act, and no employer can tell you you can't disclose your pay with your fellow employees.
Re: Error check_nna.py
Hi there,
Ok,
With phyton 2 the error is the following:
/usr/local/nagios/libexec/check_nna.py -H 10.16.70.11 -K 46b35edcce726bfdc1e5233608d48c85ac9c7af2 -S 2 --exists --secure UNKNOWN - Error occurred while running the plugin.
<urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:618)>
This service has been generated automatically with the wizard
The same problem as when I asked the first time.
Thank you a lot
Ok,
With phyton 2 the error is the following:
/usr/local/nagios/libexec/check_nna.py -H 10.16.70.11 -K 46b35edcce726bfdc1e5233608d48c85ac9c7af2 -S 2 --exists --secure UNKNOWN - Error occurred while running the plugin.
<urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:618)>
This service has been generated automatically with the wizard
The same problem as when I asked the first time.
Thank you a lot
Re: Error check_nna.py
I'd either use the FQDN after -H, or add --ignorecert to the option list.
For example:
-OR-
For example:
Code: Select all
check_nna.py -H my-hostname.example.com -K 46b35edcce726bfdc1e5233608d48c85ac9c7af2 -S 2 --exists --secureCode: Select all
check_nna.py -H 10.16.70.11 -K 46b35edcce726bfdc1e5233608d48c85ac9c7af2 -S 2 --exists --secure --ignorecertIf you didn't get an 8% raise over the course of the pandemic, you took a pay cut.
Discussion of wages is protected speech under the National Labor Relations Act, and no employer can tell you you can't disclose your pay with your fellow employees.
Discussion of wages is protected speech under the National Labor Relations Act, and no employer can tell you you can't disclose your pay with your fellow employees.