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

5.6.5 Upgrade - PHP warning.

Post by TBT »

Just completed a few upgrades of XI 5.5.7 to 5.6.5. Each upgrade was successful, but the following PHP error was noted.

PHP Warning: Invalid argument supplied for foreach() in /usr/local/nagiosxi/html/includes/components/nagiosim/nagiosim.inc.php on line 491

Please advise.
Nagios XI 2024R2.2.1 (8 Servers)
Nagios Fusion 2024R1.0.2
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: 5.6.5 Upgrade - PHP warning.

Post by cdienger »

It's an old component that can be deleted - https://support.nagios.com/forum/viewto ... hp#p281300:

Code: Select all

rm -rf /usr/local/nagiosxi/html/includes/components/nagiosim
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
TBT
Posts: 625
Joined: Wed May 18, 2011 1:26 pm

Re: 5.6.5 Upgrade - PHP warning.

Post by TBT »

Thanks, I've removed as suggested. Also, I ran into this message:

<p><pre>SQL Error [nagiosxi] : ERROR: duplicate key value violates unique constraint "xi_mibs_mib_name_key"</pre></p>

Any advice on this one?
Nagios XI 2024R2.2.1 (8 Servers)
Nagios Fusion 2024R1.0.2
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: 5.6.5 Upgrade - PHP warning.

Post by cdienger »

It looks like it probably tried to run the commands to create the xi_mibs table twice and failed the second time because it was already created. Make sure it's there with:

Code: Select all

