Page 1 of 3

Nagios Problem After PHP Uninstallation

Posted: Wed Sep 06, 2017 4:57 am
by nms_system_support
Hello Sir,

Due to PHP errors during upgrade phase of Nagios, we uninstalled all php packages from our Linux server using rpm -e command and now Nagios is not working.

Can you please inform us which php packets are required for Nagios 5.3.3.3 ??

Currently we receive the below error message instead of the login screen:
Databse Error
A database connection error has been detected, please follow the repair prompt below. If the issue persists, please contact Nagios support.
Run the following from the CLI as root to attempt to repair the DB:

/usr/local/nagiosxi/scripts/repair_databases.sh

We have already executed multiple times the above script and it runs successfully.

We have the below linux machine :
Red Hat Enterprise Linux Server release 6.8 (Santiago)
Linux nagios-nms.wind.gr 2.6.32-642.11.1.el6.x86_64 #1 SMP Wed Oct 26 10:25:23 EDT 2016 x86_64 x86_64 x86_64 GNU/Linux

Thank you

Re: Nagios Problem After PHP Uninstallation

Posted: Wed Sep 06, 2017 7:14 am
by tacolover101
what PHP errors were you seeing? likely due to sourceguardian not agreeing on the version, or a dependency missing.

based on this (RHEL/CENT7) https://repo.nagios.com/nagiosxi-deps/7/ i think you could get by with regular php as well as these packages:

Code: Select all

[ ]	php-mcrypt-5.4.16-4.el7.x86_64.rpm	13-Sep-2016 10:49 	19K	 
[ ]	php-mssql-5.4.16-4.el7.x86_64.rpm	13-Sep-2016 10:49 	30K	 
[ ]	php-pear-HTML-Template-IT-1.3.0-2.el5.noarch.rpm	17-Jul-2015 13:23 	31K	 
[ ]	php-pecl-ssh2-0.12-1.el7.x86_64.rpm	13-Sep-2016 10:49 	33K	 
i don't have a working system XI, but rpm -qa | grep php* should work to list them all out, if you have another one that is valid currently.

Re: Nagios Problem After PHP Uninstallation

Posted: Wed Sep 06, 2017 7:23 am
by nms_system_support
Thanks for your reply.

I installed the PHP packages that you refered to as can be seen below:

[root@nagios-nms ~]# rpm -qa|grep php
php-common-5.3.3-49.el6.x86_64
php-mssql-5.3.3-5.el6.x86_64
php-pdo-5.3.3-49.el6.x86_64
php-pear-HTML-Template-IT-1.3.0-2.el5.noarch
php-mcrypt-5.3.3-5.el6.x86_64
php-pear-1.9.4-5.el6.noarch
php-cli-5.3.3-49.el6.x86_64
php-pecl-ssh2-0.11.0-7.el6.x86_64
[root@nagios-nms ~]#

However still when we try to reach the login page of Nagios we receive the below error:

Databse Error
A database connection error has been detected, please follow the repair prompt below. If the issue persists, please contact Nagios support.
Run the following from the CLI as root to attempt to repair the DB:

/usr/local/nagiosxi/scripts/repair_databases.sh


Of course we have already executed the 'repair_database.sh' script but the problem is not resolved and we cannot access Web portal of Nagios.

Thank you

Re: Nagios Problem After PHP Uninstallation

Posted: Wed Sep 06, 2017 8:47 am
by scottwilkerson
can you show the output of the following:

Code: Select all

tail -200 /var/log/mysqld.log

Re: Nagios Problem After PHP Uninstallation

Posted: Wed Sep 06, 2017 9:09 am
by nms_system_support
Hello,

below is the output

Code: Select all

[root@nagios-nms yum.repos.d]# tail -200 /var/log/mysqld.log
170906 13:14:28  InnoDB: Completed initialization of buffer pool
170906 13:14:28  InnoDB: Started; log sequence number 0 44233
170906 13:14:28 [Note] Event Scheduler: Loaded 0 events
170906 13:14:28 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
170906 12:12:53 [Note] /usr/libexec/mysqld: Normal shutdown

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

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

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

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

170906 12:19:37 [Note] Event Scheduler: Purging the queue. 0 events
170906 12:19:37  InnoDB: Starting shutdown...
170906 12:19:39  InnoDB: Shutdown completed; log sequence number 0 44243
170906 12:19:39 [Note] /usr/libexec/mysqld: Shutdown complete

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

170906 12:46:23 [Note] Event Scheduler: Purging the queue. 0 events
170906 12:46:25  InnoDB: Starting shutdown...
170906 12:46:27  InnoDB: Shutdown completed; log sequence number 0 44243
170906 12:46:27 [Note] /usr/libexec/mysqld: Shutdown complete

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

170906 12:46:32 [Note] Event Scheduler: Purging the queue. 0 events
170906 12:46:34  InnoDB: Starting shutdown...
170906 12:46:36  InnoDB: Shutdown completed; log sequence number 0 44243
170906 12:46:36 [Note] /usr/libexec/mysqld: Shutdown complete

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

170906 13:27:59 [Note] Event Scheduler: Purging the queue. 0 events
170906 13:28:01  InnoDB: Starting shutdown...
170906 13:28:05  InnoDB: Shutdown completed; log sequence number 0 44243
170906 13:28:05 [Note] /usr/libexec/mysqld: Shutdown complete

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

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

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

