Page 2 of 2

Re: After Upgrade - XI System Component Status

Posted: Mon Jul 16, 2018 3:58 pm
by bosecorp
here are the most recent errors

# tail -f /var/log/httpd/error_log
[Mon Jul 16 17:02:46.849658 2018] [:error] [pid 39838] [client 10.144.1.77:43912] PHP Notice: unserialize(): Error at offset 355 of 572 bytes in /usr/local/nagiosxi/html/includes/utils-xmlsysstat.inc.php on line 44, referer: http://nagiosxi/nagiosxi/index.php?
[Mon Jul 16 17:02:46.849707 2018] [:error] [pid 39838] [client 10.144.1.77:43912] PHP Warning: Invalid argument supplied for foreach() in /usr/local/nagiosxi/html/includes/utils-xmlsysstat.inc.php on line 88, referer: http://nagiosxi/nagiosxi/index.php?
[Mon Jul 16 17:02:47.410102 2018] [:error] [pid 41678] [client 10.144.1.77:43920] PHP Notice: unserialize(): Error at offset 355 of 572 bytes in /usr/local/nagiosxi/html/includes/utils-xmlsysstat.inc.php on line 44, referer: http://nagiosxi/nagiosxi/index.php?
[Mon Jul 16 17:02:47.410148 2018] [:error] [pid 41678] [client 10.144.1.77:43920] PHP Warning: Invalid argument supplied for foreach() in /usr/local/nagiosxi/html/includes/utils-xmlsysstat.inc.php on line 88, referer: http://nagiosxi/nagiosxi/index.php?
[Mon Jul 16 17:03:05.757740 2018] [:error] [pid 42419] [client 10.144.2.183:10233] PHP Notice: Use of undefined constant Hostgroup - assumed 'Hostgroup' in /usr/local/nagiosxi/html/includes/components/bbmap/bbmap.inc.php on line 193, referer: http://nagiosxi/nagiosxi/dashboards/das ... ?id=Ha3f05
[Mon Jul 16 17:03:05.803746 2018] [:error] [pid 42760] [client 10.144.2.183:10235] PHP Notice: Use of undefined constant Hostgroup - assumed 'Hostgroup' in /usr/local/nagiosxi/html/includes/components/bbmap/bbmap.inc.php on line 193, referer: http://nagiosxi/nagiosxi/dashboards/das ... ?id=Ha3f05
[Mon Jul 16 17:03:06.411491 2018] [:error] [pid 42417] [client 10.144.1.77:43958] PHP Notice: unserialize(): Error at offset 355 of 572 bytes in /usr/local/nagiosxi/html/includes/utils-xmlsysstat.inc.php on line 44, referer: http://nagiosxi/nagiosxi/
[Mon Jul 16 17:03:06.411518 2018] [:error] [pid 42417] [client 10.144.1.77:43958] PHP Warning: Invalid argument supplied for foreach() in /usr/local/nagiosxi/html/includes/utils-xmlsysstat.inc.php on line 88, referer: http://nagiosxi/nagiosxi/
[Mon Jul 16 17:03:06.466786 2018] [:error] [pid 42755] [client 10.144.2.183:10205] PHP Notice: unserialize(): Error at offset 355 of 572 bytes in /usr/local/nagiosxi/html/includes/utils-xmlsysstat.inc.php on line 44, referer: http://nagiosxi/nagiosxi/
[Mon Jul 16 17:03:06.466824 2018] [:error] [pid 42755] [client 10.144.2.183:10205] PHP Warning: Invalid argument supplied for foreach() in /usr/local/nagiosxi/html/includes/utils-xmlsysstat.inc.php on line 88, referer: http://nagiosxi/nagiosxi/

Re: After Upgrade - XI System Component Status

Posted: Tue Jul 17, 2018 10:11 am
by jomann
What language are you using on the system/in the XI interface?

We may need to wipe some of the sysstat data from the DB and let it re-populate.

Re: After Upgrade - XI System Component Status

Posted: Wed Jul 18, 2018 10:21 am
by bosecorp
If we referring to interface language, then it is English.

Re: After Upgrade - XI System Component Status

Posted: Wed Jul 18, 2018 11:58 am
by jomann
Can you run this against the Nagios XI database? This will clear out the sysstat values being returned. It seems like PHP is having a hard time reading the data that is in the DB.

Code: Select all

mysql -u root -pnagiosxi -e "UPDATE nagiosxi.xi_sysstat SET value = '' WHERE metric = 'daemons';"
Please also run the following so we can see what the collation is:

Code: Select all

mysql -u root -pnagiosxi -e "SHOW FULL COLUMNS FROM nagiosxi.xi_sysstat;"

Re: After Upgrade - XI System Component Status

