Home » Categories » Products » Nagios XI » Troubleshooting » Common Problems

Nagios XI - STRICT_TRANS_TABLES

Overview

This KB article is about the MySQL / MariaDB database and adjusting the STRICT_TRANS_TABLES setting.

As of [MySQL 5.7.5] and [MariaDB 10.2.4] the STRICT_TRANS_TABLES mode is enabled by default. When this is enabled it causes database changes to be rolled back if they do not meet strict requirements. This causes problems with Nagios XI and how it saves it's data to the database.

Nagios XI requires the STRICT_TRANS_TABLES to be disabled, this KB article instructs you on how to do this.

The steps in this KB article need to be applied to your database server. Normally this is your Nagios XI server however if you have offloaded the databases to an external server then the commands need to be executed on that server.

 

 

Change Setting

Establish a terminal session to your Nagios XI server and execute the following command to open the database client:

mysql -u root -pnagiosxi

Execute these command to determine if the setting is currently disabled:

use nagiosql;
SELECT @@SQL_MODE, @@GLOBAL.SQL_MODE\G;

 

The output will be something like this:

*************************** 1. row ***************************
@@SQL_MODE: STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
@@GLOBAL.SQL_MODE: STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
1 row in set (0.00 sec)

 

You can see from the output above that the setting STRICT_TRANS_TABLES exists, this means is it enabled.

 

To disable the setting execute the following commands:

SET @@SQL_MODE = REPLACE(@@SQL_MODE,'STRICT_TRANS_TABLES', '');
SET @@GLOBAL.SQL_MODE = REPLACE(@@GLOBAL.SQL_MODE,'STRICT_TRANS_TABLES', '');
SELECT @@SQL_MODE, @@GLOBAL.SQL_MODE\G;

 

The output should be something like:

MariaDB [nagiosql]> SET @@SQL_MODE = REPLACE(@@SQL_MODE,'STRICT_TRANS_TABLES', '');
Query OK, 0 rows affected (0.00 sec)

MariaDB [nagiosql]> SET @@GLOBAL.SQL_MODE = REPLACE(@@GLOBAL.SQL_MODE,'STRICT_TRANS_TABLES', '');
Query OK, 0 rows affected (0.00 sec)

MariaDB [nagiosql]> SELECT @@SQL_MODE, @@GLOBAL.SQL_MODE\G;
*************************** 1. row ***************************
@@SQL_MODE: ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
@@GLOBAL.SQL_MODE: ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
1 row in set (0.00 sec)


You can see from the output above that the STRICT_TRANS_TABLES setting no longer exists, this means it is disabled.

 

This completes the changes required to disable the STRICT_TRANS_TABLES setting. You can now exit the database client with:

quit;

 

You will also need to remove STRICT_TRANS_TABLES in the MySQL / MariaDB my.cnf configuration file.

The first step is to stop the required services on your Nagios XI server:

 

RHEL 7 - 8| CentOS 7 - 8 | Oracle Linux 7 | Debian | Ubuntu 16/18/20 | Centos Stream

systemctl stop nagios.service
systemctl stop ndo2db.service

 

The next step is to edit the my.cnf configuration file on your MySQL / MariaDB database server. Establish a terminal session to your database server and edit the my.cnf file by executing the following command:

RHEL7 | CentOS7 | Oracle Linux7

vi /etc/my.cnf

 

RHEL8 | CentOS8 | Centos Stream

vi /etc/my.cnf.d/mysql-server.cnf

 

Ubuntu 16/18/20

vi /etc/mysql/mysql.conf.d/mysqld.cnf

 

Debian 9

vi /etc/mysql/mariadb.conf.d/50-server.cnf

 

When using the vi editor, to make changes press i on the keyboard first to enter insert mode. Press Esc to exit insert mode.

 

Locate the [mysqld] section and locate the sql_mode already defined:

[mysqld]
# Recommended in standard MySQL setup
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

 

Remove the STRICT_TRANS_TABLES in the line so it looks similar as follows:

[mysqld]
sql_mode=NO_ENGINE_SUBSTITUTION

 

When you have finished, save the changes in vi by typing:

:wq

and press Enter.

 

You now need to restart the database service:

 

RHEL 7 | CentOS 7 | Oracle Linux 7 | Debian 9

systemctl restart mariadb.service

 

RHEL 8 | CentOS 8 | Centos Stream

systemctl restart mysqld.service 

Debian 8 | Ubuntu 16/18/20

systemctl restart mysql.service

 

 

You now need to start the Nagios services:

 

RHEL 7 | CentOS 7 | Oracle Linux 7 | Debian | Ubuntu 16/18/20

systemctl start ndo2db.service 
systemctl start nagios.service

 

RHEL 8 | CentOS 8 | Centos Stream

systemctl start nagios.service

 

Final Thoughts

For any support related questions please visit the Nagios Support Forums at:

http://support.nagios.com/forum/



Special Offer For Knowledgebase Visitors! Get a huge discount on Nagios Log Server by clicking below.

Get 60% Off Nagios Log Server!

Did you know? Nagios provides complete monitoring of: Windows, Linux, UNIX, Servers, Websites, SNMP, DHCP, DNS, Email, Storage, Files, Apache, IIS, EC2, and more!

0 (0)
Article Rating (No Votes)
Rate this article
  • Icon PDFExport to PDF
  • Icon MS-WordExport to MS Word
Attachments Attachments
There are no attachments for this article.
Related Articles RSS Feed
Nagios XI - Notifications Not Sending In XI 5.3.0
Viewed 5634 times since Tue, Oct 4, 2016
Nagios XI - Oracle Services Critical After Nagios XI Upgrade
Viewed 6438 times since Wed, Jan 27, 2016
Nagios XI - mysql_error out of range value for column
Viewed 6672 times since Tue, Aug 14, 2018
Nagios XI - WMI Authentication Problems
Viewed 7612 times since Thu, Feb 25, 2016
CCM says unapplied changes exist, but none listed
Viewed 6272 times since Mon, Feb 27, 2017
Nagios XI - Apply Configuration Fails - Backend login to the Core Configuration failed
Viewed 25718 times since Tue, Aug 2, 2016
VMWare checks timing out or slow
Viewed 3804 times since Fri, Feb 11, 2022
Nagios XI - Resetting The nagiosadmin Password
Viewed 46667 times since Mon, Jan 25, 2016
Nagios XI - Windows Memory Usage - Physical
Viewed 18470 times since Tue, Jan 26, 2016
Nagios XI - Scheduled Backup Log Level
Viewed 5941 times since Tue, Apr 18, 2017