5.6.5 Upgrade - PHP warning.

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
TBT
Posts: 625
Joined: Wed May 18, 2011 1:26 pm

Re: 5.6.5 Upgrade - PHP warning.

Post by TBT »

Config file exceeds the char limit on this forum. I've sent a copy of the file in a PM.
Nagios XI 2024R2.2.1 (8 Servers)
Nagios Fusion 2024R1.0.2
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: 5.6.5 Upgrade - PHP warning.

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
TBT
Posts: 625
Joined: Wed May 18, 2011 1:26 pm

Re: 5.6.5 Upgrade - PHP warning.

Post 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...
                            ^
Nagios XI 2024R2.2.1 (8 Servers)
Nagios Fusion 2024R1.0.2
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: 5.6.5 Upgrade - PHP warning.

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
TBT
Posts: 625
Joined: Wed May 18, 2011 1:26 pm

Re: 5.6.5 Upgrade - PHP warning.

Post 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
Nagios XI 2024R2.2.1 (8 Servers)
Nagios Fusion 2024R1.0.2
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: 5.6.5 Upgrade - PHP warning.

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked