Database Backend error: System Status NagiosXI

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Nags007
Posts: 58
Joined: Wed Mar 08, 2017 12:32 pm

Database Backend error: System Status NagiosXI

Post by Nags007 »

We are successfully able to login to NagiosXI and able to see the dashboard.

We are seeing the red color highlighted in the database section.

We are getting the below error message:

/usr/local/nagiosxi/var

Code: Select all

[root@var]# less dbmaint.log
============================
CREATING: /usr/local/nagiosxi/var/dbmaint.lock
CLEANING ndoutils TABLE 'commenthistory'...
SQL: DELETE FROM nagios_commenthistory WHERE entry_time < FROM_UNIXTIME(1458066302)
CLEANING ndoutils TABLE 'processevents'...
SQL: DELETE FROM nagios_processevents WHERE event_time < FROM_UNIXTIME(1458066302)
CLEANING ndoutils TABLE 'externalcommands'...
SQL: DELETE FROM nagios_externalcommands WHERE entry_time < FROM_UNIXTIME(1488997502)
CLEANING ndoutils TABLE 'logentries'...
SQL: DELETE FROM nagios_logentries WHERE logentry_time < FROM_UNIXTIME(1481826302)
CLEANING ndoutils TABLE 'notifications'...
SQL: DELETE FROM nagios_notifications WHERE start_time < FROM_UNIXTIME(1481826302)
CLEANING ndoutils TABLE 'contactnotifications'...
SQL: DELETE FROM nagios_contactnotifications WHERE start_time < FROM_UNIXTIME(1481826302)
CLEANING ndoutils TABLE 'contactnotificationmethods'...
SQL: DELETE FROM nagios_contactnotificationmethods WHERE start_time < FROM_UNIXTIME(1481826302)
CLEANING ndoutils TABLE 'statehistory'...
SQL: DELETE FROM nagios_statehistory WHERE state_time < FROM_UNIXTIME(1426530302)
CLEANING ndoutils TABLE 'timedevents'...
SQL: DELETE FROM nagios_timedevents WHERE event_time < FROM_UNIXTIME(1489602002)
CLEANING ndoutils TABLE 'systemcommands'...
SQL: DELETE FROM nagios_systemcommands WHERE start_time < FROM_UNIXTIME(1489602002)
CLEANING ndoutils TABLE 'servicechecks'...
SQL: DELETE FROM nagios_servicechecks WHERE start_time < FROM_UNIXTIME(1489602002)
CLEANING ndoutils TABLE 'hostchecks'...
SQL: DELETE FROM nagios_hostchecks WHERE start_time < FROM_UNIXTIME(1489602002)
CLEANING ndoutils TABLE 'eventhandlers'...
SQL: DELETE FROM nagios_eventhandlers WHERE start_time < FROM_UNIXTIME(1489602002)
LASTOPT:  1489600202
INTERVAL: 60
NOW:      1489602302
OPTTIME:  1489603802
CLEANING nagiosxi TABLE 'commands'...
SQL: DELETE FROM xi_commands WHERE processing_time < FROM_UNIXTIME(1489573502)
CLEANING nagiosxi TABLE 'events'...
SQL: DELETE FROM xi_events WHERE processing_time < FROM_UNIXTIME(1489573502)
SQL1: SELECT xi_meta.meta_id FROM xi_meta LEFT JOIN xi_events ON xi_meta.metaobj_id=xi_events.event_id WHERE metatype_id='1' AND event_id IS NULL
SQL2: Deleted 0 (DELETE FROM xi_meta WHERE meta_id IN (SELECT xi_meta.meta_id FROM xi_meta LEFT JOIN xi_events ON xi_meta.metaobj_id=xi_events.event_id WHERE metatype_id='1' AND event_id IS NULL))
CLEANING nagiosxi TABLE 'auditlog'...
dbmaint.log

I found the pdf file : https://assets.nagios.com/downloads/nag ... tabase.pdf

Nagios XI – Repairing The Database

executed all the below steps mentioned in the doc.

Code: Select all

service mysqld stop
cd /var/lib/mysql/nagios
myisamchk -r -f nagios_<corrupted_table>
service mysqld start
rm -f /usr/local/nagiosxi/var/dbmaint.lock
/usr/local/nagiosxi/cron/dbmaint.php

===============================================
myisamchk -r -f nagios_externalcommands
myisamchk -r -f nagios_logentries
myisamchk -r -f nagios_notifications
myisamchk -r -f nagios_contactnotifications
myisamchk -r -f nagios_contactnotificationmethods
myisamchk -r -f nagios_statehistory
myisamchk -r -f nagios_timedevents
myisamchk -r -f nagios_systemcommands
myisamchk -r -f nagios_servicechecks
myisamchk -r -f nagios_hostchecks
myisamchk -r -f nagios_eventhandlers
=========================================================
Also , mysql is running fine.

Code: Select all

[root@var]# mysql -u nagiosxi -p nagiosxi
=======================================
Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1681
Server version: 5.1.73 Source distribution

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.

==================================================================

Code: Select all

root#  ps aux | grep mysqld
===========================
root     18280  0.0  0.0 108220  1456 pts/0    S    14:03   0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --socket=/var/lib/mysql/mysql.sock --pid-file=/var/run/mysqld/mysqld.pid --basedir=/usr --user=mysql
mysql    18400  0.2  0.2 2281936 42732 pts/0   Sl   14:03   0:06 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --log-error=/var/log/mysqld.log --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/lib/mysql/mysql.sock

Code: Select all

cat /var/log/mysqld.log
=========================

170313 20:18:29 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
170313 20:18:29  InnoDB: Initializing buffer pool, size = 8.0M
170313 20:18:29  InnoDB: Completed initialization of buffer pool
170313 20:18:29  InnoDB: Started; log sequence number 0 44233
170313 20:18:29 [Note] Event Scheduler: Loaded 0 events
170313 20:18:29 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
170313 20:20:11 [Note] /usr/libexec/mysqld: Normal shutdown

170313 20:20:11 [Note] Event Scheduler: Purging the queue. 0 events
170313 20:20:11  InnoDB: Starting shutdown...
170313 20:20:15  InnoDB: Shutdown completed; log sequence number 0 44233
170313 20:20:15 [Note] /usr/libexec/mysqld: Shutdown complete

170313 20:20:15 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
170313 20:20:16 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
170313 20:20:16  InnoDB: Initializing buffer pool, size = 8.0M
170313 20:20:16  InnoDB: Completed initialization of buffer pool
170313 20:20:16  InnoDB: Started; log sequence number 0 44233
170313 20:20:16 [Note] Event Scheduler: Loaded 0 events
170313 20:20:16 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
170313 20:20:17 [Note] /usr/libexec/mysqld: Normal shutdown

