NDOutils does not populate mysql database

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.
Rhobar
Posts: 41
Joined: Sat Mar 16, 2013 9:23 am
Location: Rome, Italy

Re: NDOutils does not populate mysql database

Post by Rhobar »

from my first post ;)
Rhobar wrote: mysql> select count(*) from nagios_conninfo;
+----------+
| count(*) |
+----------+
| 0 |
+----------+
1 row in set (0.00 sec)
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: NDOutils does not populate mysql database

Post by scottwilkerson »

Rhobar wrote:from my first post ;)
Rhobar wrote: mysql> select count(*) from nagios_conninfo;
+----------+
| count(*) |
+----------+
| 0 |
+----------+
1 row in set (0.00 sec)
I didn't ask for that, I asked for nagios_objects
scottwilkerson wrote:So you have nothing in the DB?

Can you run a select on the objects table

ie:

Code: Select all

select count(*) from nagios_objects;
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Rhobar
Posts: 41
Joined: Sat Mar 16, 2013 9:23 am
Location: Rome, Italy

Re: NDOutils does not populate mysql database

Post by Rhobar »

scottwilkerson wrote:
Can you run a select on the objects table

ie:

Code: Select all

select count(*) from nagios_objects;
here there is:

Code: Select all

mysql> select count(*) from nagios_objects;
+----------+
| count(*) |
+----------+
|        0 |
+----------+
1 row in set (0.00 sec)
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: NDOutils does not populate mysql database

Post by scottwilkerson »

Can we verify that the user you have specified in the ndo2db.cfg can log in to the db and then the permissions

Code: Select all

mysql -u nagios -pnpass nagios
SHOW PRIVILEGES\G
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Rhobar
Posts: 41
Joined: Sat Mar 16, 2013 9:23 am
Location: Rome, Italy

Re: NDOutils does not populate mysql database

Post by Rhobar »

Code: Select all

[root@StudentStation9 ~]# mysql -u nagios -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.1.67 Source distribution

Copyright (c) 2000, 2012, 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> SHOW PRIVILEGES\G
*************************** 1. row ***************************
Privilege: Alter
  Context: Tables
  Comment: To alter the table
*************************** 2. row ***************************
Privilege: Alter routine
  Context: Functions,Procedures
  Comment: To alter or drop stored functions/procedures
*************************** 3. row ***************************
Privilege: Create
  Context: Databases,Tables,Indexes
  Comment: To create new databases and tables
*************************** 4. row ***************************
Privilege: Create routine
  Context: Databases
  Comment: To use CREATE FUNCTION/PROCEDURE
*************************** 5. row ***************************
Privilege: Create temporary tables
  Context: Databases
  Comment: To use CREATE TEMPORARY TABLE
*************************** 6. row ***************************
Privilege: Create view
  Context: Tables
  Comment: To create new views
*************************** 7. row ***************************
Privilege: Create user
  Context: Server Admin
  Comment: To create new users
*************************** 8. row ***************************
Privilege: Delete
  Context: Tables
  Comment: To delete existing rows
*************************** 9. row ***************************
Privilege: Drop
  Context: Databases,Tables
  Comment: To drop databases, tables, and views
*************************** 10. row ***************************
Privilege: Event
  Context: Server Admin
  Comment: To create, alter, drop and execute events
*************************** 11. row ***************************
Privilege: Execute
  Context: Functions,Procedures
  Comment: To execute stored routines
*************************** 12. row ***************************
Privilege: File
  Context: File access on server
  Comment: To read and write files on the server
*************************** 13. row ***************************
Privilege: Grant option
  Context: Databases,Tables,Functions,Procedures
  Comment: To give to other users those privileges you possess
*************************** 14. row ***************************
Privilege: Index
  Context: Tables
  Comment: To create or drop indexes
*************************** 15. row ***************************
Privilege: Insert
  Context: Tables
  Comment: To insert data into tables
*************************** 16. row ***************************
Privilege: Lock tables
  Context: Databases
  Comment: To use LOCK TABLES (together with SELECT privilege)
*************************** 17. row ***************************
Privilege: Process
  Context: Server Admin
  Comment: To view the plain text of currently executing queries
*************************** 18. row ***************************
Privilege: References
  Context: Databases,Tables
  Comment: To have references on tables
*************************** 19. row ***************************
Privilege: Reload
  Context: Server Admin
  Comment: To reload or refresh tables, logs and privileges
*************************** 20. row ***************************
Privilege: Replication client
  Context: Server Admin
  Comment: To ask where the slave or master servers are
*************************** 21. row ***************************
Privilege: Replication slave
  Context: Server Admin
  Comment: To read binary log events from the master
*************************** 22. row ***************************
Privilege: Select
  Context: Tables
  Comment: To retrieve rows from table
*************************** 23. row ***************************
Privilege: Show databases
  Context: Server Admin
  Comment: To see all databases with SHOW DATABASES
*************************** 24. row ***************************
Privilege: Show view
  Context: Tables
  Comment: To see views with SHOW CREATE VIEW
*************************** 25. row ***************************
Privilege: Shutdown
  Context: Server Admin
  Comment: To shut down the server
*************************** 26. row ***************************
Privilege: Super
  Context: Server Admin
  Comment: To use KILL thread, SET GLOBAL, CHANGE MASTER, etc.
*************************** 27. row ***************************
Privilege: Trigger
  Context: Tables
  Comment: To use triggers
*************************** 28. row ***************************
Privilege: Update
  Context: Tables
  Comment: To update existing rows
*************************** 29. row ***************************
Privilege: Usage
  Context: Server Admin
  Comment: No privileges - allow connect only
29 rows in set (0.00 sec)

mysql> 
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: NDOutils does not populate mysql database

Post by scottwilkerson »

Ok, a couple more things, can you post the output of the following commands

Code: Select all

ls -l /usr/local/nagios/var/ndo.sock
cat /etc/sysctl.conf |grep msg
cat /etc/sysctl.conf |grep shm
Finally, can you set the following in nd02db.cfg and restart nd02db to see if any messages show up in the systems syslog

Code: Select all

debug_level=2
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked