Errors when downgrading from NDO3 to NDO2

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
optionstechnology
Posts: 234
Joined: Thu Nov 17, 2016 11:26 am

Errors when downgrading from NDO3 to NDO2

Post by optionstechnology »

Hi,

We are seeing the below errors on our latest Nagios build when downgrading NDO3 to NDO2 during the ./install part.

System info:
[*]Nagios XI 5.8.3
[*]Redhat 7.9


Here's the commands we run:

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
ERRORS:

Code: Select all

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 function)
CLIENT_REMEMBER_OPTIONS
^
db.c:218:4: note: each undeclared identifier is reported only once for each function 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",mysql_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.mysql_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 function)
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/nagiosxi/subcomponents/ndoutils/ndoutils-2.1.3/src'
make[1]: *** [ndo2db] Error 2
make[1]: Leaving directory `/tmp/nagiosxi/subcomponents/ndoutils/ndoutils-2.1.3/src'
make: *** [all] Error 2
Can someone let us know if we're missing something?

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

Re: Errors when downgrading from NDO3 to NDO2

Post by pbroste »

Hello @optionstechnology

Thanks for reaching out, and understand that the compile on NDO2 is failing.

Code: Select all

cat /usr/local/nagiosxi/var/xiversion | grep full
cat /etc/os-release
uname -a
lsb_release -a
 hostnamectl
php -v
yum repolist
We see that you are currently on 5.8.3 Nagios XI version and want to have you download the matching installer and run through the subcomponents install for ndoutils.

Code: Select all

mkdir /tmp/583
cd /tmp/583
wget https://assets.nagios.com/downloads/nagiosxi/5/xi-5.8.3.tar.gz
cd /tmp/583/nagiosxi/subcomponents/ndo/
tar -xvf ndoutils-2.1.3.tar.gz
cd ndoutils-2.1.3
./install-sh | tee /tmp/ndoresults.txt

Code: Select all

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
Here is a support article that provides a really good outline as well for your reference:
https://support.nagios.com/kb/article.php?id=406

Please let us know the results,
Perry
optionstechnology
Posts: 234
Joined: Thu Nov 17, 2016 11:26 am

Re: Errors when downgrading from NDO3 to NDO2

Post by optionstechnology »

I get this when running the install-


ndoutils-2.1.3]# ./install-sh | tee /tmp/ndoresults.txt
install: no input file specified
jvaira
Posts: 59
Joined: Tue Dec 22, 2015 7:40 pm

Re: Errors when downgrading from NDO3 to NDO2

Post by jvaira »

Just out of curiosity why the downgrade?
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: Errors when downgrading from NDO3 to NDO2

Post by pbroste »

Hello @optionstechnology

Thanks for following up, and please let us know the reason for the downgrade so we can figure out if we can help dial-in issues.

If you decide to continue with the ndoutils install please see install from source see; Downloading NDOUtils Source section.

Thanks,
Perry
optionstechnology
Posts: 234
Joined: Thu Nov 17, 2016 11:26 am

Re: Errors when downgrading from NDO3 to NDO2

Post by optionstechnology »

@pbroste from the instructions you posted above I get this when running the install-

ndoutils-2.1.3]# ./install-sh | tee /tmp/ndoresults.txt
install: no input file specified

Can you tell me what I should be specifying here?
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: Errors when downgrading from NDO3 to NDO2

Post by pbroste »

Hello @optionstechnology

### STANDARD DOWNGRADE OF NDO3

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
Let us know how this looks,
Perry
optionstechnology
Posts: 234
Joined: Thu Nov 17, 2016 11:26 am

Re: Errors when downgrading from NDO3 to NDO2

Post by optionstechnology »

Right so, see way up at the top of this thread where the thing you just posted is the exact process we followed?

and see the errors that we got while running that process?

That's why were here


The ./install step produces the errors reported in our initial post



When I follow the instructions in the support article https://support.nagios.com/kb/article.php?id=406#RHEL I hit the same problem, when I run the configure I get:

Code: Select all

[root@nagserver ndoutils-2.1.3]# make all
cd ./src && make
make[1]: Entering directory `/tmp/nagiosxi/subcomponents/ndo/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 -lnsl
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/nagiosxi/subcomponents/ndo/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 function)
    CLIENT_REMEMBER_OPTIONS
    ^
db.c:218:4: note: each undeclared identifier is reported only once for each function 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",mysql_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.mysql_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 function)
  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/nagiosxi/subcomponents/ndo/ndoutils-2.1.3/src'
make[1]: *** [ndo2db] Error 2
make[1]: Leaving directory `/tmp/nagiosxi/subcomponents/ndo/ndoutils-2.1.3/src'
make: *** [all] Error 2
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Errors when downgrading from NDO3 to NDO2

Post by ssax »

You may be missing the mariadb-devel or mysql-devel package (depending on what DB you're running), what is the output of these commands?

Code: Select all

rpm -qa | grep -i maria
rpm -qa | grep -i mysql
optionstechnology
Posts: 234
Joined: Thu Nov 17, 2016 11:26 am

Re: Errors when downgrading from NDO3 to NDO2

Post by optionstechnology »

Code: Select all

[root@nagserver ndoutils-2.1.3]# rpm -qa | grep -i maria
mariadb-libs-5.5.68-1.el7.x86_64
mariadb-5.5.68-1.el7.x86_64
mariadb-server-5.5.68-1.el7.x86_64
[root@nagserver ndoutils-2.1.3]# rpm -qa | grep -i mysql
php-mysql-5.4.16-48.el7.x86_64
perl-DBD-MySQL-4.023-6.el7.x86_64
Locked