170313 20:20:17 [Note] Event Scheduler: Purging the queue. 0 events
170313 20:20:17  InnoDB: Starting shutdown...
170313 20:20:21  InnoDB: Shutdown completed; log sequence number 0 44233
170313 20:20:21 [Note] /usr/libexec/mysqld: Shutdown complete

170313 20:20:21 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
170313 20:20:22 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
170313 20:20:22  InnoDB: Initializing buffer pool, size = 8.0M
170313 20:20:22  InnoDB: Completed initialization of buffer pool
170313 20:20:22  InnoDB: Started; log sequence number 0 44233
170313 20:20:22 [Note] Event Scheduler: Loaded 0 events
170313 20:20:22 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
170313 20:20:24 [Note] /usr/libexec/mysqld: Normal shutdown

170313 20:20:24 [Note] Event Scheduler: Purging the queue. 0 events
170313 20:20:24  InnoDB: Starting shutdown...
170313 20:20:27  InnoDB: Shutdown completed; log sequence number 0 44233
170313 20:20:27 [Note] /usr/libexec/mysqld: Shutdown complete

170313 20:20:27 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
170313 20:20:28 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
170313 20:20:28  InnoDB: Initializing buffer pool, size = 8.0M
170313 20:20:28  InnoDB: Completed initialization of buffer pool
170313 20:20:28  InnoDB: Started; log sequence number 0 44233
170313 20:20:28 [Note] Event Scheduler: Loaded 0 events
170313 20:20:28 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
170313 20:22:45 [Note] /usr/libexec/mysqld: Normal shutdown

170313 20:22:45 [Note] Event Scheduler: Purging the queue. 0 events
170313 20:22:45  InnoDB: Starting shutdown...
170313 20:22:48  InnoDB: Shutdown completed; log sequence number 0 44233
170313 20:22:48 [Note] /usr/libexec/mysqld: Shutdown complete

170313 20:22:48 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
170313 20:22:49 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
170313 20:22:49  InnoDB: Initializing buffer pool, size = 8.0M
170313 20:22:49  InnoDB: Completed initialization of buffer pool
170313 20:22:49  InnoDB: Started; log sequence number 0 44233
170313 20:22:49 [Note] Event Scheduler: Loaded 0 events
170313 20:22:49 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
170313 20:22:56 [Note] /usr/libexec/mysqld: Normal shutdown

170313 20:22:56 [Note] Event Scheduler: Purging the queue. 0 events
170313 20:22:56  InnoDB: Starting shutdown...
170313 20:22:59  InnoDB: Shutdown completed; log sequence number 0 44233
170313 20:22:59 [Note] /usr/libexec/mysqld: Shutdown complete

170313 20:22:59 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
170313 20:23:00 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
170313 20:23:00  InnoDB: Initializing buffer pool, size = 8.0M
170313 20:23:00  InnoDB: Completed initialization of buffer pool
170313 20:23:00  InnoDB: Started; log sequence number 0 44233
170313 20:23:00 [Note] Event Scheduler: Loaded 0 events
170313 20:23:00 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
170313 20:39:32 [Note] /usr/libexec/mysqld: Normal shutdown

170313 20:39:32 [Note] Event Scheduler: Purging the queue. 0 events
170313 20:39:32  InnoDB: Starting shutdown...
170313 20:39:36  InnoDB: Shutdown completed; log sequence number 0 44233
170313 20:39:36 [Note] /usr/libexec/mysqld: Shutdown complete

170313 20:39:36 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
170313 20:39:37 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
170313 20:39:37  InnoDB: Initializing buffer pool, size = 8.0M
170313 20:39:37  InnoDB: Completed initialization of buffer pool
170313 20:39:37  InnoDB: Started; log sequence number 0 44233
170313 20:39:37 [Note] Event Scheduler: Loaded 0 events
170313 20:39:37 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
170313 20:58:15 [Note] /usr/libexec/mysqld: Normal shutdown

170313 20:58:15 [Note] Event Scheduler: Purging the queue. 0 events
170313 20:58:15  InnoDB: Starting shutdown...
170313 20:58:19  InnoDB: Shutdown completed; log sequence number 0 44233
170313 20:58:19 [Note] /usr/libexec/mysqld: Shutdown complete

170313 20:58:19 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
170313 20:58:20 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
170313 20:58:20  InnoDB: Initializing buffer pool, size = 8.0M
170313 20:58:20  InnoDB: Completed initialization of buffer pool
170313 20:58:20  InnoDB: Started; log sequence number 0 44233
170313 20:58:20 [Note] Event Scheduler: Loaded 0 events
170313 20:58:20 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
170313 20:58:21 [Note] /usr/libexec/mysqld: Normal shutdown

170313 20:58:21 [Note] Event Scheduler: Purging the queue. 0 events
170313 20:58:21  InnoDB: Starting shutdown...
170313 20:58:25  InnoDB: Shutdown completed; log sequence number 0 44233
170313 20:58:25 [Note] /usr/libexec/mysqld: Shutdown complete

170313 20:58:25 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
170313 20:58:26 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
170313 20:58:26  InnoDB: Initializing buffer pool, size = 8.0M
170313 20:58:26  InnoDB: Completed initialization of buffer pool
170313 20:58:26  InnoDB: Started; log sequence number 0 44233
170313 20:58:26 [Note] Event Scheduler: Loaded 0 events
170313 20:58:26 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
170313 20:58:27 [Note] /usr/libexec/mysqld: Normal shutdown

170313 20:58:27 [Note] Event Scheduler: Purging the queue. 0 events
170313 20:58:27  InnoDB: Starting shutdown...
170313 20:58:31  InnoDB: Shutdown completed; log sequence number 0 44233
170313 20:58:31 [Note] /usr/libexec/mysqld: Shutdown complete

170313 20:58:31 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
170313 20:58:32 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
170313 20:58:32  InnoDB: Initializing buffer pool, size = 8.0M
170313 20:58:32  InnoDB: Completed initialization of buffer pool
170313 20:58:32  InnoDB: Started; log sequence number 0 44233
170313 20:58:32 [Note] Event Scheduler: Loaded 0 events
170313 20:58:32 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
170314 10:53:14 [Note] /usr/libexec/mysqld: Normal shutdown

170314 10:53:14 [Note] Event Scheduler: Purging the queue. 0 events
170314 10:53:14  InnoDB: Starting shutdown...
170314 10:53:17  InnoDB: Shutdown completed; log sequence number 0 44233
170314 10:53:17 [Note] /usr/libexec/mysqld: Shutdown complete

170314 10:53:17 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
170314 10:53:17 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
170314 10:53:17  InnoDB: Initializing buffer pool, size = 8.0M
170314 10:53:17  InnoDB: Completed initialization of buffer pool
170314 10:53:17  InnoDB: Started; log sequence number 0 44233
170314 10:53:17 [Note] Event Scheduler: Loaded 0 events
170314 10:53:17 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
170314 10:53:18 [Note] /usr/libexec/mysqld: Normal shutdown

