Page 2 of 4

Re: NDOUtils - Nagios and MySQL Server on different hosts

Posted: Tue Dec 03, 2013 12:58 pm
by abrist
My apologies. I need the ndo2db.cfg file instead.

Re: NDOUtils - Nagios and MySQL Server on different hosts

Posted: Wed Dec 04, 2013 9:51 am
by sebastiaopburnay
Both files have been extracted in 'binary mode' so that they will show if something is wrong

Re: NDOUtils - Nagios and MySQL Server on different hosts

Posted: Wed Dec 04, 2013 1:18 pm
by abrist
You know, sockets actually have a trailing equals sign, it is just normally hidden, but can be listed with "ls -F". Maybe your "ll" alias includes "-F". What is the output of:

Code: Select all

alias -p

Re: NDOUtils - Nagios and MySQL Server on different hosts

Posted: Wed Dec 04, 2013 1:22 pm
by sebastiaopburnay
You're right,

I thought that ll was just an 'ls -l' but is seems to be 'ls -alF':

Code: Select all

root@myServer:~# alias -p
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias grep='grep --color=auto'
alias l='ls -CF'
alias la='ls -A'
alias ll='ls -alF'
alias ls='ls --color=auto'
When I ran 'ls -l' I got rid of the '='

Code: Select all

root@myServer:/usr/local/nagios/var# ls -l
total 1544
drwxrwxr-x 2 nagios nagios    4096 Dec  4 00:00 archives
-rw-r--r-- 1 nagios nagios       6 Dec  4 15:42 nagios.lock
-rw-rw-r-- 1 nagios nagios 1507298 Dec  4 18:22 nagios.log
srwxr-xr-x 1 nagios nagios       0 Dec  3 17:16 ndo.sock
-rw-rw-rw- 1 nagios nagios       0 Nov 29 17:07 ndo2db.debug
-rw-r--r-- 1 nagios nagios       4 Dec  3 17:16 ndo2db.lock
-rw-r--r-- 1 nagios nagios   13840 Dec  4 15:42 objects.cache
-rw------- 1 nagios nagios   14877 Dec  4 17:42 retention.dat
drwxrwsr-x 2 nagios nagcmd    4096 Dec  4 15:42 rw
drwxr-xr-x 3 root   root      4096 Jul  4 19:18 spool
-rw-rw-r-- 1 nagios nagios   15473 Dec  4 18:22 status.dat

Re: NDOUtils - Nagios and MySQL Server on different hosts

Posted: Wed Dec 04, 2013 1:57 pm
by abrist
Well, dang. There is most likely nothing wrong with the socket. Lets check to see if you can log into the remote database. From the nagios core server, run:

Code: Select all

mysql -u nagios -p'<PASSWORD>' -h <IP_ADDRESS_OF_MYSQL_SERVER> 
Make sure to replace <PASSWORD> and <IP_ADDRESS_OF_MYSQL_SERVER>.

Re: NDOUtils - Nagios and MySQL Server on different hosts

Posted: Wed Dec 04, 2013 2:16 pm
by sebastiaopburnay
abrist wrote:Well, dang. There is most likely nothing wrong with the socket. Lets check to see if you can log into the remote database. From the nagios core server, run:

Code: Select all

mysql -u nagios -p'<PASSWORD>' -h <IP_ADDRESS_OF_MYSQL_SERVER> 
Make sure to replace <PASSWORD> and <IP_ADDRESS_OF_MYSQL_SERVER>.
Yes, at first, I thought that was my problem,

But I can actually use CLI to connect to MySQL server from Nagos Core Server

Code: Select all

root@myServer:/usr/local/nagios/etc# mysql -u nagios  -h 172.20.81.135 -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 194
Server version: 5.5.31-0ubuntu0.12.04.2-log (Ubuntu)

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use ndoutils
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> SELECT * FROM nagios_hosts;
Empty set (0.00 sec)

mysql> 

Re: NDOUtils - Nagios and MySQL Server on different hosts

Posted: Wed Dec 04, 2013 2:25 pm
by abrist
From your ndo2db.cfg:

Code: Select all

# DATABASE USERNAME/PASSWORD
# This is the username/password that will be used to authenticate to the DB.
# The user needs at least SELECT, INSERT, UPDATE, and DELETE privileges on
# the database.

db_user=nagios
db_pass=nagios
Is the pass actually 'nagios'? Does the nagios db user have the correct privileges?

Re: NDOUtils - Nagios and MySQL Server on different hosts

Posted: Wed Dec 04, 2013 2:29 pm
by sebastiaopburnay
abrist wrote:From your ndo2db.cfg:
Is the pass actually 'nagios'? Does the nagios db user have the correct privileges?
Yes, I kept it like that unill I could figure the communications properly,

About the privilleges, I've done a:

Code: Select all

GRANT ALL ON ndoutils.* TO 'nagios'@'172.20.82.134' IDENTIFIED BY 'nagios';
Query OK, 0 rows affected (0.00 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
So, I guess that the user even has more privileges than it needs

Re: NDOUtils - Nagios and MySQL Server on different hosts

Posted: Wed Dec 04, 2013 2:34 pm
by sebastiaopburnay
sebastiaopburnay wrote:
abrist wrote:From your ndo2db.cfg:
Is the pass actually 'nagios'? Does the nagios db user have the correct privileges?
Yes, I kept it like that unill I could figure the communications properly,

About the privilleges, I've done a:

Code: Select all

GRANT ALL ON ndoutils.* TO 'nagios'@'172.20.82.134' IDENTIFIED BY 'nagios';
Query OK, 0 rows affected (0.00 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
So, I guess that the user even has more privileges than it needs
I'm now wondering if I should try to reinstall NDOUtils on my Nagios Core server.

I don't need anything else than MySQL server, NDOUtils database and correct privileges on my MySQL Server, do I?

Re: NDOUtils - Nagios and MySQL Server on different hosts

Posted: Wed Dec 04, 2013 2:36 pm
by abrist
sebastiaopburnay wrote:I don't need anything else than MySQL server, NDOUtils database and correct privileges on my MySQL Server, do I?
Nope, that is all you need on the remote system.
Any logs worth mentioning from the remote db?