Storing data from Nagios to MariaDB using ndoutils

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
zest001
Posts: 1
Joined: Mon Dec 26, 2016 8:08 am

Storing data from Nagios to MariaDB using ndoutils

Post by zest001 »

I am using ndoutils-2.1.2 for Storing Nagios data directory into MariaDB Database.

For this I am using the below URL (NDOUtils.pdf) :
https://assets.nagios.com/downloads/nag ... OUtils.pdf

In my case MariaDB database and Nagios in on different Server.
I run the following command

Code: Select all

yum -y install mysql-client gcc-c++ libdbi-dbd-mysql
tar xzf ndoutils-2.1.2.tar.gz
cd ndoutils-2.1.2
./configure
make all
When I run make all command it gives the following Error :

Code: Select all

[root@localhost ndoutils-2.1.2]# make all
cd ./src && make
make[1]: Entering directory `/root/nagios/ndoutils-2.1.2/src'
gcc -fPIC -fPIC -g -O2 -DHAVE_CONFIG_H  -c -o io.o io.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 `/root/nagios/ndoutils-2.1.2/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;
Please help me to fix this issue.
I am using CentOS 7, Nagios Core 4.2.2, NDOUtils v2.1.2 and MariaDB-5.5.50.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Storing data from Nagios to MariaDB using ndoutils

Post by dwhitfield »

Please try https://support.nagios.com/kb/article.php?id=406. You'll notice those instructions do not use make all. The instructions you are using are actually newer. We need to do a little more digging on our end as to why the make all is not working, but I want to make sure your issue is resolved first. Thanks!
Locked