170314 10:53:18 [Note] Event Scheduler: Purging the queue. 0 events
170314 10:53:18  InnoDB: Starting shutdown...
170314 10:53:22  InnoDB: Shutdown completed; log sequence number 0 44233
170314 10:53:22 [Note] /usr/libexec/mysqld: Shutdown complete

170314 10:53:22 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
170314 10:53:24 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
170314 10:53:24  InnoDB: Initializing buffer pool, size = 8.0M
170314 10:53:24  InnoDB: Completed initialization of buffer pool
170314 10:53:24  InnoDB: Started; log sequence number 0 44233
170314 10:53:24 [Note] Event Scheduler: Loaded 0 events
170314 10:53:24 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
170314 10:53:25 [Note] /usr/libexec/mysqld: Normal shutdown

170314 10:53:25 [Note] Event Scheduler: Purging the queue. 0 events
170314 10:53:25  InnoDB: Starting shutdown...
170314 10:53:29  InnoDB: Shutdown completed; log sequence number 0 44233
170314 10:53:29 [Note] /usr/libexec/mysqld: Shutdown complete

170314 10:53:29 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
170314 10:53:30 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
170314 10:53:30  InnoDB: Initializing buffer pool, size = 8.0M
170314 10:53:30  InnoDB: Completed initialization of buffer pool
170314 10:53:30  InnoDB: Started; log sequence number 0 44233
170314 10:53:30 [Note] Event Scheduler: Loaded 0 events
170314 10:53:30 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
170314 12:02:38 [Note] /usr/libexec/mysqld: Normal shutdown

170314 12:02:38 [Note] Event Scheduler: Purging the queue. 0 events
170314 12:02:38  InnoDB: Starting shutdown...
170314 12:02:39  InnoDB: Shutdown completed; log sequence number 0 44233
170314 12:02:39 [Note] /usr/libexec/mysqld: Shutdown complete

170314 12:02:39 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
170314 12:02:40 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
170314 12:02:40  InnoDB: Initializing buffer pool, size = 8.0M
170314 12:02:40  InnoDB: Completed initialization of buffer pool
170314 12:02:40  InnoDB: Started; log sequence number 0 44233
170314 12:02:40 [Note] Event Scheduler: Loaded 0 events
170314 12:02:40 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
170314 12:02:41 [Note] /usr/libexec/mysqld: Normal shutdown

170314 12:02:41 [Note] Event Scheduler: Purging the queue. 0 events
170314 12:02:41  InnoDB: Starting shutdown...
170314 12:02:45  InnoDB: Shutdown completed; log sequence number 0 44233
170314 12:02:45 [Note] /usr/libexec/mysqld: Shutdown complete

170314 12:02:45 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
170314 12:02:46 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
170314 12:02:46  InnoDB: Initializing buffer pool, size = 8.0M
170314 12:02:46  InnoDB: Completed initialization of buffer pool
170314 12:02:46  InnoDB: Started; log sequence number 0 44233
170314 12:02:46 [Note] Event Scheduler: Loaded 0 events
170314 12:02:46 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
170314 12:02:47 [Note] /usr/libexec/mysqld: Normal shutdown

170314 12:02:47 [Note] Event Scheduler: Purging the queue. 0 events
170314 12:02:47  InnoDB: Starting shutdown...
170314 12:02:51  InnoDB: Shutdown completed; log sequence number 0 44233
170314 12:02:51 [Note] /usr/libexec/mysqld: Shutdown complete

170314 12:02:51 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
170314 12:02:52 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
170314 12:02:52  InnoDB: Initializing buffer pool, size = 8.0M
170314 12:02:52  InnoDB: Completed initialization of buffer pool
170314 12:02:52  InnoDB: Started; log sequence number 0 44233
170314 12:02:52 [Note] Event Scheduler: Loaded 0 events
170314 12:02:52 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
170314 12:20:21 [Note] /usr/libexec/mysqld: Normal shutdown

170314 12:20:21 [Note] Event Scheduler: Purging the queue. 0 events
170314 12:20:21  InnoDB: Starting shutdown...
170314 12:20:23  InnoDB: Shutdown completed; log sequence number 0 44233
170314 12:20:23 [Note] /usr/libexec/mysqld: Shutdown complete

170314 12:20:23 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
170314 12:20:23 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
170314 12:20:23  InnoDB: Initializing buffer pool, size = 8.0M
170314 12:20:23  InnoDB: Completed initialization of buffer pool
170314 12:20:23  InnoDB: Started; log sequence number 0 44233
170314 12:20:23 [Note] Event Scheduler: Loaded 0 events
170314 12:20:23 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
170314 12:20:25 [Note] /usr/libexec/mysqld: Normal shutdown

170314 12:20:25 [Note] Event Scheduler: Purging the queue. 0 events
170314 12:20:25  InnoDB: Starting shutdown...
170314 12:20:29  InnoDB: Shutdown completed; log sequence number 0 44233
170314 12:20:29 [Note] /usr/libexec/mysqld: Shutdown complete

170314 12:20:29 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
170314 12:20:30 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
170314 12:20:30  InnoDB: Initializing buffer pool, size = 8.0M
170314 12:20:30  InnoDB: Completed initialization of buffer pool
170314 12:20:30  InnoDB: Started; log sequence number 0 44233
170314 12:20:30 [Note] Event Scheduler: Loaded 0 events
170314 12:20:30 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
170314 12:20:31 [Note] /usr/libexec/mysqld: Normal shutdown

170314 12:20:31 [Note] Event Scheduler: Purging the queue. 0 events
170314 12:20:31  InnoDB: Starting shutdown...
170314 12:20:35  InnoDB: Shutdown completed; log sequence number 0 44233
170314 12:20:35 [Note] /usr/libexec/mysqld: Shutdown complete

170314 12:20:35 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
170314 12:20:36 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
170314 12:20:36  InnoDB: Initializing buffer pool, size = 8.0M
170314 12:20:36  InnoDB: Completed initialization of buffer pool
170314 12:20:36  InnoDB: Started; log sequence number 0 44233
170314 12:20:36 [Note] Event Scheduler: Loaded 0 events
170314 12:20:36 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
170314 12:50:57 [Note] /usr/libexec/mysqld: Normal shutdown

170314 12:50:57 [Note] Event Scheduler: Purging the queue. 0 events
170314 12:50:59  InnoDB: Starting shutdown...
170314 12:51:03  InnoDB: Shutdown completed; log sequence number 0 44233
170314 12:51:03 [Note] /usr/libexec/mysqld: Shutdown complete

170314 12:51:03 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
170314 12:51:04 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
170314 12:51:04  InnoDB: Initializing buffer pool, size = 8.0M
170314 12:51:04  InnoDB: Completed initialization of buffer pool
170314 12:51:05  InnoDB: Started; log sequence number 0 44233
170314 12:51:05 [Note] Event Scheduler: Loaded 0 events
170314 12:51:05 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
170314 12:51:06 [Note] /usr/libexec/mysqld: Normal shutdown

