xi upgrade fails with python error

This support forum board is for support questions relating to Nagios xi, our flagship commercial network monitoring solution.
marquetteu
Posts: 47
Joined: Tue Nov 13, 2012 12:08 pm

xi upgrade fails with python error

Post by marquetteu »

trying to upgrade from 5.7.2 to 5.7.5 and am getting a python error when MRTG is running post installation steps:

Code: Select all

---- Starting Nagios xi Backup ----
Backing up Nagios Core...
tar: Removing leading `/' from member names
tar: /usr/local/nagios/var/rw/nagios.qh: socket ignored
Backing up Nagios xi...
tar: Removing leading `/' from member names
Backing up MRTG...
tar: Removing leading `/' from member names
Backing up the SNMP directories
tar: Removing leading `/' from member names
tar: Removing leading `/' from member names
Backing up NRDP...
tar: Removing leading `/' from member names
Backing up Nagvis...
tar: Removing leading `/' from member names
Backing up nagios user home dir...
tar: Removing leading `/' from member names
Backing up MySQL databases...
mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysqldump: [Warning] Using a password on the command line interface can be insecure.
Backing up cronjobs for Apache...
Backing up logrotate config files...
Backing up Apache config files...
cp: cannot stat '/etc/httpd/conf.d/nagiosmobile.conf': No such file or directory
Compressing backup...
 
===============
BACKUP COMPLETE
===============
Backup stored in /store/backups/nagiosxi/autoupgrade_backup.1607543970.tar.gz

---- Starting Nagios xi Upgrade ----
Cleaning up temp directory...
Nagios xi Upgrade Log
==========================
DATE: Wed Dec  9 14:00:49 CST 2020

DISTRO INFO:
RedHatEnterpriseServer
8.2
x86_64


Archive:  sourceguardian/ixed4.lin.x86-64.zip
  inflating: /usr/lib64/php/modules/ixed.7.2.lin  
Sourceguardian extension found for PHP version 7.2
Sourceguardian extension already in php.ini
PHP Deprecated:  __autoload() is deprecated, use spl_autoload_register() instead in /usr/local/nagiosxi/tmp/nagiosxi/nagiosxi/basedir/html/includes/phpmailer/PHPMailerAutoload.php on line 45
Checking required prereqs... 
Please wait... 

