Page 2 of 2

Re: 5.6.5 Upgrade - PHP warning.

Posted: Mon Jul 29, 2019 8:48 am
by TBT
Config file exceeds the char limit on this forum. I've sent a copy of the file in a PM.

Re: 5.6.5 Upgrade - PHP warning.

Posted: Mon Jul 29, 2019 9:49 am
by tgriep
Edit the /etc/php.ini file and comment out the following 2 options.

Code: Select all

magic_quotes_gpc = Off
magic_quotes_runtime = Off
Save the change and restart Apache.

Code: Select all

service httpd restart
Process a MIB file and see if the error is resolved.

Those settings affect how certain characters in strings are escaped and they seem to be effecting the SQL queries.

Re: 5.6.5 Upgrade - PHP warning.

Posted: Mon Jul 29, 2019 2:16 pm
by TBT
tgriep wrote:Edit the /etc/php.ini file and comment out the following 2 options.

Code: Select all

magic_quotes_gpc = Off
magic_quotes_runtime = Off
Save the change and restart Apache.

Code: Select all

service httpd restart
Process a MIB file and see if the error is resolved.

Those settings affect how certain characters in strings are escaped and they seem to be effecting the SQL queries.
As per your instruction. I then navigate to Admin > System Extensions > Manage MIBs, and click the Process All Traps button.

Results in the same error.

Code: Select all

SQL Error [nagiosxi] : ERROR:  syntax error at or near "SET"
LINE 1: INSERT INTO xi_mibs SET mib_type = 'process_nxti' , mib_uplo...
                            ^

Re: 5.6.5 Upgrade - PHP warning.

Posted: Mon Jul 29, 2019 2:50 pm
by tgriep
Can you run the following commands as root on the Nagios server and post the output?

Code: Select all

echo "\d xi_mibs" | psql nagiosxi nagiosxi
echo "\dT+;"|psql nagiosxi nagiosxi
ls -lR /usr/share/snmp/mibs

Get the Postgres config file and upload it to the post.

Code: Select all

/var/lib/pgsql/data/postgresql.conf
Then run this command as root.

Code: Select all

tail -f /var/log/httpd/*_log
Process a MIB file and post the message in the tail windows so we can check them for errors.

Re: 5.6.5 Upgrade - PHP warning.

Posted: Tue Jul 30, 2019 8:50 am
by TBT
echo "\d xi_mibs" | psql nagiosxi nagiosxi

Code: Select all

                                           Table "public.xi_mibs"
       Column       |            Type             |                        Modifiers
--------------------+-----------------------------+----------------------------------------------------------
 mib_id             | integer                     | not null default nextval('xi_mibs_mib_id_seq'::regclass)
 mib_name           | character varying(64)       | not null
 mib_uploaded       | timestamp without time zone |
 mib_last_processed | timestamp without time zone |
 mib_type           | e_mib_type                  |
Indexes:
    "xi_mibs_pkey" PRIMARY KEY, btree (mib_id)
    "xi_mibs_mib_name_key" UNIQUE, btree (mib_name)

echo "\dT+;"|psql nagiosxi nagiosxi

Code: Select all

                            List of data types
 Schema |    Name    | Internal name | Size |    Elements    | Description
--------+------------+---------------+------+----------------+-------------
 public | e_mib_type | e_mib_type    | 4    | upload         |
                                            : process_manual
                                            : process_nxti
(1 row)
As the attachment only allows for one file at a time, I've PM you twice. There you will find a copy of postgresql-copy.conf and http-output.log

Re: 5.6.5 Upgrade - PHP warning.

Posted: Tue Jul 30, 2019 10:39 am
by tgriep
Thanks for the data. What you found is a bug in the command to update / insert the data for Postgres databases.

I filed a bug report to get it fixed and hopefully is will get fixed soon.
Our developers are looking in at creating a patch in the meantime and it will be added to the post when it is done.