170314 12:51:06 [Note] Event Scheduler: Purging the queue. 0 events
170314 12:51:06  InnoDB: Starting shutdown...
170314 12:51:10  InnoDB: Shutdown completed; log sequence number 0 44233
170314 12:51:10 [Note] /usr/libexec/mysqld: Shutdown complete

170314 12:51:10 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
170314 12:51:11 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
170314 12:51:11  InnoDB: Initializing buffer pool, size = 8.0M
170314 12:51:11  InnoDB: Completed initialization of buffer pool
170314 12:51:11  InnoDB: Started; log sequence number 0 44233
170314 12:51:11 [Note] Event Scheduler: Loaded 0 events
170314 12:51:11 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
170314 12:51:12 [Note] /usr/libexec/mysqld: Normal shutdown

170314 12:51:12 [Note] Event Scheduler: Purging the queue. 0 events
170314 12:51:12  InnoDB: Starting shutdown...
170314 12:51:16  InnoDB: Shutdown completed; log sequence number 0 44233
170314 12:51:16 [Note] /usr/libexec/mysqld: Shutdown complete

170314 12:51:16 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
170314 12:51:17 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
170314 12:51:17  InnoDB: Initializing buffer pool, size = 8.0M
170314 12:51:17  InnoDB: Completed initialization of buffer pool
170314 12:51:17  InnoDB: Started; log sequence number 0 44233
170314 12:51:17 [Note] Event Scheduler: Loaded 0 events
170314 12:51:17 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
170314 12:57:24 [Note] /usr/libexec/mysqld: Normal shutdown

170314 12:57:24 [Note] Event Scheduler: Purging the queue. 0 events
170314 12:57:24  InnoDB: Starting shutdown...
170314 12:57:28  InnoDB: Shutdown completed; log sequence number 0 44233
170314 12:57:28 [Note] /usr/libexec/mysqld: Shutdown complete

170314 12:57:28 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
170314 12:57:52 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
170314 12:57:52  InnoDB: Initializing buffer pool, size = 8.0M
170314 12:57:52  InnoDB: Completed initialization of buffer pool
170314 12:57:52  InnoDB: Started; log sequence number 0 44233
170314 12:57:52 [Note] Event Scheduler: Loaded 0 events
170314 12:57:52 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
170314 13:26:10 [Note] /usr/libexec/mysqld: Normal shutdown

170314 13:26:10 [Note] Event Scheduler: Purging the queue. 0 events
170314 13:26:10  InnoDB: Starting shutdown...
170314 13:26:14  InnoDB: Shutdown completed; log sequence number 0 44233
170314 13:26:14 [Note] /usr/libexec/mysqld: Shutdown complete

170314 13:26:14 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
170314 13:54:21 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
170314 13:54:21  InnoDB: Initializing buffer pool, size = 8.0M
170314 13:54:21  InnoDB: Completed initialization of buffer pool
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
170314 13:54:21  InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
170314 13:54:21  InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
170314 13:54:21  InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
170314 13:54:21  InnoDB: Started; log sequence number 0 0
170314 13:54:21 [Note] Event Scheduler: Loaded 0 events
170314 13:54:21 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
170314 13:54:22 [Note] /usr/libexec/mysqld: Normal shutdown

170314 13:54:22 [Note] Event Scheduler: Purging the queue. 0 events
170314 13:54:22  InnoDB: Starting shutdown...
170314 13:54:26  InnoDB: Shutdown completed; log sequence number 0 44233
170314 13:54:26 [Note] /usr/libexec/mysqld: Shutdown complete

170314 13:54:26 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
170314 13:54:27 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
170314 13:54:27  InnoDB: Initializing buffer pool, size = 8.0M
170314 13:54:27  InnoDB: Completed initialization of buffer pool
170314 13:54:27  InnoDB: Started; log sequence number 0 44233
170314 13:54:27 [Note] Event Scheduler: Loaded 0 events
170314 13:54:27 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
170314 16:46:46 [Note] /usr/libexec/mysqld: Normal shutdown

170314 16:46:46 [Note] Event Scheduler: Purging the queue. 0 events
170314 16:46:48  InnoDB: Starting shutdown...
170314 16:46:53  InnoDB: Shutdown completed; log sequence number 0 44233
170314 16:46:53 [Note] /usr/libexec/mysqld: Shutdown complete

170314 16:46:53 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
170314 16:47:54 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
170314 16:47:54  InnoDB: Initializing buffer pool, size = 8.0M
170314 16:47:54  InnoDB: Completed initialization of buffer pool
170314 16:47:54  InnoDB: Started; log sequence number 0 44233
170314 16:47:54 [Note] Event Scheduler: Loaded 0 events
170314 16:47:54 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
170314 17:29:12 [Note] /usr/libexec/mysqld: Normal shutdown

170314 17:29:12 [Note] Event Scheduler: Purging the queue. 0 events
170314 17:29:14  InnoDB: Starting shutdown...
170314 17:29:16  InnoDB: Shutdown completed; log sequence number 0 44233
170314 17:29:16 [Note] /usr/libexec/mysqld: Shutdown complete

170314 17:29:16 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
170314 17:30:51 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
170314 17:30:51  InnoDB: Initializing buffer pool, size = 8.0M
170314 17:30:51  InnoDB: Completed initialization of buffer pool
170314 17:30:51  InnoDB: Started; log sequence number 0 44233
170314 17:30:51 [Note] Event Scheduler: Loaded 0 events
170314 17:30:51 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
170315 11:32:51 [Note] /usr/libexec/mysqld: Normal shutdown

170315 11:32:51 [Note] Event Scheduler: Purging the queue. 0 events
170315 11:32:53  InnoDB: Starting shutdown...
170315 11:32:54  InnoDB: Shutdown completed; log sequence number 0 44233
170315 11:32:54 [Note] /usr/libexec/mysqld: Shutdown complete

170315 11:32:54 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
170315 11:32:55 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
170315 11:32:55  InnoDB: Initializing buffer pool, size = 8.0M
170315 11:32:55  InnoDB: Completed initialization of buffer pool
170315 11:32:56  InnoDB: Started; log sequence number 0 44233
170315 11:32:56 [Note] Event Scheduler: Loaded 0 events
170315 11:32:56 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
170315 11:32:57 [Note] /usr/libexec/mysqld: Normal shutdown

170315 11:32:57 [Note] Event Scheduler: Purging the queue. 0 events
170315 11:32:59  InnoDB: Starting shutdown...
170315 11:33:01  InnoDB: Shutdown completed; log sequence number 0 44233
170315 11:33:01 [Note] /usr/libexec/mysqld: Shutdown complete

