5.6.5 Upgrade - PHP warning.
5.6.5 Upgrade - PHP warning.
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.
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
Nagios Fusion 2024R1.0.2
Re: 5.6.5 Upgrade - PHP warning.
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/nagiosimAs of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: 5.6.5 Upgrade - PHP warning.
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?
<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
Nagios Fusion 2024R1.0.2
Re: 5.6.5 Upgrade - PHP warning.
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:
(you'll need to add "-h db_ip_addr" and change the username and password if the database is not the default)
Code: Select all
echo "show tables;" | mysql -uroot -pnagiosxi -Dnagiosxi
echo "describe xi_mibs" | mysql -uroot -pnagiosxi -DnagiosxiAs of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: 5.6.5 Upgrade - PHP warning.
"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.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:
(you'll need to add "-h db_ip_addr" and change the username and password if the database is not the default)Code: Select all
echo "show tables;" | mysql -uroot -pnagiosxi -Dnagiosxi echo "describe xi_mibs" | mysql -uroot -pnagiosxi -Dnagiosxi
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
Nagios Fusion 2024R1.0.2
Re: 5.6.5 Upgrade - PHP warning.
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.
Re: 5.6.5 Upgrade - PHP warning.
Doing so results in a page full of errors stating the following over and over: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.
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
Nagios Fusion 2024R1.0.2
Re: 5.6.5 Upgrade - PHP warning.
What version of postgres is the server running?
Run this and post the output.
Get this file and upload it to the ticket so we can view it.
Run this and post the output.
Code: Select all
psql -VCode: Select all
/var/lib/pgsql/data/pg_log/postgresql-Fri.logBe sure to check out our Knowledgebase for helpful articles and solutions!
Re: 5.6.5 Upgrade - PHP warning.
1. psql (PostgreSQL) 8.4.20tgriep wrote:What version of postgres is the server running?
Run this and post the output.Get this file and upload it to the ticket so we can view it.Code: Select all
psql -VCode: Select all
/var/lib/pgsql/data/pg_log/postgresql-Fri.log
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
Nagios Fusion 2024R1.0.2
Re: 5.6.5 Upgrade - PHP warning.
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?
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!