Nagios xi - upg v5.6.14 to 5.8.6 issues

This support forum board is for support questions relating to Nagios xi, our flagship commercial network monitoring solution.
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: Nagios xi - upg v5.6.14 to 5.8.6 issues

Post by pbroste »

Hello @Interrex

Thanks for following up with the System Profile, logs and details. In review, we do see that ndo is failing
Error: Could not load module '/usr/local/nagios/bin/ndomod.o' -> /usr/local/nagios/bin/ndomod.o: cannot open shared object file: No such file or directory
Error: Failed to load module '/usr/local/nagios/bin/ndomod.o'
Please provide the following:

Code: Select all

ls -l /usr/local/nagios/bin/
more /usr/local/nagios/etc/ndo*.cfg | cat > /tmp/ndoconfigs.txt
Thanks,
Perry
Interrex
Posts: 68
Joined: Thu May 19, 2016 8:42 am

Re: Nagios xi - upg v5.6.14 to 5.8.6 issues

Post by Interrex »

Hi Perry.

Here's the result.

Code: Select all

:/usr/local/nagiosxi $ ls -l /usr/local/nagios/bin/
total 2028
-rwxrwxr-- 1 nagios nagios 713168 Sep  8 23:45 nagios
-rwxrwxr-- 1 nagios nagios  39640 Sep  8 23:45 nagiostats
-rwxr-xr-x 1 root   root   890904 Sep  8 23:46 ndo.so
-rwxr-xr-x 1 root   root     1083 Sep  8 23:46 ndo-startup-hash.sh
-rwxr-xr-- 1 nagios nagios  27560 Sep  8 23:46 npcd
-rwxr-xr-- 1 nagios nagios  14696 Sep  8 23:46 npcdmod.o
-rwxr-xr-x 1 root   root   231368 Sep  8 23:47 nrpe
-rwxr-xr-x 1 root   root    10663 Sep  8 23:47 nrpe-uninstall
-rwxr-xr-x 1 root   root   129272 Sep  8 23:47 nsca
Sending you the output from:
more /usr/local/nagios/etc/ndo*.cfg | cat > /tmp/ndoconfigs.txt
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: Nagios xi - upg v5.6.14 to 5.8.6 issues

Post by pbroste »

Hello @Interrex

Want to have you run through the NDO downgrade to NDO2db.

### STANDARD DOWNGRADE OF NDO

Code: Select all

systemctl stop nagios
cd /tmp
rm -rf /tmp/nagiosxi
wget https://assets.nagios.com/downloads/nagiosxi/5/xi-5.6.14.tar.gz
tar zxf xi-5.6.14.tar.gz
cd /tmp/nagiosxi/subcomponents/ndoutils
./install
systemctl enable ndo2db
Then edit your /usr/local/nagios/etc/nagios.cfg and make sure this line is uncommented:

Code: Select all

broker_module=/usr/local/nagios/bin/ndomod.o config_file=/usr/local/nagios/etc/ndomod.cfg
Make sure this line is commented:

Code: Select all

#broker_module=/usr/local/nagios/bin/ndo.so /usr/local/nagios/etc/ndo.cfg
Then start the nagios service:

Code: Select all

systemctl start nagios
Please let us know the results,
Perry
Interrex
Posts: 68
Joined: Thu May 19, 2016 8:42 am

Re: Nagios xi - upg v5.6.14 to 5.8.6 issues

Post by Interrex »

I solved the compiler issue and re-run the installer again, all before the part below was OK.
this is v5.6.14

Code: Select all

*** Configuration summary for ndoutils 2.1.3 2017-04-13 ***:

 General Options:
 -------------------------
 NDO2DB user:      nagios
 NDO2DB group:     nagios
 NDO2DB tcp port:  5668


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