170315 11:33:01 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
170315 11:33:02 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
170315 11:33:02  InnoDB: Initializing buffer pool, size = 8.0M
170315 11:33:02  InnoDB: Completed initialization of buffer pool
170315 11:33:02  InnoDB: Started; log sequence number 0 44233
170315 11:33:02 [Note] Event Scheduler: Loaded 0 events
170315 11:33:02 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
170315 11:33:03 [Note] /usr/libexec/mysqld: Normal shutdown

170315 11:33:03 [Note] Event Scheduler: Purging the queue. 0 events
170315 11:33:03  InnoDB: Starting shutdown...
170315 11:33:07  InnoDB: Shutdown completed; log sequence number 0 44233
170315 11:33:07 [Note] /usr/libexec/mysqld: Shutdown complete

170315 11:33:07 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
170315 11:33:08 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
170315 11:33:08  InnoDB: Initializing buffer pool, size = 8.0M
170315 11:33:08  InnoDB: Completed initialization of buffer pool
170315 11:33:08  InnoDB: Started; log sequence number 0 44233
170315 11:33:08 [Note] Event Scheduler: Loaded 0 events
170315 11:33:08 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
170315 13:27:27 [Note] /usr/libexec/mysqld: Normal shutdown

170315 13:27:27 [Note] Event Scheduler: Purging the queue. 0 events
170315 13:27:29  InnoDB: Starting shutdown...
170315 13:27:30  InnoDB: Shutdown completed; log sequence number 0 44233
170315 13:27:30 [Note] /usr/libexec/mysqld: Shutdown complete

170315 13:27:30 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
170315 13:28:22 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
170315 13:28:22  InnoDB: Initializing buffer pool, size = 8.0M
170315 13:28:22  InnoDB: Completed initialization of buffer pool
170315 13:28:22  InnoDB: Started; log sequence number 0 44233
170315 13:28:22 [Note] Event Scheduler: Loaded 0 events
170315 13:28:22 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
170315 13:39:35 [Note] /usr/libexec/mysqld: Normal shutdown

170315 13:39:35 [Note] Event Scheduler: Purging the queue. 0 events
170315 13:39:37  InnoDB: Starting shutdown...
170315 13:39:39  InnoDB: Shutdown completed; log sequence number 0 44233
170315 13:39:39 [Note] /usr/libexec/mysqld: Shutdown complete

170315 13:39:39 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
170315 13:47:21 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
170315 13:47:21  InnoDB: Initializing buffer pool, size = 8.0M
170315 13:47:21  InnoDB: Completed initialization of buffer pool
170315 13:47:21  InnoDB: Started; log sequence number 0 44233
170315 13:47:21 [Note] Event Scheduler: Loaded 0 events
170315 13:47:21 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
170315 13:59:04 [Note] /usr/libexec/mysqld: Normal shutdown

170315 13:59:04 [Note] Event Scheduler: Purging the queue. 0 events
170315 13:59:06  InnoDB: Starting shutdown...
170315 13:59:07  InnoDB: Shutdown completed; log sequence number 0 44233
170315 13:59:07 [Note] /usr/libexec/mysqld: Shutdown complete

170315 13:59:07 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
170315 14:03:06 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
170315 14:03:06  InnoDB: Initializing buffer pool, size = 8.0M
170315 14:03:06  InnoDB: Completed initialization of buffer pool
170315 14:03:06  InnoDB: Started; log sequence number 0 44233
170315 14:03:06 [Note] Event Scheduler: Loaded 0 events
170315 14:03:06 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
we are using the RHEL6.8 santiago version.

Can you please help on - why the DB back end error coming ? Added hosts are not visible in the HOST section as well. Please find the attached snapshot.

Thank you,
Nag
You do not have the required permissions to view the files attached to this post.
Last edited by tmcdonald on Wed Mar 15, 2017 2:10 pm, edited 1 time in total.
Reason: Please use [code][/code] tags around long output
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Database Backend error: System Status NagiosXI

Post by mcapra »

Can you share the output of the following command executed from the CLI of your Nagios XI machine:

Code: Select all

service ndo2db restart
And see if that gives a green checkmark for the status? If it doesn't, can you run the following commands:

Code: Select all

sed -i 's/debug_level=0/debug_level=1/' /usr/local/nagios/etc/ndo2db.cfg
service ndo2db restart
Then, after 5-10 minutes, share the output of the following command:

Code: Select all

tail -n 100 /usr/local/nagios/var/ndo2db.debug
Former Nagios employee
https://www.mcapra.com/
Nags007
Posts: 58
Joined: Wed Mar 08, 2017 12:32 pm

Re: Database Backend error: System Status NagiosXI

Post by Nags007 »

[root@var]# service ndo2db restart

Stopping ndo2db: done.
Starting ndo2db: done.

[root@var]# service ndo2db status
ndo2db (pid 55059) is running...