170906 13:38:45 [Note] Event Scheduler: Purging the queue. 0 events
170906 13:38:47  InnoDB: Starting shutdown...
170906 13:38:51  InnoDB: Shutdown completed; log sequence number 0 44243
170906 13:38:51 [Note] /usr/libexec/mysqld: Shutdown complete

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

170906 13:38:56 [Note] Event Scheduler: Purging the queue. 0 events
170906 13:38:58  InnoDB: Starting shutdown...
170906 13:39:01  InnoDB: Shutdown completed; log sequence number 0 44243
170906 13:39:01 [Note] /usr/libexec/mysqld: Shutdown complete

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

170906 13:58:08 [Note] Event Scheduler: Purging the queue. 0 events
170906 13:58:10  InnoDB: Starting shutdown...
170906 13:58:13  InnoDB: Shutdown completed; log sequence number 0 44243
170906 13:58:13 [Note] /usr/libexec/mysqld: Shutdown complete

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

170906 13:58:18 [Note] Event Scheduler: Purging the queue. 0 events
170906 13:58:20  InnoDB: Starting shutdown...
170906 13:58:23  InnoDB: Shutdown completed; log sequence number 0 44243
170906 13:58:23 [Note] /usr/libexec/mysqld: Shutdown complete

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

170906 15:20:34 [Note] Event Scheduler: Purging the queue. 0 events
170906 15:20:36  InnoDB: Starting shutdown...
170906 15:20:38  InnoDB: Shutdown completed; log sequence number 0 44243
170906 15:20:38 [Note] /usr/libexec/mysqld: Shutdown complete

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

170906 15:20:43 [Note] Event Scheduler: Purging the queue. 0 events
170906 15:20:45  InnoDB: Starting shutdown...
170906 15:20:47  InnoDB: Shutdown completed; log sequence number 0 44243
170906 15:20:47 [Note] /usr/libexec/mysqld: Shutdown complete

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

Re: Nagios Problem After PHP Uninstallation

Posted: Wed Sep 06, 2017 9:33 am
by scottwilkerson
Oh I see you are missing the following, lets install

Code: Select all

yum install php-mysql php-gd php-snmp php-ldap php-devel php-mbstring php-pgsql php-xml php-mcrypt -y
One thing I notices is you do not have php package proper, which is a little weird but maybe you installed it by source

Re: Nagios Problem After PHP Uninstallation

Posted: Wed Sep 06, 2017 10:26 am
by nms_system_support
I executed the command and I received the below error:

[root@nagios-nms ~]# yum install php-mysql php-gd php-snmp php-ldap php-devel php-mbstring php-pgsql php-xml php-mcrypt -y
Loaded plugins: product-id, refresh-packagekit, search-disabled-repos, security, subscription-manager
Setting up Install Process
Package php-mcrypt-5.3.3-5.el6.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package php-gd.x86_64 0:5.3.3-49.el6 will be installed
---> Package php-ldap.x86_64 0:5.3.3-49.el6 will be installed
---> Package php-mysql.x86_64 0:5.3.3-49.el6 will be installed
---> Package php-pgsql.x86_64 0:5.3.3-49.el6 will be installed
---> Package php-xml.x86_64 0:5.3.3-49.el6 will be installed
---> Package php71w-devel.x86_64 0:7.1.8-2.w6 will be installed
--> Processing Dependency: php71w-cli(x86-64) = 7.1.8-2.w6 for package: php71w-devel-7.1.8-2.w6.x86_64
---> Package php71w-mbstring.x86_64 0:7.1.8-2.w6 will be installed
--> Processing Dependency: php71w-common(x86-64) = 7.1.8-2.w6 for package: php71w-mbstring-7.1.8-2.w6.x86_64
---> Package php71w-snmp.x86_64 0:7.1.8-2.w6 will be installed
--> Running transaction check
---> Package php71w-cli.x86_64 0:7.1.8-2.w6 will be installed
---> Package php71w-common.x86_64 0:7.1.8-2.w6 will be installed
--> Processing Conflict: php71w-common-7.1.8-2.w6.x86_64 conflicts php-common < 7.1
--> Finished Dependency Resolution
Error: php71w-common conflicts with php-common-5.3.3-49.el6.x86_64
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
[root@nagios-nms ~]#

Thank you,

Re: Nagios Problem After PHP Uninstallation

Posted: Wed Sep 06, 2017 10:54 am
by tacolover101
you need to remove php71, and then re-install the standard repo php version as @scottwilkerson mentioned.
scottwilkerson wrote:Oh I see you are missing the following, lets install

Code: Select all

yum install php-mysql php-gd php-snmp php-ldap php-devel php-mbstring php-pgsql php-xml php-mcrypt -y
One thing I notices is you do not have php package proper, which is a little weird but maybe you installed it by source

Re: Nagios Problem After PHP Uninstallation

Posted: Wed Sep 06, 2017 1:45 pm
by dwhitfield
tacolover101 wrote:you need to remove php71
This is true. PHP 7 is expected to work in XI 5.5, which should be out before the end of the year.

Re: Nagios Problem After PHP Uninstallation

Posted: Wed Sep 06, 2017 1:47 pm
by nms_system_support
I have removed all php packages now as can be seen below, but I still receive the previous error about php71 conflict.

[root@nagios-nms ~]# rpm -qa|grep php
[root@nagios-nms ~]#