Page 1 of 1

mariadb log

Posted: Wed Feb 05, 2020 3:19 pm
by exp-user1
Hello,

Mariadb.log is throwing loads of the following message:
00205 15:06:39 [Warning] Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT... ON DUPLICATE KEY UPDATE on a table with more than one UNIQUE KEY is unsafe Statement: INSERT INTO nagios_servicestatus SET instance_id='1', service_object_id='4203', status_update_time=FROM_UNIXTIME(1580933199), output='OK: Found 0 lines \(limit=1/10000000\): No matches found\.', long_output='', perfdata='lines=0', current_state='0', has_been_checked='1', should_be_scheduled='1', current_check_attempt='1', max_check_attempts='1', last_check=FROM_UNIXTIME(1580933029), next_check=FROM_UNIXTIME(1580933207), check_type='0', last_state_change=FROM_UNIXTIME(1579815225), last_hard_state_change=FROM_UNIXTIME(1579815225), last_hard_state='0', last_time_ok=FROM_UNIXTIME(1580933029), last_time_warning=FROM_UNIXTIME(0), last_time_unknown=FROM_UNIXTIME(1579739695), last_time_critical=FROM_UNIXTIME(1579815225), state_type='1', last_notification=FROM_UNIXTIME(0), next_notification=FROM_UNIXTIME(0), no_more_notifica
ANY HELP?

Re: mariadb log

Posted: Wed Feb 05, 2020 4:46 pm
by benjaminsmith
Hello @exp-user1,

Thanks for posting the log, let's run the repair script to fix any corrupted tables. Log into the shell as root and run the following script:

Code: Select all

/usr/local/nagiosxi/scripts/repair_databases.sh
If the issue still persists, send us your system profile for us to review and further troubleshoot. Thanks.

To send us your system profile.
Login to the Nagios XI GUI using a web browser
Click the "Admin" > "System Profile" Menu
Click the "Download Profile" button
Save the profile.zip file and share this in a private message and then reply to this post to bring it up in the queue.

Re: mariadb log

Posted: Fri Feb 07, 2020 3:46 pm
by exp-user1
Hello,

I did DB repair but the problem persists.
Could you specify certain things that can help you in your investigation other than system profile?

Thanks

Re: mariadb log

Posted: Fri Feb 07, 2020 4:46 pm
by benjaminsmith
Hello @exp-user-1,

It's a warning message, are you noticing any other issues (i.e performance loss)? Do you have database replication configured on this system?

https://mariadb.com/kb/en/unsafe-statem ... plication/

Let us know. It would be helpful to review the my.cnf file from the server.

Re: mariadb log

Posted: Mon Feb 10, 2020 10:42 am
by exp-user1
Hello,

we do have DB replication, here is my.cnf
[mysqld]
query_cache_size=16M
query_cache_limit=4M
tmp_table_size=64M
max_heap_table_size=64M
key_buffer_size=32M
table_open_cache=32
innodb_file_per_table=1

log-bin
server_id=1
binlog-do-db=nagios
binlog-do-db=nagiosxi
binlog-do-db=nagiosql
binlog-do-db=aws_dyn_hosts
replicate-do-db=nagios
replicate-do-db=nagiosxi
replicate-do-db=nagiosql
replicate-do-db=aws_dyn_hosts
bind-address=10.1.1.1
expire_logs_days=1


datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd

[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid

#
# include all files from the config directory
#
!includedir /etc/my.cnf.d


Another thing, logentries is NULL. DB repair fixes this but the next day it gets NULL again.
echo "SELECT table_name AS 'Table', round(((data_length + index_length) / 1024 / 1024), 2) 'Size in MB' FROM information_schema.TABLES WHERE table_schema IN ('nagios', 'nagiosql', 'nagiosxi');" | mysql -uroot -pnagiosxi --table |grep logentries
| nagios_logentries | NULL |
Any help?

Re: mariadb log

Posted: Mon Feb 10, 2020 5:26 pm
by benjaminsmith
Hello @exp-user1,

Can you disable the replication and test to confirm whether or not the issue with logentries table is resolved? Let me know.