[root@var]# tail -n 100 /usr/local/nagios/var/ndo2db.debug
tail: cannot open `/usr/local/nagios/var/ndo2db.debug' for reading: No such file or directory

/usr/local/nagios/var
=====================
[root@var]# ll

total 120
drwxrwxr-x 2 nagios nagios 4096 Mar 14 23:59 archives
-rw-r--r-- 1 nagios nagios 34 Mar 15 16:13 nagios.configtest
-rw-r--r-- 1 nagios nagios 6 Mar 15 16:13 nagios.lock
-rw-r--r-- 1 nagios nagios 20702 Mar 15 16:13 nagios.log
-rw-r--r-- 1 nagios nagios 6 Mar 15 16:01 ndo2db.lock
srwxr-xr-x 1 nagios nagios 0 Mar 15 16:01 ndo.sock
-rw-r--r-- 1 nagios nagios 1489 Mar 15 13:14 npcd.log
-rw-r--r-- 1 nagios nagios 12647 Mar 15 16:13 objects.cache
-rw-r--r-- 1 nagios nagios 12647 Mar 15 16:13 objects.precache
-rw------- 1 nagios nagios 13052 Mar 15 16:13 retention.dat
drwxrwsr-x 2 nagios nagcmd 4096 Mar 15 16:13 rw
drwxr-xr-x 5 nagios nagios 4096 Mar 8 18:38 spool
drwxr-x--- 2 nagios nagios 4096 Mar 8 19:06 stats
-rw-rw-r-- 1 nagios nagios 13476 Mar 15 16:17 status.dat

=====================================================
[root@var]# cat ndo2db.lock
55059
============================================

[root@var]# find / -iname ndo2db.cfg

/tmp/nagiosxi/subcomponents/ndoutils/mods/cfg/ndo2db.cfg
/tmp/nagiosxi5.4/nagiosxi/subcomponents/ndoutils/mods/cfg/ndo2db.cfg
/apps/nagiosxi/subcomponents/ndoutils/mods/cfg/ndo2db.cfg
/usr/local/nagios/etc/ndo2db.cfg

==============================================

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

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> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| nagios |
| test |
+--------------------+
3 rows in set (0.00 sec)

mysql> use nagios;
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> show tables;
+----------------------------------------+
| Tables_in_nagios |
+----------------------------------------+
| nagios_acknowledgements |
| nagios_commands |
| nagios_commenthistory |
| nagios_comments |
| nagios_configfiles |
| nagios_configfilevariables |
| nagios_conninfo |
| nagios_contact_addresses |
| nagios_contact_notificationcommands |
| nagios_contactgroup_members |
| nagios_contactgroups |
| nagios_contactnotificationmethods |
| nagios_contactnotifications |
| nagios_contacts |
| nagios_contactstatus |
| nagios_customvariables |
| nagios_customvariablestatus |
| nagios_dbversion |
| nagios_downtimehistory |
| nagios_eventhandlers |
| nagios_externalcommands |
| nagios_flappinghistory |
| nagios_host_contactgroups |
| nagios_host_contacts |
| nagios_host_parenthosts |
| nagios_hostchecks |
| nagios_hostdependencies |
| nagios_hostescalation_contactgroups |
| nagios_hostescalation_contacts |
| nagios_hostescalations |
| nagios_hostgroup_members |
| nagios_hostgroups |
| nagios_hosts |
| nagios_hoststatus |
| nagios_instances |
| nagios_logentries |
| nagios_notifications |
| nagios_objects |
| nagios_processevents |
| nagios_programstatus |
| nagios_runtimevariables |
| nagios_scheduleddowntime |
| nagios_service_contactgroups |
| nagios_service_contacts |
| nagios_service_parentservices |
| nagios_servicechecks |
| nagios_servicedependencies |
| nagios_serviceescalation_contactgroups |
| nagios_serviceescalation_contacts |
| nagios_serviceescalations |
| nagios_servicegroup_members |
| nagios_servicegroups |
| nagios_services |
| nagios_servicestatus |
| nagios_statehistory |
| nagios_systemcommands |
| nagios_timedeventqueue |
| nagios_timedevents |
| nagios_timeperiod_timeranges |
| nagios_timeperiods |
+----------------------------------------+
60 rows in set (0.00 sec)

================================


`/usr/local/nagios/var/ndo2db.debug' for reading: No such file or directory

Thank you,
Last edited by Nags007 on Wed Mar 15, 2017 4:21 pm, edited 1 time in total.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Database Backend error: System Status NagiosXI

Post by mcapra »

Can you share the output of the following commands executed from the CLI of your Nagios XI machine:

Code: Select all

service ndo2db status
ps aux | grep ndo
ps aux | grep php
timeout 2 php -r "include('/usr/local/nagiosxi/cron/sysstat.php'); get_db_backend_status();"
timeout 2 php -r "include('/usr/local/nagiosxi/cron/sysstat.php');var_dump(get_backend_xml_data(array('cmd' => 'getconninfo','orderby' => 'last_checkin_time:d','records' => '1')));"
echo "SELECT * FROM xi_sysstat WHERE 1;" | mysql -uroot -pnagiosxi nagiosxi
Former Nagios employee
https://www.mcapra.com/
Nags007
Posts: 58
Joined: Wed Mar 08, 2017 12:32 pm

Re: Database Backend error: System Status NagiosXI

Post by Nags007 »

Code: Select all

[root@ var]# service ndo2db status
ndo2db (pid 55059) is running...
==============================

[root@var]# ps aux | grep ndo
root      8943  0.0  0.0 158164  3816 pts/1    S+   17:10   0:00 mysql -u ndoutils -p
root     12375  0.0  0.0 103324   848 pts/0    S+   17:22   0:00 grep ndo
nagios   55059  0.0  0.0  49844   636 ?        Ss   16:01   0:00 /usr/local/nagios/bin/ndo2db -c /usr/local/nagios/etc/ndo2db.cfg
============================================================================

[root@var]# ps aux | grep php
nagios   12229  0.0  0.0 106112  1136 ?        Ss   17:22   0:00 /bin/sh -c /usr/bin/php -q /usr/local/nagiosxi/cron/eventman.php > /usr/local/n              agiosxi/var/eventman.log 2>&1
nagios   12230  0.0  0.0 106112  1140 ?        Ss   17:22   0:00 /bin/sh -c /usr/bin/php -q /usr/local/nagiosxi/cron/cmdsubsys.php > /usr/local/              nagiosxi/var/cmdsubsys.log 2>&1
nagios   12232  0.0  0.0 106112  1140 ?        Ss   17:22   0:00 /bin/sh -c /usr/bin/php -q /usr/local/nagiosxi/cron/event_handler.php > /usr/lo              cal/nagiosxi/var/event_handler.log 2>&1
nagios   12233  0.0  0.0 106112  1140 ?        Ss   17:22   0:00 /bin/sh -c /usr/bin/php -q /usr/local/nagiosxi/cron/feedproc.php > /usr/local/n              agiosxi/var/feedproc.log 2>&1
nagios   12234  0.0  0.0 106112  1144 ?        Ss   17:22   0:00 /bin/sh -c /usr/bin/php -q /usr/local/nagiosxi/cron/perfdataproc.php > /usr/loc              al/nagiosxi/var/perfdataproc.log 2>&1
nagios   12236  0.5  0.1 328872 31108 ?        S    17:22   0:00 /usr/bin/php -q /usr/local/nagiosxi/cron/eventman.php
nagios   12237  0.4  0.1 319640 21808 ?        S    17:22   0:00 /usr/bin/php -q /usr/local/nagiosxi/cron/cmdsubsys.php
nagios   12240  0.0  0.0 106112  1136 ?        Ss   17:22   0:00 /bin/sh -c /usr/bin/php -q /usr/local/nagiosxi/cron/sysstat.php > /usr/local/na              giosxi/var/sysstat.log 2>&1
nagios   12241  0.4  0.1 319564 21600 ?        S    17:22   0:00 /usr/bin/php -q /usr/local/nagiosxi/cron/event_handler.php
nagios   12242  0.3  0.1 319440 21536 ?        S    17:22   0:00 /usr/bin/php -q /usr/local/nagiosxi/cron/feedproc.php
nagios   12243  0.3  0.1 319448 21636 ?        S    17:22   0:00 /usr/bin/php -q /usr/local/nagiosxi/cron/perfdataproc.php
nagios   12244  0.3  0.1 319456 22096 ?        S    17:22   0:00 /usr/bin/php -q /usr/local/nagiosxi/cron/sysstat.php
root     12421  0.0  0.0 103320   840 pts/0    S+   17:22   0:00 grep php