OLD VERSION: 5702
Updating Subscription Management repositories.
Red Hat Enterprise Linux 8 for x86_64 - AppStre  50 kB/s | 2.8 kB     00:00    
Red Hat Satellite Tools 6.5 for RHEL 8 x86_64 (  45 kB/s | 2.1 kB     00:00    
Red Hat Enterprise Linux 8 for x86_64 - BaseOS   51 kB/s | 2.4 kB     00:00    
Red Hat Enterprise Linux 8 for x86_64 - Supplem  34 kB/s | 2.1 kB     00:00    
RHEL8 EPEL                                       45 kB/s | 2.7 kB     00:00    
RHEL8 EPEL Playground                            37 kB/s | 2.1 kB     00:00    
Dependencies resolved.
Nothing to do.
Complete!
Updating Subscription Management repositories.
Red Hat Enterprise Linux 8 for x86_64 - AppStre  40 kB/s | 2.8 kB     00:00    
Red Hat Satellite Tools 6.5 for RHEL 8 x86_64 (  46 kB/s | 2.1 kB     00:00    
Red Hat Enterprise Linux 8 for x86_64 - BaseOS   45 kB/s | 2.4 kB     00:00    
Red Hat Enterprise Linux 8 for x86_64 - Supplem  26 kB/s | 2.1 kB     00:00    
RHEL8 EPEL                                       54 kB/s | 2.7 kB     00:00    
RHEL8 EPEL Playground                            34 kB/s | 2.1 kB     00:00    
Dependencies resolved.
================================================================================
 Package                 Architecture Version          Repository          Size
================================================================================
Upgrading:
 nagiosxi-deps-el8       noarch       5.7.5-1          @commandline       2.9 k

Transaction Summary
================================================================================
Upgrade  1 Package

Total size: 2.9 k
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                        1/1 
  Upgrading        : nagiosxi-deps-el8-5.7.5-1.noarch                       1/2 
  Cleanup          : nagiosxi-deps-el8-5.7.2-1.noarch                       2/2 
  Verifying        : nagiosxi-deps-el8-5.7.5-1.noarch                       1/2 
  Verifying        : nagiosxi-deps-el8-5.7.2-1.noarch                       2/2 
Installed products updated.

Upgraded:
  nagiosxi-deps-el8-5.7.5-1.noarch                                              

Complete!
UPGRADE: MRTG is being upgraded...
UPGRADE: Applying patches to MRTG...
patching file mrtg-2.17.4/bin/cfgmaker
patching file mrtg-2.17.4/bin/cfgmaker
patching file mrtg-2.17.4/bin/mrtg
configure: loading site script /usr/share/config.site
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking whether make sets $(MAKE)... yes
checking for a BSD-compatible install... /bin/install -c
checking for perl... /bin/perl
checking for groff... /bin/groff
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for inttypes.h... (cached) yes
checking for unsigned long long... yes
checking for long long... yes
checking for strtoll... yes
checking for printf long long format specifier... %lld
checking for pow in -lm... yes
checking for gdImageGif in -lgd... yes
checking for gdImagePng in -lgd... yes
checking for gdImagePng_jpg in -lgd... no
checking for gdImagePng_jpg_ft in -lgd... no
checking gd.h usability... yes
checking gd.h presence... yes
checking for gd.h... yes
checking the weather... (cached) it's fine
checking if we can use GCC-specific compiler options... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: WARNING:  'Makefile.in' seems to ignore the --datarootdir setting
config.status: creating config.h
ordering CD from http://tobi.oetiker.ch/wish .... just kidding ;-)

----------------------------------------------------------------
Config is DONE!

Type 'make' to compile the software

       ... that wishlist mentioned above does really exist. So if
you feel like showing your appreciation for MRTG, this is the
place to go. I just love CDs and DVDs

                            -- Tobi Oetiker <tobi@oetiker.ch>
----------------------------------------------------------------
gcc  -g -O2 -Wall -Wpointer-arith -Wcast-align -Wmissing-declarations -Wnested-externs -Winline -W -DHAVE_CONFIG_H -c ./src/rateup.c -o bin/rateup.o
./src/rateup.c: In function ‘image’:
./src/rateup.c:330:7: warning: variable ‘i_outp’ set but not used [-Wunused-but-set-variable]
   int i_outp, i_outpg;
       ^~~~~~
./src/rateup.c:329:70: warning: variable ‘i_outm’ set but not used [-Wunused-but-set-variable]
   int i_light, i_dark, i_blank, i_major, i_in, i_out, i_grid, i_inm, i_outm;
                                                                      ^~~~~~
./src/rateup.c:329:48: warning: variable ‘i_out’ set but not used [-Wunused-but-set-variable]
   int i_light, i_dark, i_blank, i_major, i_in, i_out, i_grid, i_inm, i_outm;
                                                ^~~~~
./src/rateup.c: In function ‘update’:
./src/rateup.c:1455:43: warning: left shift of negative value [-Wshift-negative-value]
                 if (inr > - (long long) 1 << 32) {  /* wrapped 32-bit counter? */
                                           ^~
./src/rateup.c:1502:44: warning: left shift of negative value [-Wshift-negative-value]
                 if (outr > - (long long) 1 << 32) {
                                            ^~
./src/rateup.c:239:15: warning: comparison of integer expressions of different signedness: ‘long long int’ and ‘long unsigned int’ [-Wsign-compare]
       if (avc != steptime) {\
               ^~
./src/rateup.c:1590:4: note: in expansion of macro ‘NEXT’
    NEXT ((unsigned long) (now - plannow));
    ^~~~
./src/rateup.c:239:15: warning: comparison of integer expressions of different signedness: ‘long long int’ and ‘long unsigned int’ [-Wsign-compare]
       if (avc != steptime) {\
               ^~
./src/rateup.c:1627:4: note: in expansion of macro ‘NEXT’
    NEXT ((unsigned long) (now - plannow));
    ^~~~
./src/rateup.c:239:15: warning: comparison of integer expressions of different signedness: ‘long long int’ and ‘long unsigned int’ [-Wsign-compare]
       if (avc != steptime) {\
               ^~
./src/rateup.c:1664:4: note: in expansion of macro ‘NEXT’
    NEXT ((unsigned long) (now - plannow));
    ^~~~
./src/rateup.c:239:15: warning: comparison of integer expressions of different signedness: ‘long long int’ and ‘long unsigned int’ [-Wsign-compare]
       if (avc != steptime) {\
               ^~
./src/rateup.c:1701:4: note: in expansion of macro ‘NEXT’
    NEXT ((unsigned long) (now - plannow));
    ^~~~
./src/rateup.c: In function ‘main’:
./src/rateup.c:2112:4: warning: this statement may fall through [-Wimplicit-fallthrough=]
    for (x = 0; x < histvalid; x++)
    ^~~
./src/rateup.c:2117:2: note: here
  case 'u':  /* Update file */
  ^~~~
gcc bin/rateup.o -o bin/rateup   -lgd -lpng -lz  -lm
/bin/perl -0777 -p -i~ -e "s'^#!\s*/\S*perl'#! /bin/perl'" ./bin/cfgmaker ./bin/indexmaker ./bin/mrtg
/bin/perl -0777 -p -i~ -e 's@GRAPHFMT="...";@GRAPHFMT="png";@' ./bin/mrtg ./bin/indexmaker
/bin/perl -0777 -p -i~ -e "s'^#!\s*/\S*perl'#! /bin/perl'" ./bin/cfgmaker ./bin/indexmaker ./bin/mrtg
/bin/perl -0777 -p -i~ -e 's@GRAPHFMT="...";@GRAPHFMT="png";@' ./bin/mrtg ./bin/indexmaker
/bin/sh ./mkinstalldirs /usr/bin
for x in ./bin/mrtg ./bin/cfgmaker ./bin/indexmaker ./bin/mrtg-traffic-sum; do \
  /bin/install -c -m 755 $x /usr/bin; done
for x in bin/rateup; do \
  /bin/install -c -m 755 $x /usr/bin; done
/bin/sh ./mkinstalldirs /usr/lib64/mrtg2/Pod
for x in ./lib/mrtg2/*.pm; do \
  /bin/install -c -m 644 $x /usr/lib64/mrtg2; done
for x in ./lib/mrtg2/Pod/*.pm; do \
  /bin/install -c -m 644 $x /usr/lib64/mrtg2/Pod; done
/bin/sh ./mkinstalldirs /usr/share/mrtg2/icons
for x in ./images/*.gif ./images/*.png; do \
  /bin/install -c -m 644 $x /usr/share/mrtg2/icons; done
/bin/sh ./mkinstalldirs /usr/share/doc/mrtg2
(cd .; for x in COPYING COPYRIGHT README CHANGES THANKS doc/*.pod doc/*.txt doc/*.png; do \
  /bin/install -c -m 644 $x /usr/share/doc/mrtg2; done)
/bin/sh ./mkinstalldirs /usr/share/man/man1
for x in ./doc/*.1; do \
  /bin/install -c -m 644 $x /usr/share/man/man1; done
INSTALL: POST-INSTALL: MRTG post install is running...
./post_install: line 20: python: command not found
Python is installed:

Code: Select all

$ rpm -qa|grep python
python3-rrdtool-1.7.0-16.el8.x86_64
python3-paramiko-2.4.3-1.epel8.playground.noarch
python3-slip-0.6.4-11.el8.noarch
python3-idna-2.5-5.el8.noarch
python2-pip-9.0.3-16.module+el8.2.0+5478+b505947e.noarch
python3-hwdata-2.3.6-3.el8.noarch
python3-nftables-0.9.3-12.el8.x86_64
python3-dbus-1.2.4-15.el8.x86_64
python3-rhnlib-2.8.6-8.module+el8.1.0+3455+3ddf2832.noarch
python-srpm-macros-3-38.el8.noarch
python3-dnf-plugin-spacewalk-2.8.5-11.module+el8.1.0+3455+3ddf2832.noarch
python3-libdnf-0.39.1-5.el8.x86_64
python3-unbound-1.7.3-10.el8.x86_64
python3-rpm-4.14.2-37.el8.x86_64
python3-webencodings-0.5.1-6.el8.noarch
python3-qpid-proton-0.31.0-2.epel8.playground.x86_64
python3-ethtool-0.14-3.el8.x86_64
python3-netifaces-0.10.6-4.el8.x86_64
python3-inotify-0.9.6-13.el8.noarch
platform-python-3.6.8-23.el8.x86_64
python3-jmespath-0.9.0-11.el8.noarch
python3-bind-9.11.13-5.el8_2.noarch
python3-setools-4.2.2-2.el8.x86_64
python3-policycoreutils-2.9-9.el8.noarch
python3-pyparsing-2.1.10-7.el8.noarch
python3-dnf-plugins-core-4.0.12-3.el8.noarch
python3-newt-0.52.20-11.el8.x86_64
python3-libselinux-2.9-3.el8.x86_64
python3-decorator-4.2.1-2.el8.noarch
python3-dateutil-2.6.1-6.el8.noarch
python3-simplejson-3.17.0-2.epel8.playground.x86_64
python3-bcrypt-3.1.6-2.epel8.playground.1.x86_64
python2-pip-wheel-9.0.3-16.module+el8.2.0+5478+b505947e.noarch
python2-2.7.17-1.module+el8.2.0+4561+f4e0d66a.x86_64
platform-python-setuptools-39.2.0-5.el8.noarch
python3-schedutils-0.6-6.el8.x86_64
python3-setuptools-39.2.0-5.el8.noarch
python3-pyyaml-3.12-12.el8.x86_64
python3-pyasn1-0.3.7-6.el8.noarch
python3-rhn-check-2.8.16-13.module+el8.1.0+3455+3ddf2832.x86_64
python3-jinja2-2.10.1-2.el8_0.noarch
python3-html5lib-0.999999999-6.el8.noarch
python3-pip-wheel-9.0.3-16.el8.noarch
python3-configobj-5.0.6-11.el8.noarch
platform-python-pip-9.0.3-16.el8.noarch
python3-pyOpenSSL-18.0.0-1.el8.noarch
python3-syspurpose-1.26.16-1.el8.x86_64
python3-gobject-base-3.28.3-1.el8.x86_64
python3-gpg-1.10.0-6.el8.x86_64
python3-pynacl-1.3.0-5.epel8.playground.x86_64
python3-ply-3.9-8.el8.noarch
python3-audit-3.0-0.17.20191104git1c2f876.el8.x86_64
policycoreutils-python-utils-2.9-9.el8.noarch
python3-rpm-generators-5-6.el8.noarch
python3-gofer-2.12.5-3.el8sat.noarch
python3-gofer-proton-2.12.5-3.el8sat.noarch
python3-librepo-1.11.0-2.el8.x86_64
python3-subscription-manager-rhsm-1.26.16-1.el8.x86_64
python3-cryptography-2.3-3.el8.x86_64
python3-six-1.11.0-8.el8.noarch
python3-beautifulsoup4-4.6.3-2.epel8.playground.1.noarch
python2-setuptools-39.0.1-11.module+el8.1.0+3446+c3d52da3.noarch
python3-rhn-client-tools-2.8.16-13.module+el8.1.0+3455+3ddf2832.x86_64
python3-pytz-2017.2-9.el8.noarch
python3-asn1crypto-0.24.0-3.el8.noarch
python3-pycparser-2.14-14.el8.noarch
python3-slip-dbus-0.6.4-11.el8.noarch
python3-firewall-0.8.0-4.el8.noarch
python3-libxml2-2.9.7-7.el8.x86_64
python3-libcomps-0.1.11-4.el8.x86_64
python3-numpy-1.14.3-9.el8.x86_64
python-rpm-macros-3-38.el8.noarch
python3-hawkey-0.39.1-5.el8.x86_64
python3-dnf-4.2.17-6.el8.noarch
python3-rpm-macros-3-38.el8.noarch
python3-pip-9.0.3-16.el8.noarch
python3-lxml-4.2.3-1.el8.x86_64
python2-libs-2.7.17-1.module+el8.2.0+4561+f4e0d66a.x86_64
python3-dmidecode-3.12.2-15.el8.x86_64
python36-3.6.8-2.module+el8.1.0+3334+5cb623d7.x86_64
python3-rhn-setup-2.8.16-13.module+el8.1.0+3455+3ddf2832.x86_64
platform-python-devel-3.6.8-23.el8.x86_64
python3-babel-2.5.1-5.el8.noarch
python3-cssselect-0.9.2-10.epel8.playground.noarch
python3-pyudev-0.21.0-7.el8.noarch
python2-setuptools-wheel-39.0.1-11.module+el8.1.0+3446+c3d52da3.noarch
python3-cffi-1.11.5-5.el8.x86_64
python3-libs-3.6.8-23.el8.x86_64
python3-libsemanage-2.9-2.el8.x86_64
python3-linux-procfs-0.6-7.el8.noarch
python3-perf-4.18.0-193.1.2.el8_2.x86_64
python36-devel-3.6.8-2.module+el8.1.0+3334+5cb623d7.x86_64
python3-markupsafe-0.23-19.el8.x86_64
python3-setuptools-wheel-39.2.0-5.el8.noarch
python3-pcp-5.0.2-5.el8.x86_64
python3-iniparse-0.4-31.el8.noarch
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: xi upgrade fails with python error

Post by vtrac »

Hi marquetteu,
Looks like you are using "python3".
You might want to make a symbolic link of "python" with "python3"

Code: Select all

First, check where is "python3"
# which python3

Let assume your python3 is at "/usr/bin/python3", you then make a symbolic line of "python" with "python3"
# ln -s /usr/bin/python3 /usr/bin/python
Here's the error provided:

Code: Select all

INSTALL: POST-INSTALL: MRTG post install is running...
./post_install: line 20: python: command not found
Based on the error (above) ..... line 20 of "post_install" script is trying to run "python separate_mrtg_cfgs" (picture below).
post_install-script.png
Now, please re-ran the update script again.

Hope this helps!!

Vinh
You do not have the required permissions to view the files attached to this post.
marquetteu
Posts: 47
Joined: Tue Nov 13, 2012 12:08 pm

Re: xi upgrade fails with python error

Post by marquetteu »

looks like in RHEL8 python is controlled by the alternatives system and is set to point to nowhere by default.

to fix this you need to:

Code: Select all

alternatives --set python /usr/bin/python3
what is strange is that the initial install worked without issue (5.7.0), same with a previous upgrade (5.7.2), but this upgrade is the first time i'm seeing this issue. maybe put a KB out there for rhel8 and python?
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: xi upgrade fails with python error

Post by vtrac »

Hi marquetteu,
Yes, using the "alternatives" command might be better.
It does the same thing (but better) by creates a symlink and kept its under the "/etc/alternatives" folder.

Best Regards,
Vinh