Sql connnection issue

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
tgfde
Posts: 233
Joined: Thu May 12, 2011 7:55 am

Sql connnection issue

Post by tgfde »

Hello,

I'm seeing the following error in the messages.log

Apr 21 14:14:30 cordmon1 ndo2db: Error: mysql_query() failed for 'INSERT INTO nagios_programstatus SET instance_id='1', status_update_time=FROM_UNIXTIME(1398107670), program_start_time=FROM_UNIXTIME(1398107610), is_currently_running='1', process_id='14724', daemon_mode='1', last_command_check=FROM_UNIXTIME(1398107669), last_log_rotation=FROM_UNIXTIME(0), notifications_enabled='1', active_service_checks_enabled='1', passive_service_checks_enabled='1', active_host_checks_enabled='1', passive_host_checks_enabled='1', event_handlers_enabled='1', flap_detection_enabled='1', failure_prediction_enabled='1', process_performance_data='1', obsess_over_hosts='0', obsess_over_services='0', modified_host_attributes='0', modified_service_attributes='0', global_host_event_handler='xi_host_event_handler', global_service_event_handler='xi_service_event_handler' ON DUPLICATE KEY UPDATE instance_id='1', status_update_time=FROM_UNIXTIME(1398107670), program_start_time=FROM_UNIXTIME(1398107610), is_currently_running='1', process_id=
Apr 21 14:14:30 cordmon1 ndo2db: mysql_error: 'MySQL server has gone away'
Apr 21 14:14:30 cordmon1 ndo2db: Error: Connection to MySQL database has been lost!
Apr 21 14:14:30 cordmon1 ndo2db: Error: Could not connect to MySQL database: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
Apr 21 14:14:30 cordmon1 last message repeated 24 times
Apr 21 14:14:48 cordmon1 nagios: Caught SIGTERM, shutting down...
Apr 21 14:14:48 cordmon1 nagios: Successfully shutdown... (PID=14724)

Please advise.

Thanks.
tgfde
Posts: 233
Joined: Thu May 12, 2011 7:55 am

Re: Sql connnection issue

Post by tgfde »

Here's my setup info:

Nagios XI 2012R2.1
Cent OS 6 32 bit
Virtual Server

Thanks.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Sql connnection issue

Post by tmcdonald »

Let's see if mysqld is even running:

Code: Select all

service mysqld status
If it is not, run the following:

Code: Select all

service mysqld start
If that command gives any output, post it here.

In addition, let's check out your mysql log. Run this:

Code: Select all

tail -20 /var/log/mysqld.log
and post the output here.
Former Nagios employee
tgfde
Posts: 233
Joined: Thu May 12, 2011 7:55 am

Re: Sql connnection issue

Post by tgfde »

140421 16:00:50 mysqld started
140421 16:00:50 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
140421 16:00:50 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
140421 16:00:51 InnoDB: Started; log sequence number 0 43655
140421 16:00:51 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.0.77' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Sql connnection issue

Post by tmcdonald »

And your logs?
Former Nagios employee
tgfde
Posts: 233
Joined: Thu May 12, 2011 7:55 am

Re: Sql connnection issue

Post by tgfde »

FYI.
I just upgraded to xi 2012r2.9 to try to fix this issue but didn't worked.
tgfde
Posts: 233
Joined: Thu May 12, 2011 7:55 am

Re: Sql connnection issue

Post by tgfde »

Which logs do you need?
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Sql connnection issue

Post by tmcdonald »

tmcdonald wrote:In addition, let's check out your mysql log. Run this:

Code: Select all

tail -20 /var/log/mysqld.log
and post the output here.
That one.
Former Nagios employee
tgfde
Posts: 233
Joined: Thu May 12, 2011 7:55 am

Re: Sql connnection issue

Post by tgfde »

140421 15:55:44 mysqld started
140421 15:55:44 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
140421 15:55:44 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
140421 15:55:44 InnoDB: Started; log sequence number 0 43655
140421 15:55:44 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.0.77' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution
140421 15:59:35 [Note] /usr/libexec/mysqld: Normal shutdown

140421 15:59:37 InnoDB: Starting shutdown...
140421 15:59:37 InnoDB: Shutdown completed; log sequence number 0 43655
140421 15:59:37 [Note] /usr/libexec/mysqld: Shutdown complete

140421 15:59:37 mysqld ended

140421 16:00:50 mysqld started
140421 16:00:50 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
140421 16:00:50 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
140421 16:00:51 InnoDB: Started; log sequence number 0 43655
140421 16:00:51 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.0.77' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution
tgfde
Posts: 233
Joined: Thu May 12, 2011 7:55 am

Re: Sql connnection issue

Post by tgfde »

Everything was working yesterday as of 4:430 CST. After looking into the log this morning, at 5pm yesterday, Nagios was showing that everything was down even though they are not. The message below appeared before everything Nagios started sending the false notifications again.

Apr 21 17:05:27 [nogios_host} nagios: Auto-save of retention data completed successfully.

Thanks.
Locked