============================================================================
[root@var]# timeout 2 php -r "include('/usr/local/nagiosxi/cron/sysstat.php'); get_db_backend_status();"
PHP Warning:  Module 'SourceGuardian' already loaded in Unknown on line 0
#!/bin/env php -q
DB BACKEND:
Array
(
)
CMDLINE=/etc/init.d/nagios status
nagios (pid 5733) is running...
OUTPUT=nagios (pid 5733) is running...
RETURNCODE=0
CMDLINE=/etc/init.d/npcd status
NPCD running (pid 5212).
OUTPUT=NPCD running (pid 5212).
RETURNCODE=0
CMDLINE=/etc/init.d/ndo2db status
ndo2db (pid 55059) is running...
OUTPUT=ndo2db (pid 55059) is running...
RETURNCODE=0
DAEMONS:
Array
(
    [nagioscore] => Array
        (
            [daemon] => nagios
            [output] => nagios (pid 5733) is running...
            [return_code] => 0
            [status] => 0
        )

    [pnp] => Array
        (
            [daemon] => npcd
            [output] => NPCD running (pid 5212).
            [return_code] => 0
            [status] => 0
        )

    [ndoutils] => Array
        (
            [daemon] => ndo2db
            [output] => ndo2db (pid 55059) is running...
            [return_code] => 0
            [status] => 0
        )

)
CORE STATS:
Array
(
    [activehostchecks] => Array
        (
            [1min] => 0
            [5min] => 0
            [15min] => 0
        )

    [passivehostchecks] => Array
        (
            [1min] => 0
            [5min] => 0
            [15min] => 0
        )

    [activeservicechecks] => Array
        (
            [1min] => 0
            [5min] => 0
            [15min] => 0
        )

    [passiveservicechecks] => Array
        (
            [1min] => 0
            [5min] => 0
            [15min] => 0
        )

    [activehostcheckperf] => Array
        (
            [min_latency] =>
            [max_latency] =>
            [avg_latency] =>
            [min_execution_time] =>
            [max_execution_time] =>
            [avg_execution_time] =>
        )

    [activeservicecheckperf] => Array
        (
            [min_latency] =>
            [max_latency] =>
            [avg_latency] =>
            [min_execution_time] =>
            [max_execution_time] =>
            [avg_execution_time] =>
        )

)
LOAD:
Array
(
    [load1] => 0.10
    [load5] => 0.04
    [load15] => 0.04
)
MEMORY:
Array
(
    [total] => 15943
    [used] => 5113
    [free] => 10829
    [shared] => 0
    [buffers] => 391
    [cached] => 3204
)
SWAP:
Array
(
    [total] => 2047
    [used] => 0
    [free] => 2047
)

================================================================================
[root@var]# timeout 2 php -r "include('/usr/local/nagiosxi/cron/sysstat.php');var_dump(get_backend_xml_data(array('cmd' => 'getcon              ninfo','orderby' => 'last_checkin_time:d','records' => '1')));"


PHP Warning:  Module 'SourceGuardian' already loaded in Unknown on line 0
#!/bin/env php -q
DB BACKEND:
Array
(
)
CMDLINE=/etc/init.d/nagios status
nagios (pid 5733) is running...
OUTPUT=nagios (pid 5733) is running...
RETURNCODE=0
CMDLINE=/etc/init.d/npcd status
NPCD running (pid 5212).
OUTPUT=NPCD running (pid 5212).
RETURNCODE=0
CMDLINE=/etc/init.d/ndo2db status
ndo2db (pid 55059) is running...
OUTPUT=ndo2db (pid 55059) is running...
RETURNCODE=0
DAEMONS:
Array
(
    [nagioscore] => Array
        (
            [daemon] => nagios
            [output] => nagios (pid 5733) is running...
            [return_code] => 0
            [status] => 0
        )

    [pnp] => Array
        (
            [daemon] => npcd
            [output] => NPCD running (pid 5212).
            [return_code] => 0
            [status] => 0
        )

    [ndoutils] => Array
        (
            [daemon] => ndo2db
            [output] => ndo2db (pid 55059) is running...
            [return_code] => 0
            [status] => 0
        )

)
CORE STATS:
Array
(
    [activehostchecks] => Array
        (
            [1min] => 0
            [5min] => 0
            [15min] => 0
        )

    [passivehostchecks] => Array
        (
            [1min] => 0
            [5min] => 0
            [15min] => 0
        )

    [activeservicechecks] => Array
        (
            [1min] => 0
            [5min] => 0
            [15min] => 0
        )

    [passiveservicechecks] => Array
        (
            [1min] => 0
            [5min] => 0
            [15min] => 0
        )

    [activehostcheckperf] => Array
        (
            [min_latency] =>
            [max_latency] =>
            [avg_latency] =>
            [min_execution_time] =>
            [max_execution_time] =>
            [avg_execution_time] =>
        )

    [activeservicecheckperf] => Array
        (
            [min_latency] =>
            [max_latency] =>
            [avg_latency] =>
            [min_execution_time] =>
            [max_execution_time] =>
            [avg_execution_time] =>
        )

)
LOAD:
Array
(
    [load1] => 0.15
    [load5] => 0.06
    [load15] => 0.04
)
MEMORY:
Array
(
    [total] => 15943
    [used] => 5112
    [free] => 10830
    [shared] => 0
    [buffers] => 391
    [cached] => 3204
)
SWAP:
Array
(
    [total] => 2047
    [used] => 0
    [free] => 2047
)

================================================================================
[root@var]# echo "SELECT * FROM xi_sysstat WHERE 1;" | mysql -uroot -pnagiosxi nagiosxi