cd ./src && make
make[1]: Entering directory `/tmp/rpms/nagiosxi/subcomponents/ndoutils/ndoutils-                                                                                              2.1.3/src'
gcc -fPIC -fPIC -g -O2 -DHAVE_CONFIG_H  -c -o io.o io.c
gcc -fPIC -fPIC -g -O2 -DHAVE_CONFIG_H  -c -o utils.o utils.c
gcc -fPIC -g -O2 -DHAVE_CONFIG_H  -o file2sock file2sock.c io.o utils.o   -lm -l                                                                                              nsl
gcc -fPIC -g -O2 -DHAVE_CONFIG_H  -o log2ndo log2ndo.c io.o utils.o   -lm -lnsl
make ndo2db-2x
make[2]: Entering directory `/tmp/rpms/nagiosxi/subcomponents/ndoutils/ndoutils-                                                                                              2.1.3/src'
gcc -fPIC -g -O2 -DHAVE_CONFIG_H  -c -o db.o db.c
db.c: In function ândo2db_db_initâ:
db.c:169:29: error: ândo2db_dbconninfoâ has no member named âmysql_connâ
  if(!mysql_init(&idi->dbinfo.mysql_conn)){
                             ^
db.c: In function ândo2db_db_connectâ:
db.c:211:16: error: ândo2db_dbconninfoâ has no member named âmysql_connâ
    &idi->dbinfo.mysql_conn,
                ^
db.c:218:4: error: âCLIENT_REMEMBER_OPTIONSâ undeclared (first use in this funct                                                                                              ion)
    CLIENT_REMEMBER_OPTIONS
    ^
db.c:218:4: note: each undeclared identifier is reported only once for each func                                                                                              tion it appears in
db.c:220:27: error: ândo2db_dbconninfoâ has no member named âmysql_connâ
   mysql_close(&idi->dbinfo.mysql_conn);
                           ^
db.c:221:101: error: ândo2db_dbconninfoâ has no member named âmysql_connâ
   syslog(LOG_USER|LOG_INFO,"Error: Could not connect to MySQL database: %s",mys                                                                                              ql_error(&idi->dbinfo.mysql_conn));
                                                                                                                                                                                                   ^
db.c: In function ândo2db_db_disconnectâ:
db.c:244:26: error: ândo2db_dbconninfoâ has no member named âmysql_connâ
  mysql_close(&idi->dbinfo.mysql_conn);
                          ^
db.c: In function ândo2db_db_helloâ:
db.c:268:14: error: ândo2db_dbconninfoâ has no member named âmysql_resultâ
   idi->dbinfo.mysql_result=mysql_store_result(&idi->dbinfo.mysql_conn);
              ^
db.c:268:59: error: ândo2db_dbconninfoâ has no member named âmysql_connâ
   idi->dbinfo.mysql_result=mysql_store_result(&idi->dbinfo.mysql_conn);
                                                           ^
db.c:269:18: error: ândo2db_dbconninfoâ has no member named âmysql_rowâ
   if((idi->dbinfo.mysql_row=mysql_fetch_row(idi->dbinfo.mysql_result))!=NULL){
                  ^
db.c:269:56: error: ândo2db_dbconninfoâ has no member named âmysql_resultâ
   if((idi->dbinfo.mysql_row=mysql_fetch_row(idi->dbinfo.mysql_result))!=NULL){
                                                        ^
db.c:270:53: error: ândo2db_dbconninfoâ has no member named âmysql_rowâ
    ndo2db_convert_string_to_unsignedlong(idi->dbinfo.mysql_row[0],&idi->dbinfo.                                                                                              instance_id);
                                                     ^
db.c:273:32: error: ândo2db_dbconninfoâ has no member named âmysql_resultâ
   mysql_free_result(idi->dbinfo.mysql_result);
                                ^
db.c:274:14: error: ândo2db_dbconninfoâ has no member named âmysql_resultâ
   idi->dbinfo.mysql_result=NULL;
              ^
db.c:283:56: error: ândo2db_dbconninfoâ has no member named âmysql_connâ
    idi->dbinfo.instance_id=mysql_insert_id(&idi->dbinfo.mysql_conn);
                                                        ^
db.c:303:55: error: ândo2db_dbconninfoâ has no member named âmysql_connâ
   idi->dbinfo.conninfo_id=mysql_insert_id(&idi->dbinfo.mysql_conn);
                                                       ^
db.c: In function ândo2db_db_queryâ:
db.c:477:30: error: ândo2db_dbconninfoâ has no member named âmysql_connâ
  if (mysql_query(&idi->dbinfo.mysql_conn,buf)) {
                              ^
db.c:479:75: error: ândo2db_dbconninfoâ has no member named âmysql_connâ
   syslog(LOG_USER|LOG_INFO,"mysql_error: '%s'\n", mysql_error(&idi->dbinfo.mysq                                                                                              l_conn));
                                                                           ^
db.c: In function ândo2db_handle_db_errorâ:
db.c:512:33: error: ândo2db_dbconninfoâ has no member named âmysql_connâ
  result=mysql_errno(&idi->dbinfo.mysql_conn);
                                 ^
db.c:513:13: error: âCR_SERVER_LOSTâ undeclared (first use in this function)
  if(result==CR_SERVER_LOST || result==CR_SERVER_GONE_ERROR){
             ^
db.c:513:39: error: âCR_SERVER_GONE_ERRORâ undeclared (first use in this functio                                                                                              n)
  if(result==CR_SERVER_LOST || result==CR_SERVER_GONE_ERROR){
                                       ^
db.c: In function ândo2db_db_get_latest_data_timeâ:
db.c:565:14: error: ândo2db_dbconninfoâ has no member named âmysql_resultâ
   idi->dbinfo.mysql_result=mysql_store_result(&idi->dbinfo.mysql_conn);
              ^
db.c:565:59: error: ândo2db_dbconninfoâ has no member named âmysql_connâ
   idi->dbinfo.mysql_result=mysql_store_result(&idi->dbinfo.mysql_conn);
                                                           ^
db.c:566:18: error: ândo2db_dbconninfoâ has no member named âmysql_rowâ
   if((idi->dbinfo.mysql_row=mysql_fetch_row(idi->dbinfo.mysql_result))!=NULL){
                  ^
db.c:566:56: error: ândo2db_dbconninfoâ has no member named âmysql_resultâ
   if((idi->dbinfo.mysql_row=mysql_fetch_row(idi->dbinfo.mysql_result))!=NULL){
                                                        ^
db.c:567:53: error: ândo2db_dbconninfoâ has no member named âmysql_rowâ
    ndo2db_convert_string_to_unsignedlong(idi->dbinfo.mysql_row[0],t);
                                                     ^
db.c:569:32: error: ândo2db_dbconninfoâ has no member named âmysql_resultâ
   mysql_free_result(idi->dbinfo.mysql_result);
                                ^
db.c:570:14: error: ândo2db_dbconninfoâ has no member named âmysql_resultâ
   idi->dbinfo.mysql_result=NULL;
              ^
make[2]: *** [db.o] Error 1
make[2]: Leaving directory `/tmp/rpms/nagiosxi/subcomponents/ndoutils/ndoutils-2                                                                                              .1.3/src'
make[1]: *** [ndo2db] Error 2
make[1]: Leaving directory `/tmp/rpms/nagiosxi/subcomponents/ndoutils/ndoutils-2                                                                                              .1.3/src'
make: *** [all] Error 2
root@gm-l03-s0013(prod):/tmp/rpms/nagiosxi/subcomponents/ndoutils $
Last edited by Interrex on Tue Sep 28, 2021 1:08 pm, edited 1 time in total.
Interrex
Posts: 68
Joined: Thu May 19, 2016 8:42 am

Re: Nagios xi - upg v5.6.14 to 5.8.6 issues

Post by Interrex »

pbroste wrote:Hello @Interrex

Appears to be ndo errors, let's run the upgrade on that ndo:

Code: Select all

wget http://assets.nagios.com/downloads/nagiosxi/xi-latest.tar.gz   #get latest version
tar zxf xi-latest.tar.gz      #extracting
cd nagiosxi/subcomponents/ndo   #go to ndo directory inside installer
./upgrade   #run upgrade
Run the ./install if missing component.

Bounce the nagios.service:

Code: Select all

systemctl restart nagios.service
Let me know the results,
Perry
Hi, since I fixed the compiler problem earlier, i went back to the latest version and tried to do a NDO install.

It failed:

Code: Select all

:/tmp/rpms/nagiosxi/subcomponents/ndo $ ./install
INSTALL: NDO is being installed...
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... no
checking mysql/mysql.h presence... no
checking for mysql/mysql.h... no
configure: error: Can't locate mysql headers

I see that there's a post-install script under NDO, should I try to run it ? Or is it something else that need to be fixed on the DB ?
Interrex
Posts: 68
Joined: Thu May 19, 2016 8:42 am

Re: Nagios xi - upg v5.6.14 to 5.8.6 issues

Post by Interrex »

Hi, I belive I*m up and running again.

Seems like my problem was missing modules packages.

I installed the following packages:

Code: Select all

yum install mysql-devel gcc glibc glibc-common
Then I followed the steps for installing NDO again

Code: Select all

wget http://assets.nagios.com/downloads/nagiosxi/xi-latest.tar.gz   #get latest version
tar zxf xi-latest.tar.gz      #extracting
cd nagiosxi/subcomponents/ndo   #go to ndo directory inside installer
./install   #run upgrade

systemctl start nagios.service
I have tested to apply a config change, name change, active&deactivate (I needed to do the config change twice before it worked the first time)
Then I deleted the same service and applied the config, and the service is removed.

I will do a reboot of my system and then run the repairdb scritp aswell

Anything else I should test or do before I can confirm that my problems are solved?

Thanks for help and tricks on the way @Perry

- interrex
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: Nagios xi - upg v5.6.14 to 5.8.6 issues

Post by pbroste »

Hello @Interrex

Excellent, that is good to hear. Will keep this open for a few days and then close if we don't hear anything further.

Thanks,
Perry
Interrex
Posts: 68
Joined: Thu May 19, 2016 8:42 am

Re: Nagios xi - upg v5.6.14 to 5.8.6 issues

Post by Interrex »

Hi.

I have been "offline" for a time.

Looks like I still have a problem after the upgrade.
Everything looks good, health internaly and host and checks are green,
When I created a new host I see that last check attempt is -1-11-30 00:00:00

When I check my other components, I see that no checks have been updated since I started the upgrade from .5.6.14.. this goes for all kind of hosts and services.

Scheduled events over time is empty
Monitoring Engine Check Statistics is = 0

What could it be?
What file or services hadles the actual checks ?
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: Nagios xi - upg v5.6.14 to 5.8.6 issues

Post by pbroste »

Hello @interrex

Thanks for following up and sending over the System Profile. Review we see that the line in nagios.cfg referencing ndo module did not get updated.
Error: Could not load module '/usr/local/nagios/bin/ndomod.o' -> /usr/local/nagios/bin/ndomod.o: cannot open shared object file: No such file or directory
Error: Failed to load module '/usr/local/nagios/bin/ndomod.o'.
Error: Module loading failed. Aborting.
The broker_module line should have been updated during the upgrade. To correct the line in '/usr/local/nagios/etc/nagios.cfg by:
Find the line and update

#broker_module=/usr/local/nagios/bin/ndomod.o config_file=/usr/local/nagios/etc/ndomod.cfg
broker_module=/usr/local/nagios/bin/ndo.so config_file=/usr/local/nagios/etc/ndo.cfg
The broker module line should be:

Code: Select all

broker_module=/usr/local/nagios/bin/ndo.so /usr/local/nagios/etc/ndo.cfg
Please let us know how things look,
Perry
Interrex
Posts: 68
Joined: Thu May 19, 2016 8:42 am

Re: Nagios xi - upg v5.6.14 to 5.8.6 issues

Post by Interrex »

Hi Perry.

The profile you got is out of date. I have PMd you a new version of my profile. My bad.

Here's the output in my nagios.cfg

Code: Select all

# NDOUtils module
# Commented out by NDO 'make install-broker-line' on Tue Sep 28 22:19:04 CEST 2021
#broker_module=/usr/local/nagios/bin/ndomod.o config_file=/usr/local/nagios/etc/ndomod.cfg


# Added by NDO 'make install-broker-line' on Tue Sep 28 22:19:04 CEST 2021
broker_module=/usr/local/nagios/bin/ndo.so /usr/local/nagios/etc/ndo.cfg


- interrex