5.6.14 to 5.7.5 upgrade missing repo

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
UWBernie
Posts: 16
Joined: Wed Mar 21, 2018 9:30 am

5.6.14 to 5.7.5 upgrade missing repo

Post by UWBernie »

We are running v5.6.14 on a 64-bit CentOS 7 VM. I was upgrading our test instance to the latest version 5.7.5 and the install summary had the following errors. It seems to be having issues with mysql components yet we are running mariadb and looking in the wring bin directory /bin instead of /usr/bin. Any idea on what's going on?

Thanks

*** Configuration summary for ***:

----------------
User: nagios
Group: nagios
Bin directory: /usr/local/nagios/bin
Config directory: /usr/local/nagios/etc
Nagios config: /usr/local/nagios/etc/nagios.cfg
----------------

Review the options above for accuracy. If they look okay,
type 'make all' to compile NDOUtils, or type 'make' to get
a list of make options.

cd src/ && make ndo.so
gcc: error: /bin/mysql_config:: No such file or directory
gcc: error: error:: No such file or directory
gcc: error: needed: No such file or directory
gcc: error: binary:: No such file or directory
gcc: error: /usr/bin/mysql_config-64: No such file or directory
gcc: error: is: No such file or directory
gcc: error: missing.: No such file or directory
gcc: error: Please: No such file or directory
gcc: error: check: No such file or directory
gcc: error: your: No such file or directory
gcc: error: MySQL: No such file or directory
gcc: error: installation.: No such file or directory
gcc: error: /bin/mysql_config:: No such file or directory
gcc: error: error:: No such file or directory
gcc: error: needed: No such file or directory
gcc: error: binary:: No such file or directory
gcc: error: /usr/bin/mysql_config-64: No such file or directory
gcc: error: is: No such file or directory
gcc: error: missing.: No such file or directory
gcc: error: Please: No such file or directory
gcc: error: check: No such file or directory
gcc: error: your: No such file or directory
gcc: error: MySQL: No such file or directory
gcc: error: installation.: No such file or directory
make[1]: *** [ndo.so] Error 1
make: *** [ndo.so] Error 2
make[1]: Entering directory `/tmp/nagiosxi/subcomponents/ndo/ndo-3.0.4/src'
gcc -fPIC -shared -g -O2 /bin/mysql_config: error: needed binary: /usr/bin/mysql_config-64 is missing. Please check your MySQL installation. ndo.c -o ndo.so /bin/mysql_config: error: needed binary: /usr/bin/mysql_config-64 is missing. Please check your MySQL installation. -pthread
make[1]: Leaving directory `/tmp/nagiosxi/subcomponents/ndo/ndo-3.0.4/src'
dchurch
Posts: 858
Joined: Wed Oct 07, 2020 12:46 pm
Location: Yo mama

Re: 5.6.14 to 5.7.5 upgrade missing repo

Post by dchurch »

The mariadb-devel package should provide the correct mysql_config script to allow you to compile NDO. It should also be backward-compatible, and we state it's supported, so the fact you're using MariaDB instead of MySQL shouldn't affect this negatively.

The place in the code where it checks for a binary called mysql_config looks like this (/tmp/nagiosxi/subcomponents/ndo/ndo-3.0.4/configure:3665):

Code: Select all

# Determine MySQL C flags and libraries
# This also kind of determines if the mysql library is installed
if which mysql_config; then
    DBLIBS=`mysql_config --libs`
    DBFLAGS=`mysql_config --cflags`
else
    as_fn_error $? "Unable to find mysql_config binary" "$LINENO" 5
fi
Which gets put into the command line like this (/tmp/nagiosxi/subcomponents/ndo/ndo-3.0.4/src/Makefile.in:19):

Code: Select all

ndo.so: $(NDOSOURCEFILES)
        $(CC) $(SHAREDFLAGS) $(CFLAGS) $(DBFLAGS) ndo.c -o $@ $(DBLIBS) $(THREADLIB)
The configure process won't even finish unless mysql_config is available on the system.

Try this:
I'd suggest doing rm -rf /tmp/nagiosxi and trying the upgrade again. There might be a cached makefile somewhere that needs to be re-configured. The upgrade process should do this automatically.

Further diagnosis:
What's the output from the following commands:

Code: Select all

rpm -qa |grep 'mariadb\|mysql'

Code: Select all

which -a mysql_config{,-64}
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.
UWBernie
Posts: 16
Joined: Wed Mar 21, 2018 9:30 am

Re: 5.6.14 to 5.7.5 upgrade missing repo

Post by UWBernie »

Same summary on the repeat install. additional troubleshooting output included below.



*** Configuration summary for ***:

----------------
User: nagios
Group: nagios
Bin directory: /usr/local/nagios/bin
Config directory: /usr/local/nagios/etc
Nagios config: /usr/local/nagios/etc/nagios.cfg
----------------

Review the options above for accuracy. If they look okay,
type 'make all' to compile NDOUtils, or type 'make' to get
a list of make options.