sysstat_id      metric  value   update_time
1       dbmaint a:1:{s:10:"last_check";i:1489612801;}   2017-03-15 17:20:01
2       cleaner a:1:{s:10:"last_check";i:1489612981;}   2017-03-15 17:23:01
3       nom     a:1:{s:10:"last_check";i:1489612981;}   2017-03-15 17:23:01
4       reportengine    a:1:{s:10:"last_check";i:1489612981;}   2017-03-15 17:23:01
5       dbbackend       a:0:{}  2017-03-15 17:23:02
6       daemons a:3:{s:10:"nagioscore";a:4:{s:6:"daemon";s:6:"nagios";s:6:"output";s:31:"nagios (pid 5733) is running...";s:11:"return_code";i:0              ;s:6:"status";i:0;}s:3:"pnp";a:4:{s:6:"daemon";s:4:"npcd";s:6:"output";s:24:"NPCD running (pid 5212).";s:11:"return_code";i:0;s:6:"status";i:0;}              s:8:"ndoutils";a:4:{s:6:"daemon";s:6:"ndo2db";s:6:"output";s:32:"ndo2db (pid 55059) is running...";s:11:"return_code";i:0;s:6:"status";i:0;}}  2              017-03-15 17:23:02
7       nagioscore      a:6:{s:16:"activehostchecks";a:3:{s:4:"1min";s:1:"0";s:4:"5min";s:1:"0";s:5:"15min";s:1:"0";}s:17:"passivehostchecks";a:              3:{s:4:"1min";s:1:"0";s:4:"5min";s:1:"0";s:5:"15min";s:1:"0";}s:19:"activeservicechecks";a:3:{s:4:"1min";s:1:"0";s:4:"5min";s:1:"0";s:5:"15min";              s:1:"0";}s:20:"passiveservicechecks";a:3:{s:4:"1min";s:1:"0";s:4:"5min";s:1:"0";s:5:"15min";s:1:"0";}s:19:"activehostcheckperf";a:6:{s:11:"min_l              atency";N;s:11:"max_latency";N;s:11:"avg_latency";N;s:18:"min_execution_time";N;s:18:"max_execution_time";N;s:18:"avg_execution_time";N;}s:22:"a              ctiveservicecheckperf";a:6:{s:11:"min_latency";N;s:11:"max_latency";N;s:11:"avg_latency";N;s:18:"min_execution_time";N;s:18:"max_execution_time"              ;N;s:18:"avg_execution_time";N;}}       2017-03-15 17:23:02
8       load    a:3:{s:5:"load1";s:4:"0.15";s:5:"load5";s:4:"0.06";s:6:"load15";s:4:"0.04";}    2017-03-15 17:23:02
9       memory  a:6:{s:5:"total";s:5:"15943";s:4:"used";s:4:"5112";s:4:"free";s:5:"10830";s:6:"shared";s:1:"0";s:7:"buffers";s:3:"391";s:6:"cach              ed";s:4:"3204";}        2017-03-15 17:23:02
10      swap    a:3:{s:5:"total";s:4:"2047";s:4:"used";s:1:"0";s:4:"free";s:4:"2047";}  2017-03-15 17:23:02
11      iostat  a:6:{s:4:"user";s:4:"3.05";s:4:"nice";s:4:"0.00";s:6:"system";s:4:"0.60";s:6:"iowait";s:4:"0.00";s:5:"steal";s:4:"0.00";s:4:"idl              e";s:5:"96.35";}        2017-03-15 17:23:06
12      sysstat a:1:{s:10:"last_check";i:1489612981;}   2017-03-15 17:23:06
13      cmdsubsys       a:1:{s:10:"last_check";i:1489612994;}   2017-03-15 17:23:14
14      feedprocessor   a:1:{s:10:"last_check";i:1489612981;}   2017-03-15 17:23:01
15      eventman        a:1:{s:10:"last_check";i:1489612993;}   2017-03-15 17:23:13
16      perfdataprocessor       a:1:{s:10:"last_check";i:1489612991;}   2017-03-15 17:23:11
17      deadpool_reaper a:1:{s:10:"last_check";i:1489612801;}   2017-03-15 17:20:01
==================================================================================
Thank you,
Last edited by dwhitfield on Wed Mar 15, 2017 8:35 pm, edited 1 time in total.
Reason: mi code blocks, es su code blocks
Nags007
Posts: 58
Joined: Wed Mar 08, 2017 12:32 pm

Re: Database Backend error: System Status NagiosXI

Post by Nags007 »

Please find the output for your commands , i have pasted, there.

Thank you,
Nag
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Database Backend error: System Status NagiosXI

Post by mcapra »

What version of Nagios XI are you using? There was a bugfix that addressed this specific behavior in 5.4.1:
https://assets.nagios.com/downloads/nag ... NGES-5.TXT

Code: Select all

- Fixed issue where some systems would show ndo2db as not running in the GUI even though the daemon is running [TPS#10636] -JO
If you're using 5.4.1 or later, can you post the contents of your /etc/sudoers file?
Former Nagios employee
https://www.mcapra.com/
Nags007
Posts: 58
Joined: Wed Mar 08, 2017 12:32 pm

Re: Database Backend error: System Status NagiosXI

Post by Nags007 »

Thanks for your reply.

we used xi-5.4.2.tar.gz for installation.

cat /etc/sudoers
=====================
User_Alias NAGIOSXI=nagios
User_Alias NAGIOSXIWEB=apache
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios start
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios stop
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios restart
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios reload
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios status
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios checkconfig
NAGIOSXI ALL = NOPASSWD:/etc/init.d/ndo2db start
NAGIOSXI ALL = NOPASSWD:/etc/init.d/ndo2db stop
NAGIOSXI ALL = NOPASSWD:/etc/init.d/ndo2db restart
NAGIOSXI ALL = NOPASSWD:/etc/init.d/ndo2db reload
NAGIOSXI ALL = NOPASSWD:/etc/init.d/ndo2db status
NAGIOSXI ALL = NOPASSWD:/etc/init.d/npcd start
NAGIOSXI ALL = NOPASSWD:/etc/init.d/npcd stop
NAGIOSXI ALL = NOPASSWD:/etc/init.d/npcd restart
NAGIOSXI ALL = NOPASSWD:/etc/init.d/npcd reload
NAGIOSXI ALL = NOPASSWD:/etc/init.d/npcd status
NAGIOSXI ALL = NOPASSWD:/usr/bin/php /usr/local/nagiosxi/html/includes/components/autodiscovery/scripts/autodiscover_new.php *
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/html/includes/components/profile/getprofile.sh
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/scripts/upgrade_to_latest.sh
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/scripts/change_timezone.sh
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/scripts/manage_services.sh *
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/scripts/reset_config_perms.sh
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/scripts/backup_xi.sh *
NAGIOSXIWEB ALL = NOPASSWD:/usr/bin/tail -100 /var/log/messages
NAGIOSXIWEB ALL = NOPASSWD:/usr/bin/tail -100 /var/log/httpd/error_log
NAGIOSXIWEB ALL = NOPASSWD:/usr/bin/tail -100 /var/log/mysqld.log
NAGIOSXIWEB ALL = NOPASSWD:/usr/bin/php /usr/local/nagiosxi/html/includes/components/autodiscovery/scripts/autodiscover_new.php *
NAGIOSXIWEB ALL = NOPASSWD:/usr/local/nagiosxi/html/includes/components/profile/getprofile.sh
NAGIOSXIWEB ALL = NOPASSWD:/etc/init.d/snmptt restart
NAGIOSXIWEB ALL = NOPASSWD:/usr/local/nagiosxi/scripts/repair_databases.sh
NAGIOSXIWEB ALL = NOPASSWD:/usr/local/nagiosxi/scripts/manage_services.sh *

Thank you,
Nag.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Database Backend error: System Status NagiosXI

Post by dwhitfield »

5.4.3 was released today. Can you see if upgrading kicks it into gear?
Nags007
Posts: 58
Joined: Wed Mar 08, 2017 12:32 pm

Re: Database Backend error: System Status NagiosXI

Post by Nags007 »

Thank you for your suggestion.

I am trying new version. 5.4.3.

Thanks,
Nag
Locked