echo "show tables;" | mysql -uroot -pnagiosxi -Dnagiosxi
echo "describe xi_mibs" | mysql -uroot -pnagiosxi -Dnagiosxi
(you'll need to add "-h db_ip_addr" and change the username and password if the database is not the default)
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
TBT
Posts: 625
Joined: Wed May 18, 2011 1:26 pm

Re: 5.6.5 Upgrade - PHP warning.

Post by TBT »

cdienger wrote:It looks like it probably tried to run the commands to create the xi_mibs table twice and failed the second time because it was already created. Make sure it's there with:

Code: Select all

echo "show tables;" | mysql -uroot -pnagiosxi -Dnagiosxi
echo "describe xi_mibs" | mysql -uroot -pnagiosxi -Dnagiosxi
(you'll need to add "-h db_ip_addr" and change the username and password if the database is not the default)
"nagiosxi" is actually a PostgresQL Database. The item of note is that the table appears to have no data in it (see the COPY xi_mibs statement below). This would make me question the 'duplicate key' issue.

Code: Select all

--
-- Name: xi_mibs_mib_id_seq; Type: SEQUENCE; Schema: public; Owner: nagiosxi
--

CREATE SEQUENCE xi_mibs_mib_id_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE public.xi_mibs_mib_id_seq OWNER TO nagiosxi;

--
-- Name: xi_mibs_mib_id_seq; Type: SEQUENCE SET; Schema: public; Owner: nagiosxi
--

SELECT pg_catalog.setval('xi_mibs_mib_id_seq', 10, true);


--
-- Name: xi_mibs; Type: TABLE; Schema: public; Owner: nagiosxi; Tablespace:
--


CREATE TABLE xi_mibs (
    mib_id integer DEFAULT nextval('xi_mibs_mib_id_seq'::regclass) NOT NULL,
    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
);


ALTER TABLE public.xi_mibs OWNER TO nagiosxi;

--
-- Name: xi_mibs_mib_name_key; Type: CONSTRAINT; Schema: public; Owner: nagiosxi; Tablespace:
--

ALTER TABLE ONLY xi_mibs
    ADD CONSTRAINT xi_mibs_mib_name_key UNIQUE (mib_name);


--
-- Name: xi_mibs_pkey; Type: CONSTRAINT; Schema: public; Owner: nagiosxi; Tablespace:
--

ALTER TABLE ONLY xi_mibs
    ADD CONSTRAINT xi_mibs_pkey PRIMARY KEY (mib_id);


COPY xi_mibs (mib_id, mib_name, mib_uploaded, mib_last_processed, mib_type) FROM stdin;
\.
Nagios XI 2024R2.2.1 (8 Servers)
Nagios Fusion 2024R1.0.2
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: 5.6.5 Upgrade - PHP warning.

Post by cdienger »

That makes some sense - the error can occur if the table tries to be created again and not necessarily if it's trying to be populated. That said, the table should be populated. Go under Admin > System Extensions > Manage MIBs, and click the Process All Traps button and then check the table again.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
TBT
Posts: 625
Joined: Wed May 18, 2011 1:26 pm

Re: 5.6.5 Upgrade - PHP warning.

Post by TBT »

cdienger wrote:That makes some sense - the error can occur if the table tries to be created again and not necessarily if it's trying to be populated. That said, the table should be populated. Go under Admin > System Extensions > Manage MIBs, and click the Process All Traps button and then check the table again.
Doing so results in a page full of errors stating the following over and over:

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 »

What version of postgres is the server running?
Run this and post the output.

Code: Select all

psql -V
Get this file and upload it to the ticket so we can view it.

Code: Select all

/var/lib/pgsql/data/pg_log/postgresql-Fri.log
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:What version of postgres is the server running?
Run this and post the output.

Code: Select all

psql -V
Get this file and upload it to the ticket so we can view it.

Code: Select all

/var/lib/pgsql/data/pg_log/postgresql-Fri.log
1. psql (PostgreSQL) 8.4.20

2. There isn't a ticket, below is the output of postgresql-Fri.log

Code: Select all

ERROR:  relation "xi_notifications" does not exist
STATEMENT:  VACUUM ANALYZE xi_notifications;
ERROR:  relation "xi_notifications" does not exist
STATEMENT:  VACUUM ANALYZE xi_notifications;
ERROR:  relation "xi_notifications" does not exist
STATEMENT:  VACUUM ANALYZE xi_notifications;
ERROR:  relation "xi_notifications" does not exist
STATEMENT:  VACUUM ANALYZE xi_notifications;
ERROR:  relation "xi_notifications" does not exist
STATEMENT:  VACUUM ANALYZE xi_notifications;
ERROR:  relation "xi_notifications" does not exist
STATEMENT:  VACUUM ANALYZE xi_notifications;
ERROR:  relation "xi_notifications" does not exist
STATEMENT:  VACUUM ANALYZE xi_notifications;
ERROR:  relation "xi_notifications" does not exist
STATEMENT:  VACUUM ANALYZE xi_notifications;
ERROR:  relation "xi_notifications" does not exist
STATEMENT:  VACUUM ANALYZE xi_notifications;
ERROR:  relation "xi_notifications" does not exist
STATEMENT:  VACUUM ANALYZE xi_notifications;
WARNING:  nonstandard use of \\ in a string literal at character 119
HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
WARNING:  nonstandard use of \\ in a string literal at character 119
HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
ERROR:  relation "xi_notifications" does not exist
STATEMENT:  VACUUM ANALYZE xi_notifications;
ERROR:  relation "xi_notifications" does not exist
STATEMENT:  VACUUM ANALYZE xi_notifications;
ERROR:  relation "xi_notifications" does not exist
STATEMENT:  VACUUM ANALYZE xi_notifications;
ERROR:  relation "xi_notifications" does not exist
STATEMENT:  VACUUM ANALYZE xi_notifications;
WARNING:  nonstandard use of \\ in a string literal at character 119
HINT:  Use the escape string syntax for backslashes, e.g., E'\\'.
ERROR:  relation "xi_notifications" does not exist
STATEMENT:  VACUUM ANALYZE xi_notifications;
ERROR:  relation "xi_notifications" does not exist
STATEMENT:  VACUUM ANALYZE xi_notifications;
ERROR:  relation "xi_notifications" does not exist
STATEMENT:  VACUUM ANALYZE xi_notifications;
ERROR:  relation "xi_notifications" does not exist
STATEMENT:  VACUUM ANALYZE xi_notifications;
ERROR:  relation "xi_notifications" does not exist
STATEMENT:  VACUUM ANALYZE xi_notifications;
ERROR:  relation "xi_notifications" does not exist
STATEMENT:  VACUUM ANALYZE xi_notifications;
ERROR:  relation "xi_notifications" does not exist
STATEMENT:  VACUUM ANALYZE xi_notifications;
ERROR:  relation "xi_notifications" does not exist
STATEMENT:  VACUUM ANALYZE xi_notifications;
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 »

It looks like there could be a setting in the /etc/php.ini file that needs to be changed.
Can you post the /etc/php.ini file here so we can see it?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked