problem installing ndo2db/ndoutils on nagios 3.2.3

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.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: problem installing ndo2db/ndoutils on nagios 3.2.3

Post by sreinhardt »

Depending on which way mysql is starting via the init system, that might have just shown us what we are looking for. Could you change ndo2db.cfg so that db_host is 127.0.0.1 instead of localhost. (Yes I know they should be the same, but some systems are picky)

Code: Select all

db_host=localhost
TO
db_host=127.0.0.1
Also run

Code: Select all

ps -ef | grep mysql
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
majed
Posts: 98
Joined: Mon Mar 17, 2014 5:29 am

Re: problem installing ndo2db/ndoutils on nagios 3.2.3

Post by majed »

Code: Select all

root@oversun:~# ps -ef | grep mysql
mysql     8365     1  0 Mar21 ?        00:30:25 mysqld --skip-grant-tables
root     12264 11834  0 10:39 pts/3    00:00:00 /bin/sh -e /etc/init.d/mysql restart
root     12275 12264  0 10:39 pts/3    00:00:00 stop mysql
mysql    12943     1  0 10:43 ?        00:00:00 /usr/sbin/mysqld
root     13213 11834  0 10:44 pts/3    00:00:00 grep --color=auto mysql
i changed

Code: Select all

db_host=127.0.0.1
doesn't seem to have made a difference. still seems not to work.
Seek and you shall find, knock and it shall be opened, cry and you shall find comfort
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: problem installing ndo2db/ndoutils on nagios 3.2.3

Post by abrist »

Just as a test, try symlinking /etc/mysql to /etc/my.cnf:

Code: Select all

ln -s /etc/mysql /etc/my.cnf
And then restart mysql and ndo:

Code: Select all

service mysql restart
service ndo2db restart
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
majed
Posts: 98
Joined: Mon Mar 17, 2014 5:29 am

Re: problem installing ndo2db/ndoutils on nagios 3.2.3

Post by majed »

did

Code: Select all

ln -s /etc/mysql /etc/my.cnf
though i didn't understand what would that link as my.cnf is in /etc/mysql/my.cnf
then restarted mysql, nagios and ndoutils.
Got the following in nagios log:

Code: Select all

[1395682094] Event broker module '/usr/local/nagios/bin/ndomod.o' initialized successfully.
[1395682094] Finished daemonizing... (New PID=9956)
[1395682110] ndomod: Still unable to connect to data sink.  326 items lost, 50000 queued items to flush.
So I assume that didn't help.
Seek and you shall find, knock and it shall be opened, cry and you shall find comfort
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: problem installing ndo2db/ndoutils on nagios 3.2.3

Post by abrist »

majed wrote:though i didn't understand what would that link as my.cnf is in /etc/mysql/my.cnf
My apologies, I was under the impression that your sql config was /etc/mysql, not /etc/mysql/my.cnf. Remove the symlink and retry with:

Code: Select all

rm /etc/my.cnf
ln -s /etc/mysql/my.cnf /etc/my.cnf
For some reason ndo cannot find the mysql sock file, so we are trying to link the my.cnf config to where ndo expects as default.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
majed
Posts: 98
Joined: Mon Mar 17, 2014 5:29 am

Re: problem installing ndo2db/ndoutils on nagios 3.2.3

Post by majed »

honest mistake, else apology is necessary:)
did

Code: Select all

ln -s /etc/mysql/my.cnf /etc/my.cnf
removed the previous link
still getting the following in /var/log/nagios3/nagios.log

Code: Select all

[1395776334] Event broker module '/usr/local/nagios/bin/ndomod.o' initialized successfully.
[1395776334] Finished daemonizing... (New PID=6186)
[1395776350] ndomod: Still unable to connect to data sink.  354 items lost, 50000 queued items to flush.
Seek and you shall find, knock and it shall be opened, cry and you shall find comfort
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: problem installing ndo2db/ndoutils on nagios 3.2.3

Post by abrist »

First, remove the symlink:

Code: Select all

rm /etc/my.cnf
Next, lets check the ndo log for any hints:

Code: Select all

tail -50 /var/cache/nagios3/ndo2db.debug
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
majed
Posts: 98
Joined: Mon Mar 17, 2014 5:29 am

Re: problem installing ndo2db/ndoutils on nagios 3.2.3

Post by majed »

root@oversun:~# tail -50 /var/cache/nagios3/ndo2db.debug
tail: cannot open `/var/cache/nagios3/ndo2db.debug' for reading: No such file or directory
Seek and you shall find, knock and it shall be opened, cry and you shall find comfort
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: problem installing ndo2db/ndoutils on nagios 3.2.3

Post by abrist »

Well, I am running out of ideas, that was the location declared in your configs. Maybe you have 2 nagios installs and the configuration is split between them? Lets do some searches, but first, install mlocate:

Code: Select all

apt-get install mlocate
updatedb
locate nagios.cfg
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
majed
Posts: 98
Joined: Mon Mar 17, 2014 5:29 am

Re: problem installing ndo2db/ndoutils on nagios 3.2.3

Post by majed »

well mlocate is already installed on ubuntu so:
root@oversun:~# locate nagios.cfg

Code: Select all

/etc/nagios3/nagios.cfg
/usr/local/nagios/etc/nagios.cfg
/usr/local/nagios/nagiosgraph-1.4.4/examples/nagiosgraph-nagios.cfg
/usr/local/nagiosgraph/etc/nagiosgraph-nagios.cfg
/usr/local/nagiosgraph/examples/nagiosgraph-nagios.cfg
/usr/share/doc/nagios3-common/examples/nagios.cfg.gz
/var/tmp/ndoutils-2.0.0/ndoutils-2.0.0/config/nagios.cfg
/var/tmp/ndoutils-2.0.0/ndoutils-2.0.0/config/nagios.cfg.in
the file in
/usr/local/nagios/etc/nagios.cfg
is:

Code: Select all

event_broker_options=-1
broker_module=/usr/local/nagios/bin/ndomod.o config_file=/usr/local/nagios/etc/ndomod.cfg
the file in
/etc/nagios3/nagios.cfg
has the last line as follows:

Code: Select all

# ndoutils broker


broker_module=/usr/local/nagios/bin/ndomod.o config_file=/etc/nagios3/ndomod.cfg

#broker_module=/usr/local/nagios/binndomod.o config_file=/etc/nagios3/ndomod.cfg
and close to the beginning:

Code: Select all

# EVENT BROKER OPTIONS
# Controls what (if any) data gets sent to the event broker.
# Values:  0      = Broker nothing
#         -1      = Broker everything
#         <other> = See documentation

event_broker_options=-1
does it give a clue?
Seek and you shall find, knock and it shall be opened, cry and you shall find comfort
Locked