cd src/ && make ndo.so
make[1]: Entering directory `/tmp/nagiosxi/subcomponents/ndo/ndo-3.0.4/src'
gcc -fPIC -shared -g -O2 /bin/mysql_config: error: needed binary: /usr/bin/mysql_config-64 is missing. Please check your MySQL installation. ndo.c -o ndo.so /bin/mysql_config: error: needed binary: /usr/bin/mysql_config-64 is missing. Please check your MySQL installation. -pthread
gcc: error: /bin/mysql_config:: No such file or directory
gcc: error: error:: No such file or directory
gcc: error: needed: No such file or directory
gcc: error: binary:: No such file or directory
gcc: error: /usr/bin/mysql_config-64: No such file or directory
gcc: error: is: No such file or directory
gcc: error: missing.: No such file or directory
gcc: error: Please: No such file or directory
gcc: error: check: No such file or directory
gcc: error: your: No such file or directory
gcc: error: MySQL: No such file or directory
gcc: error: installation.: No such file or directory
gcc: error: /bin/mysql_config:: No such file or directory
gcc: error: error:: No such file or directory
gcc: error: needed: No such file or directory
gcc: error: binary:: No such file or directory
gcc: error: /usr/bin/mysql_config-64: No such file or directory
gcc: error: is: No such file or directory
gcc: error: missing.: No such file or directory
gcc: error: Please: No such file or directory
gcc: error: check: No such file or directory
gcc: error: your: No such file or directory
gcc: error: MySQL: No such file or directory
gcc: error: installation.: No such file or directory
make[1]: *** [ndo.so] Error 1
make[1]: Leaving directory `/tmp/nagiosxi/subcomponents/ndo/ndo-3.0.4/src'
make: *** [ndo.so] Error 2
[bernie@drusilla nagiosxi]$ rpm -qa |grep 'mariadb\|mysql'
mariadb-libs-5.5.65-1.el7.x86_64
php-mysql-5.4.16-48.el7.x86_64
mariadb-devel-5.5.65-1.el7.x86_64
mariadb-server-5.5.65-1.el7.x86_64
mariadb-5.5.65-1.el7.x86_64
[bernie@drusilla nagiosxi]$
[bernie@drusilla nagiosxi]$ which -a mysql_config{,-64}
/usr/bin/mysql_config
/usr/bin/which: no mysql_config-64 in (/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/puppetlabs/bin:/home/bernie/.local/bin:/home/bernie/bin)
[bernie@drusilla nagiosxi]$
dchurch
Posts: 858
Joined: Wed Oct 07, 2020 12:46 pm
Location: Yo mama

Re: 5.6.14 to 5.7.5 upgrade missing repo

Post by dchurch »

Try running the following command:

Code: Select all

sudo yum install -y mariadb-devel
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.
UWBernie
Posts: 16
Joined: Wed Mar 21, 2018 9:30 am

Re: 5.6.14 to 5.7.5 upgrade missing repo

Post by UWBernie »

mariadb-devel is already installed.

[bernie@drusilla ~]$ sudo yum install -y mariadb-devel
Loaded plugins: fastestmirror, rhnplugin, versionlock
This system is receiving updates from RHN Classic or Red Hat Satellite.
Loading mirror speeds from cached hostfile
Package 1:mariadb-devel-5.5.65-1.el7.x86_64 already installed and latest version
Nothing to do
dchurch
Posts: 858
Joined: Wed Oct 07, 2020 12:46 pm
Location: Yo mama

Re: 5.6.14 to 5.7.5 upgrade missing repo

Post by dchurch »

Try running this command then deleting /tmp/nagiosxi and running the upgrade again:

Code: Select all

ln -s  mysql_config /usr/bin/mysql_config-64
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.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: 5.6.14 to 5.7.5 upgrade missing repo

Post by ssax »

In addition to what @dchurch recommended (try that first):

What is the output of these commands?

Code: Select all

mysql_config --libs
mysql_config --cflags
echo $PATH
env
Run these commands (as root/sudo) and send us the full output:

Code: Select all

cd /tmp
rm -rf /tmp/nagiosxi
wget https://assets.nagios.com/downloads/nagiosxi/5/xi-5.7.5.tar.gz
tar zxf xi-5.7.5.tar.gz
cd /tmp/nagiosxi
./init.sh
cd subcomponents/ndo
./configure
make all
make install
Please PM me a copy of your profile as well, you can download it from Admin > System Profile by clicking the Download Profile button.

If you're unable to generate the the profile through the web interface, please try generating it from the command line by running these commands as root:

Code: Select all

rm -rf /usr/local/nagiosxi/var/components/profile*​​
/usr/local/nagiosxi/scripts/components/getprofile.sh SUPPORT
Then send me the resulting /usr/local/nagiosxi/var/components/profile.zip​ file.​

If the profile script fails, please include the ENTIRE output.
UWBernie
Posts: 16
Joined: Wed Mar 21, 2018 9:30 am

