Nagios XI - SQL Error [nagiosxi] : ERROR: syntax error
This KB article explains how to resolve an error similar to the following that appears in the Nagios XI GUI:
SQL Error [nagiosxi] : ERROR: syntax error at or near "localhost"
The postgresql log file in /var/lib/pgsql/data/pg_log/ will have more detailed information:
ERROR: syntax error at or near "localhost" at character 166
This error occurs on the Host or Service Status Detail page > Configure tab, when you are using the re-configure a host or service option.
The problem only occurs with older installations of Nagios XI that historically used PostgreSQL for the nagiosxi database. Fresh installations of Nagios XI since 5.x do not experience this issue.
The problem only occurs with PostgreSQL 9.1 or greater.
A simple change to the postgresql.conf file will resolve this problem.
Establish a terminal session to your Nagios XI server as root and edit the postgresql.conf file with this command:
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 following line:
Tip: typing /conform and pressing Enter in vi should take you directly to this section in the file.
Remove the # from the begging of the line and set it to off:
standard_conforming_strings = off
When you have finished, save the changes in vi by typing:
and press Enter.
You need to restart the postgresql service using one of the commands below:
You need to restart the service using one of the commands below:
RHEL 6 | CentOS 6 | Oracle Linux 6 | Ubuntu 14
service postgresql restart
RHEL 7 | CentOS 7 | Oracle Linux 7 | Debian | Ubuntu 16/18
systemctl restart postgresql.service
This completes the changes required for resolving the problem described above.
The following documentation explains in detail the standard_conforming_strings option:
For any support related questions please visit the Nagios Support Forums at:
|Posted by: tlea - Sun, Sep 10, 2017 at 9:00 PM. This article has been viewed 1269 times.|
|Online URL: https://support.nagios.com/kb/article/nagios-xi-sql-error-nagiosxi-error-syntax-error-754.html|
Powered by PHPKB (Knowledge Base Software)