Posted: Wed Jul 18, 2018 12:42 pm
by bosecorp
We ran the first command to clear the sysstat values.


And below is the output for mysql -u root -pnagiosxi -e "SHOW FULL COLUMNS FROM nagiosxi.xi_sysstat;"
+-------------+--------------+-------------------+------+-----+-------------------+-----------------------------+---------------------------------+---------+
| Field | Type | Collation | Null | Key | Default | Extra | Privileges | Comment |
+-------------+--------------+-------------------+------+-----+-------------------+-----------------------------+---------------------------------+---------+
| sysstat_id | int(11) | NULL | NO | PRI | NULL | auto_increment | select,insert,update,references | |
| metric | varchar(128) | latin1_swedish_ci | NO | MUL | NULL | | select,insert,update,references | |
| value | text | latin1_swedish_ci | YES | | NULL | | select,insert,update,references | |
| update_time | timestamp | NULL | NO | | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP | select,insert,update,references | |
+-------------+--------------+-------------------+------+-----+-------------------+-----------------------------+---------------------------------+---------+

Re: After Upgrade - XI System Component Status

Posted: Wed Jul 18, 2018 1:29 pm
by jomann
That should be normal, we can try using mb_unserialize instead of unserialize in the line that we are getting an error from.

Open up /usr/local/nagiosxi/html/includes/utils-xmlsysstat.inc.php and find line 44, replace:

Code: Select all

$value = unserialize($rawvalue);
with the following:

Code: Select all

$value = mb_unserialize($rawvalue);
This should make the status icons work in your interface.

Re: After Upgrade - XI System Component Status

Posted: Wed Jul 18, 2018 4:48 pm
by bosecorp
After changing the file utils-xmlsysstat.inc.php, the status is showing fine.

But there are 2 diff things that we have observed after upgrade, if its php.
I m not sure if this is related we are having 2 other error with php

1) On Nagvis we are having below error.

Error: (0) Undefined property: CorePDOHandler::$data
URL: /nagvis/server/core/ajax_handler.php?mod=Map&act=getObjectStates&show=RDG-Enviroment&ty=state&header_menu=1&hover_menu=1&context_menu=1&zoom=100&f[]=maincfg,maincfg,1531404862&f[]=map,RDG-Enviroment,1531404888&_ajaxid=1531935925
File: /usr/local/nagvis/share/server/core/classes/CorePDOHandler.php
Line: 306
#0 /usr/local/nagvis/share/server/core/classes/CorePDOHandler.php(306): nagvisExceptionErrorHandler(8, 'Undefined prope...', '/usr/local/nagv...', 306, Array)
#1 /usr/local/nagvis/share/server/core/classes/CorePDOHandler.php(332): CorePDOHandler->prep('SELECT? ...')
#2 /usr/local/nagvis/share/server/core/classes/GlobalBackendPDO.php(485): CorePDOHandler->query('SELECT? ...', Array)
#3 /usr/local/nagvis/share/server/core/classes/CoreBackendMgmt.php(478): GlobalBackendPDO->getHostState(Array, 0, Array)
#4 /usr/local/nagvis/share/server/core/classes/CoreBackendMgmt.php(169): CoreBackendMgmt->fetchStateCounts('nagiosxi', 'hostState', 0, Array)
#5 /usr/local/nagvis/share/server/core/classes/NagVisMap.php(58): CoreBackendMgmt->execute()
#6 /usr/local/nagvis/share/server/core/classes/CoreModMap.php(349): NagVisMap->__construct(Object(GlobalMapCfg), true, true)
#7 /usr/local/nagvis/share/server/core/classes/CoreModMap.php(108): CoreModMap->getObjectStates()
#8 /usr/local/nagvis/share/server/core/functions/index.php(120): CoreModMap->handleAction()
#9 /usr/local/nagvis/share/server/core/ajax_handler.php(59): require('/usr/local/nagv...')
#10 {main}


2) The only php plugin to pull aws ec2 instance status is throwing authentication error, though the authentication are correct.


Please advise.


Thanks!

Re: After Upgrade - XI System Component Status

Posted: Thu Jul 19, 2018 7:15 am
by scottwilkerson
In NagVis can you still reach the "Need Help" -> Nagvis support Information meny item?

If so what version is listed next to "NagVis Version"?

Re: After Upgrade - XI System Component Status

Posted: Thu Jul 19, 2018 10:47 am
by bosecorp
Yes i can reach the NagVis support information menu.
And the error on NagVis doesn't seems to pop up after that modification in the file.

The status is showing fine as well on nagios.

You can close this case.


Thankyou.

Re: After Upgrade - XI System Component Status

Posted: Thu Jul 19, 2018 10:51 am
by jomann
Great, closing this then.