Re: 5.6.14 to 5.7.5 upgrade missing repo

Post by UWBernie »

PM'd the requested files and output. The symlink caused the upgrade to hang and run out of memory as /usr/bin/mysql_config-64 kept forking itself

make[1]: Leaving directory `/tmp/nagiosxi/subcomponents/nagioscore/nagios-4.4.6'
/bin/install -c -m 755 -d -o root -g root /lib/systemd/system
/bin/install -c -m 755 -o root -g root startup/default-service /lib/systemd/system/nagios.service
UPGRADE: Nagios Core upgraded OK.
UPGRADE: NDO is being upgraded...
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 for a BSD-compatible install... /bin/install -c
checking how to run the C preprocessor... gcc -E
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 stdlib.h... (cached) yes
checking stdio.h usability... yes
checking stdio.h presence... yes
checking for stdio.h... yes
checking for string.h... (cached) yes
checking mysql/mysql.h usability... yes
checking mysql/mysql.h presence... yes
checking for mysql/mysql.h... yes
checking mysql/errmsg.h usability... yes
checking mysql/errmsg.h presence... yes
checking for mysql/errmsg.h... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
/bin/mysql_config
/usr/bin/mysql_config-64: fork: Cannot allocate memory

[bernie@drusilla nagiosxi]$ mysql_config --libs
/usr/bin/mysql_config-64: fork: retry: No child processes
/usr/bin/mysql_config-64: fork: retry: No child processes
/usr/bin/mysql_config-64: fork: retry: No child processes
/usr/bin/mysql_config-64: fork: retry: No child processes
/usr/bin/mysql_config-64: fork: Resource temporarily unavailable
[bernie@drusilla nagiosxi]$ mysql_config --cflags
/usr/bin/mysql_config-64: fork: retry: No child processes
/usr/bin/mysql_config-64: fork: retry: No child processes
/usr/bin/mysql_config-64: fork: retry: No child processes
/usr/bin/mysql_config-64: fork: retry: No child processes
/usr/bin/mysql_config-64: fork: Resource temporarily unavailable
[bernie@drusilla nagiosxi]$
dchurch
Posts: 858
Joined: Wed Oct 07, 2020 12:46 pm
Location: Yo mama

Re: 5.6.14 to 5.7.5 upgrade missing repo

Post by dchurch »

Looks like your install is broken somehow. What do the following commands produce?

Code: Select all

yum whatprovides /usr/bin/mysql_config
yum whatprovides /usr/bin/mysql_config-64
file /usr/bin/mysql_config
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.
UWBernie
Posts: 16
Joined: Wed Mar 21, 2018 9:30 am

Re: 5.6.14 to 5.7.5 upgrade missing repo

Post by UWBernie »

[bernie@drusilla ~]$ sudo yum whatprovides /usr/bin/mysql_config
Loaded plugins: fastestmirror, rhnplugin, versionlock
This system is receiving updates from RHN Classic or Red Hat Satellite.
Loading mirror speeds from cached hostfile
1:mariadb-devel-5.5.60-1.el7_5.i686 : Files for development of MariaDB/MySQL applications
Repo : centos-7-64-base
Matched from:
Filename : /usr/bin/mysql_config



1:mariadb-devel-5.5.60-1.el7_5.x86_64 : Files for development of MariaDB/MySQL applications
Repo : centos-7-64-base
Matched from:
Filename : /usr/bin/mysql_config



1:mariadb-devel-5.5.64-1.el7.i686 : Files for development of MariaDB/MySQL applications
Repo : centos-7-64-base
Matched from:
Filename : /usr/bin/mysql_config



1:mariadb-devel-5.5.64-1.el7.x86_64 : Files for development of MariaDB/MySQL applications
Repo : centos-7-64-base
Matched from:
Filename : /usr/bin/mysql_config



1:mariadb-devel-5.5.65-1.el7.i686 : Files for development of MariaDB/MySQL applications
Repo : centos-7-64-base
Matched from:
Filename : /usr/bin/mysql_config



1:mariadb-devel-5.5.65-1.el7.x86_64 : Files for development of MariaDB/MySQL applications
Repo : centos-7-64-base
Matched from:
Filename : /usr/bin/mysql_config



1:mariadb-devel-5.5.65-1.el7.x86_64 : Files for development of MariaDB/MySQL applications
Repo : @centos-7-64-base
Matched from:
Filename : /usr/bin/mysql_config


[bernie@drusilla ~]$ sudo yum whatprovides /usr/bin/mysql_config-64
Loaded plugins: fastestmirror, rhnplugin, versionlock
This system is receiving updates from RHN Classic or Red Hat Satellite.
Loading mirror speeds from cached hostfile
No matches found
[bernie@drusilla ~]$
[bernie@drusilla ~]$ file -L /usr/bin/mysql_config
/usr/bin/mysql_config: Bourne-Again shell script, ASCII text executable
[bernie@drusilla ~]$
Locked