Problem with 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.
Cristhian_Plaza
Posts: 62
Joined: Thu Oct 27, 2016 2:43 pm

Re: Problem with NDOUtils

Post by Cristhian_Plaza »

scottwilkerson wrote:can you tail the system log on the machine in one terminal and then restart ndo2db in another

Terminal 1

Code: Select all

tail -f /var/log/messages
Terminal 2

Code: Select all

systemctl restart ndo2db
and see if you get the message saying it flushed to datasink.

Also, now that we know you can connect to the database from the CLI, did you verify you have the same credentials in the ndo2db.cfg ?
When I put this code

Code: Select all

systemctl restart ndo2db
Origin with tail -f this another

Code: Select all

Aug 15 21:46:49 ip-10-0-8-150 systemd: Stopping Stores data from Nagios in a database...
Aug 15 21:46:49 ip-10-0-8-150 systemd: Starting Stores data from Nagios in a database...
Aug 15 21:46:49 ip-10-0-8-150 systemd: Failed to read PID from file /var/run/ndoutils/ndo2db.pid: Invalid argument
Aug 15 21:46:49 ip-10-0-8-150 systemd: Started Stores data from Nagios in a database.
Yes..., credentials are correctly in ndo2db.cfg
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Problem with NDOUtils

Post by scottwilkerson »

to clarify what is currently set and you provide the output if the following

Code: Select all

sysctl -p
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Cristhian_Plaza
Posts: 62
Joined: Thu Oct 27, 2016 2:43 pm

Re: Problem with NDOUtils

Post by Cristhian_Plaza »

scottwilkerson wrote:to clarify what is currently set and you provide the output if the following

Code: Select all

sysctl -p

Code: Select all

kernel.msgmnb = 262144000
kernel.msgmax = 262144000
kernel.shmmax = 4294967295
kernel.shmall = 268435456
kernel.msgmni = 512000
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Problem with NDOUtils

Post by scottwilkerson »

This looks correct.
Can you share your /etc/nagios/ndo2db.cfg either here or in PM?
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Cristhian_Plaza
Posts: 62
Joined: Thu Oct 27, 2016 2:43 pm

Re: Problem with NDOUtils

Post by Cristhian_Plaza »

scottwilkerson wrote:This looks correct.
Can you share your /etc/nagios/ndo2db.cfg either here or in PM?
Sent it
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Problem with NDOUtils

Post by scottwilkerson »

This all looked typical as long as you have the correct DB name and user/pass setup. The only other thing that could be suspect would be if your system couldn't find your mysql.sock file and then you would want to uncomment this line and specify the correct path

Code: Select all

#db_socket=/var/lib/mysql/mysql.sock
At this poing lets edit the file and set

Code: Select all

debug_level=1
Then restart ndo2db

Wait a minute and then grab the created file in /var/log/nagios/ndo2db.log
and attach if nothing stands out looking at it.

Then set it back to 0 and restart ndo2db again so we don't continue to create all the debug logs
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Cristhian_Plaza
Posts: 62
Joined: Thu Oct 27, 2016 2:43 pm

Re: Problem with NDOUtils

Post by Cristhian_Plaza »

It connects correctly to the Database as you can see.., in the new file created "ndo2db.log" it doesn't appear any information, nothing.

Code: Select all

[root@ip-10-0-8-150 nagios]# systemctl status ndo2db
● ndo2db.service - Stores data from Nagios in a database
   Loaded: loaded (/usr/lib/systemd/system/ndo2db.service; enabled; vendor preset: disabled)
   Active: active (running) since Wed 2017-08-16 20:19:17 UTC; 1min 3s ago
     Docs: http://www.nagios.org/documentation
  Process: 7789 ExecStart=/usr/sbin/ndo2db -c /etc/nagios/ndo2db.cfg (code=exited, status=0/SUCCESS)
 Main PID: 7791 (ndo2db)
   CGroup: /system.slice/ndo2db.service
           ├─7791 /usr/sbin/ndo2db -c /etc/nagios/ndo2db.cfg
           ├─7793 /usr/sbin/ndo2db -c /etc/nagios/ndo2db.cfg
           └─7794 /usr/sbin/ndo2db -c /etc/nagios/ndo2db.cfg

Aug 16 20:19:17 ip-10-0-8-150.ec2.eys.internal systemd[1]: Starting Stores data from Nagios in a database...
Aug 16 20:19:17 ip-10-0-8-150.ec2.eys.internal systemd[1]: Failed to read PID from file /var/run/ndoutils/ndo2db.pid: Invalid argument
Aug 16 20:19:17 ip-10-0-8-150.ec2.eys.internal systemd[1]: Started Stores data from Nagios in a database.
Aug 16 20:19:38 ip-10-0-8-150.ec2.eys.internal ndo2db[7793]: Successfully connected to MySQL database
Aug 16 20:19:38 ip-10-0-8-150.ec2.eys.internal ndo2db[7794]: Successfully connected to MySQL database
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Problem with NDOUtils

Post by scottwilkerson »

This is the first time I have seen a sucessful connection logged in all of your messages:

Code: Select all

Successfully connected to MySQL database
but it doesn't make any sense that there is nothing in that log.

You did change the debug_level to be 1 right?
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Cristhian_Plaza
Posts: 62
Joined: Thu Oct 27, 2016 2:43 pm

Re: Problem with NDOUtils

Post by Cristhian_Plaza »

scottwilkerson wrote:This is the first time I have seen a sucessful connection logged in all of your messages:

Code: Select all

Successfully connected to MySQL database
but it doesn't make any sense that there is nothing in that log.

You did change the debug_level to be 1 right?
Yes... I changed it two times..., first to generate the ndo2db.log file and after for no generate it again, so now it has a 0 value...., about the connection, I said before credentials were correctly added since I opened this ticket.
Cristhian_Plaza
Posts: 62
Joined: Thu Oct 27, 2016 2:43 pm

Re: Problem with NDOUtils

Post by Cristhian_Plaza »

If it helps..., a new message appeared into /var/log/messages, this says:

Code: Select all

nagios: ndomod: Please check remote ndo2db log, data                                                                                      base connection or SSL Parameters
Locked