Page 1 of 2
send_nrdp issue after upgrade to 5.8.3
Posted: Wed May 12, 2021 5:50 am
by hbouma
We upgraded our Nagios XI instances from 5.8.1 to 5.8.3 in RHEL 7. After the upgrade, the NRDP script started using python3 instead of python2, which caused several critical notifications to not get sent.
In researching this, it appears that there are no change log notes indicating that the python version would change, nor did the install script verify that python3 nor any of the critical modules of python3 install.
After installing python3 manually, we are still getting the following error:
Code: Select all
/usr/local/nrdp/clients/send_nrdp.py
Traceback (most recent call last):
File "/usr/local/nrdp/clients/send_nrdp.py", line 50, in <module>
from future.standard_library import install_aliases
ModuleNotFoundError: No module named 'future'
I need help with 2 issues here.
1) Get the Python 3 version of send_nrdp.py working so that we do not have issues like this in the future.
2) Understand why the change logs didn't reference the upgrade dependency of Python3 and why the installation script didn't check to verify that all critical requirements were installed (Python3 and all modules required for this script).
Re: send_nrdp issue after upgrade to 5.8.3
Posted: Wed May 12, 2021 2:08 pm
by vtrac
Hi,
How are you doing?
Upgrade XI from 5.8.1 to 5.8.3 do not require python 3 version.
Python version must have been changed by OS installed or upgraded.
Can you please run the below commands on your XI command prompt? .... please update outputs or screenshots.
Code: Select all
which python
ls -l /usr/bin/python*
rpm -qa | grep python
Based on the above outputs, we can determine if you have python2 or python3 installed (or both).
You can use symbolic link command to point "python" to either python2 or python3. Here's an example of my "python"
As you can see from the below outputs of "/usr/bin/", "python" was linked to "python2".
So, when I do "python --version" I should get "2.7" version.
Code: Select all
[root@vt-nagiosxi-62 libexec]# ls -l /usr/bin/python*
lrwxrwxrwx 1 root root 7 Apr 14 09:43 /usr/bin/python -> python2
lrwxrwxrwx 1 root root 9 Apr 14 09:43 /usr/bin/python2 -> python2.7
-rwxr-xr-x 1 root root 7144 Nov 16 16:23 /usr/bin/python2.7
-rwxr-xr-x 1 root root 1835 Nov 16 16:23 /usr/bin/python2.7-config
lrwxrwxrwx 1 root root 16 Apr 14 09:44 /usr/bin/python2-config -> python2.7-config
lrwxrwxrwx 1 root root 14 Apr 14 09:44 /usr/bin/python-config -> python2-config
Also, "send_nrdp.py" came from Nagios Exchange, which is NOT packaged with Nagios XI.
We will try our best to help you get "send_nrdp.py" working.
If you decided to stay with your current python3 version, then you could try to install the missing "future" module.
You can run the below command on your XI command prompt:
Regards,
Vinh
Re: send_nrdp issue after upgrade to 5.8.3
Posted: Wed May 12, 2021 2:26 pm
by hbouma
Code: Select all
which python
python is /bin/python
python is /usr/bin/python
Code: Select all
ls -l /usr/bin/python*
lrwxrwxrwx 1 root root 7 Nov 21 03:20 /usr/bin/python -> python2
lrwxrwxrwx 1 root root 9 Nov 21 03:20 /usr/bin/python2 -> python2.7
-rwxr-xr-x 1 root root 7144 Aug 13 2020 /usr/bin/python2.7
-rwxr-xr-x 1 root root 1835 Aug 13 2020 /usr/bin/python2.7-config
lrwxrwxrwx 1 root root 16 Nov 21 03:22 /usr/bin/python2-config -> python2.7-config
lrwxrwxrwx 1 root root 14 Nov 21 03:22 /usr/bin/python-config -> python2-config
Python 3 was not installed on the servers. The output we got when using send_nrdp.py is
/usr/bin/env: python3: No such file or directory
The send_nrdp.py file starts with this line after the upgrade:
#!/usr/bin/env python3
and we now have a file called send_nrdp_py2.py that contains this as the first line:
#!/usr/bin/env python
Upgrade.log shows:
DATE: Mon May 10 09:35:28 EDT 2021
with the timestamp of the final write to the upgrade.log of 9:59AM on 5/10/2021.
The timestamp on the send_nrdp.py file shows it was changed at 09:35:47AM on 05/10/2021
Code: Select all
-stat send_nrdp.py
File: ‘send_nrdp.py’
Size: 8893 Blocks: 20 IO Block: 1024 regular file
Device: fd13h/64787d Inode: 13 Links: 1
Access: (0755/-rwxr-xr-x) Uid: ( 1000/ nagios) Gid: ( 500/ nagios)
Access: 2020-08-31 01:38:14.000000000 -0400
Modify: 2021-05-10 09:35:47.000000000 -0400
Change: 2021-05-10 09:35:47.000000000 -0400
Re: send_nrdp issue after upgrade to 5.8.3
Posted: Wed May 12, 2021 2:52 pm
by vtrac
Hi,
My bad!! ... I was looking under "/usr/local/nagios/libexec" and did not see "send_nrdp_py2.py" or "send_nrdp_py.py".
So, looks like your can start using "send_nrdp_py2.py" instead.
Great!!
Regards,
Vinh
Re: send_nrdp issue after upgrade to 5.8.3
Posted: Wed May 12, 2021 2:54 pm
by hbouma
That does not fix my issue. We have hundreds of scripts all pointing to send_nrdp.py on the server. Changing them all to send_nrdp_py2.py would be a major undertaking.
Please help me with the following:
1) Get the Python 3 version of send_nrdp.py working so that we do not have issues like this in the future.
2) Understand why the change logs didn't reference the upgrade dependency of Python3 and why the installation script didn't check to verify that all critical requirements were installed (Python3 and all modules required for this script).
Re: send_nrdp issue after upgrade to 5.8.3
Posted: Wed May 12, 2021 3:07 pm
by vtrac
Hi,
You can try this.
Code: Select all
cp /usr/local/nrdp/clients/send_nrdp.py /usr/local/nrdp/clients/send_nrdp.py.python3-save
ln -s /usr/local/nrdp/clients/send_nrdp_py2.py /usr/local/nrdp/clients/send_nrdp.py
Regards,
Vinh
Re: send_nrdp issue after upgrade to 5.8.3
Posted: Thu May 13, 2021 6:12 am
by hbouma
Hi,
Yes, this will temporarily set the Python 2 version to be used, however, future upgrades will revert this to Python 3.
Please help us with the following 2 requests:
1) Get the Python 3 version of send_nrdp.py working so that we do not have issues like this in the future. We need to know what dependencies are needed by the Python3 version of send_nrdp.py.
2) Understand why the change logs didn't reference the upgrade dependency of Python3 and why the installation script didn't check to verify that all critical requirements were installed (Python3 and all modules required for this script).
Re: send_nrdp issue after upgrade to 5.8.3
Posted: Thu May 13, 2021 2:47 pm
by vtrac
Hi
I'm very sorry for the trouble this has caused.
My senior team member has contacted development and here's the replied from development team member:
Python 2 is deprecated, and we don't use it in XI, so it just updates, they can downgrade it if they wish
1) Get the Python 3 version of send_nrdp.py working so that we do not have issues like this in the future. We need to know what dependencies are needed by the Python3 version of send_nrdp.py.
To be able to use "send_nrdp.py" you must install or update your NRDP system to Python 3.
Please NOTE that "send_nrdp.py" is not being used by Nagios XI. It was put there as a place holder for someone that want to use the script.
2) Understand why the change logs didn't reference the upgrade dependency of Python3 and why the installation script didn't check to verify that all critical requirements were installed (Python3 and all modules required for this script).
Since this "send_nrdp.py" is NOT being used by XI itself, which is why it was not mentioned in the XI change log.
Best Regards,
Vinh
Best Regards,
Vinh
Re: send_nrdp issue after upgrade to 5.8.3
Posted: Mon May 24, 2021 8:18 am
by hbouma
vtrac wrote:To be able to use "send_nrdp.py" you must install or update your NRDP system to Python 3.
We have updated to install the Python 3 package, but it appears that additional items are needed. (the Python3 version of send_nrdpy.py was moved to send_nrdp_py3.py on our system for testing).
Code: Select all
./send_nrdp_py3.py
Traceback (most recent call last):
File "./send_nrdp_py3.py", line 50, in <module>
from future.standard_library import install_aliases
ModuleNotFoundError: No module named 'future'
Since this "send_nrdp.py" is NOT being used by XI itself, which is why it was not mentioned in the XI change log.
I do understand that NRDP is not part of Nagios itself, but the Nagios XI upgrade is actually updating the product. Common sense would indicate that if your program is upgrading something, then the upgrade notes would make mention of that upgrade.
I also am confused why the upgrade would not do any type of quality check to make sure that the upgraded component works properly. I.E. doing a check to make sure that the Python 3 version and dependencies are installed. I know this is done for Nagios XI components, but, again, the upgrade for XI also upgrades these parts and no check was done for them.
Re: send_nrdp issue after upgrade to 5.8.3
Posted: Mon May 24, 2021 1:42 pm
by vtrac
Hi,
Hope you day is going well!!
Looks like your remote NRDP system is missing the "future" package for python3.
As "root", please run the below command on your NRDP system to install "future" package:
Code: Select all
python3 -m pip install future
or
pip install future
Best Regards
Vinh