This support forum board is for support questions relating to
Nagios XI , our flagship commercial network monitoring solution.
tgriep
Madmin
Posts: 9177 Joined: Thu Oct 30, 2014 9:02 am
Post
by tgriep » Mon Dec 02, 2019 10:02 am
Edit the /etc/my.cnf file and under the following section
put in the following.
Code: Select all
general-log
general-log-file=/var/log/mariadb/queries.log
Run the following to restart the processes.
Code: Select all
systemctl stop nagios
systemctl stop ndo2db
systemctl stop crond
pkill -9 -u nagios
systemctl restart mariadb
systemctl start ndo2db
systemctl start nagios
systemctl start crond
When the notification table gets corrupted, get the following file and upload it to the post.
Thanks.
Be sure to check out our
Knowledgebase for helpful articles and solutions!
eycklin
Posts: 30 Joined: Wed Apr 10, 2019 8:40 pm
Post
by eycklin » Mon Dec 02, 2019 9:47 pm
Hi,
Please see attached query log and worklog.
Thanks,
Eyck Lin
You do not have the required permissions to view the files attached to this post.
tgriep
Madmin
Posts: 9177 Joined: Thu Oct 30, 2014 9:02 am
Post
by tgriep » Tue Dec 03, 2019 10:37 am
It looks like when the dbmaint script runs and optimizes the table, after that, the table is corrupted so can you get the following file and the archived versions of the that file and post them?
Code: Select all
/usr/local/nagiosxi/var/dbmaint.log
Also, run these commands and post the data.
Code: Select all
echo "SELECT SCHEMA_NAME 'database', default_character_set_name 'charset', DEFAULT_COLLATION_NAME 'collation' FROM information_schema.SCHEMATA;" |mysql -t -u root -pnagiosxi
echo "SHOW VARIABLES LIKE 'character\_set\_%';" |mysql -t -u root -pnagiosxi nagios
Thanks
Be sure to check out our
Knowledgebase for helpful articles and solutions!
eycklin
Posts: 30 Joined: Wed Apr 10, 2019 8:40 pm
Post
by eycklin » Wed Dec 04, 2019 5:31 am
Hi,
Please see below log & attached log.
[root@localhost var]# echo "SELECT SCHEMA_NAME 'database', default_character_set_name 'charset', DEFAULT_COLLATION_NAME 'collation' FROM information_schema.SCHEMATA;" |mysql -t -u root -pnagiosxi
+--------------------+---------+-------------------+
| database | charset | collation |
+--------------------+---------+-------------------+
| information_schema | utf8 | utf8_general_ci |
| mysql | latin1 | latin1_swedish_ci |
| nagios | utf8 | utf8_general_ci |
| nagiosql | utf8 | utf8_general_ci |
| nagiosxi | latin1 | latin1_swedish_ci |
| performance_schema | utf8 | utf8_general_ci |
| test | latin1 | latin1_swedish_ci |
+--------------------+---------+-------------------+
[root@localhost var]# echo "SHOW VARIABLES LIKE 'character\_set\_%';" |mysql -t -u root -pnagiosxi nagios
+--------------------------+--------+
| Variable_name | Value |
+--------------------------+--------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | latin1 |
| character_set_system | utf8 |
+--------------------------+--------+
Thanks,
Eyck Lin
You do not have the required permissions to view the files attached to this post.
tgriep
Madmin
Posts: 9177 Joined: Thu Oct 30, 2014 9:02 am
Post
by tgriep » Wed Dec 04, 2019 2:17 pm
Login to the XI GUI and go to the Admin > Performance Settings menu and click on the Databases TAB.
Change the Optimize Interval to 1440 and update the settings.
That will change the optimization to once a day instead of every hour.
See if that helps.
Run this as root and post it se we can see the sizes of the MYSQL tables.
Code: Select all
echo "SELECT table_schema as 'Database', table_name AS 'Table', round(((data_length + index_length) / 1024 / 1024), 2) 'Size in MB' FROM information_schema.TABLES ORDER BY (data_length + index_length) DESC;" |mysql -t -u root -pnagiosxi
Be sure to check out our
Knowledgebase for helpful articles and solutions!
eycklin
Posts: 30 Joined: Wed Apr 10, 2019 8:40 pm
Post
by eycklin » Wed Dec 04, 2019 8:24 pm
Hi,
Done.
Please see attached log file.
Thanks,
Eyck Lin
You do not have the required permissions to view the files attached to this post.
eycklin
Posts: 30 Joined: Wed Apr 10, 2019 8:40 pm
Post
by eycklin » Thu Dec 05, 2019 12:43 am
Hi,
After fix, it doesn't crash from 9:13 till 13:40(now).
We'll still monitor for some days since db optimize process is about once a day now.
Do you need any info other than above log?
If you still need some logs, please let me know.
Thanks,
Eyck Lin
tgriep
Madmin
Posts: 9177 Joined: Thu Oct 30, 2014 9:02 am
Post
by tgriep » Thu Dec 05, 2019 10:05 am
Thanks for the files. There are a couple of tables I would like to look at so run the following as root and post the /tmp/info.txt file.
Code: Select all
echo 'select * from nagios_contactnotificationmethods;' |mysql -t -u root -pnagiosxi nagios >/tmp/info.txt
echo 'select * from nagios_contactnotifications;' |mysql -t -u root -pnagiosxi nagios >>/tmp/info.txt
Thanks
Be sure to check out our
Knowledgebase for helpful articles and solutions!
tgriep
Madmin
Posts: 9177 Joined: Thu Oct 30, 2014 9:02 am
Post
by tgriep » Thu Dec 05, 2019 3:55 pm
As of now, I have not found anything to draw a conclusion on what the issue is.
I am just trying to rule out when the Database Optimization happens, that the notifications table gets corrupted.
Be sure to check out our
Knowledgebase for helpful articles and solutions!