Using Negate with check_ncpa.py error after 5.7 Upgrade
Posted: Tue Jan 05, 2021 11:10 am
I upgraded Nagios XI to version 5.7.5 this morning and I'm running a negate check that is now reporting the following error:
File "/usr/local/nagios/libexec/check_ncpa.py", line 353, in <module>
print(stdout.encode('utf-8', 'replace').decode('utf-8'))
UnicodeEncodeError: 'ascii' codec can't encode character u'\\u2019' in position 220: ordinal not in range(128)
Here is the command:
$USER1$/negate -u OK -o WARNING -s $USER1$/check_ncpa.py -H SELENIUM_HOST -t "$_HOSTNCPA_TOKEN$" -P $_HOSTNCPA_PORT$ -M 'plugins/p3ui' -a "fed 'config/iam-cas.json' --starturl 'https://$HOSTNAME$' --logname $USER13$ --password '$USER12$'"
To summarize, Nagios XI is calling a Selenium check (via NCPA) that is running from our Selenium server and reporting the results back to Nagios XI. In this case, the check is attempting to run against a failover system, so by default, the result would be unknown, so we change that result using negate so that the Unknown reports as OK.
The upgrade was installed via command line as root using the manual download instructions in https://assets.nagios.com/downloads/nag ... ctions.pdf
Also, from /var/log/yum.log
Jan 05 06:24:06 Installed: perl-TermReadKey-2.30-20.el7.x86_64
Jan 05 06:24:06 Installed: perl-Git-1.8.3.1-23.el7_8.noarch
Jan 05 06:24:07 Installed: git-1.8.3.1-23.el7_8.x86_64
Jan 05 06:24:07 Updated: nagiosxi-deps-el7-5.7.5-1.noarch
Any assistance is greatly appreciated.
File "/usr/local/nagios/libexec/check_ncpa.py", line 353, in <module>
print(stdout.encode('utf-8', 'replace').decode('utf-8'))
UnicodeEncodeError: 'ascii' codec can't encode character u'\\u2019' in position 220: ordinal not in range(128)
Here is the command:
$USER1$/negate -u OK -o WARNING -s $USER1$/check_ncpa.py -H SELENIUM_HOST -t "$_HOSTNCPA_TOKEN$" -P $_HOSTNCPA_PORT$ -M 'plugins/p3ui' -a "fed 'config/iam-cas.json' --starturl 'https://$HOSTNAME$' --logname $USER13$ --password '$USER12$'"
To summarize, Nagios XI is calling a Selenium check (via NCPA) that is running from our Selenium server and reporting the results back to Nagios XI. In this case, the check is attempting to run against a failover system, so by default, the result would be unknown, so we change that result using negate so that the Unknown reports as OK.
The upgrade was installed via command line as root using the manual download instructions in https://assets.nagios.com/downloads/nag ... ctions.pdf
Also, from /var/log/yum.log
Jan 05 06:24:06 Installed: perl-TermReadKey-2.30-20.el7.x86_64
Jan 05 06:24:06 Installed: perl-Git-1.8.3.1-23.el7_8.noarch
Jan 05 06:24:07 Installed: git-1.8.3.1-23.el7_8.x86_64
Jan 05 06:24:07 Updated: nagiosxi-deps-el7-5.7.5-1.noarch
Any assistance is greatly appreciated.