Page 1 of 1

Unable to monitor Nagios system after 5.7.1 upgrade

Posted: Tue Jul 07, 2020 8:20 am
by vijilants
Nagios XI - System Info
System
Nagios XI version: 5.7.1
Release info: cedarnms1 3.10.0-957.5.1.el7.x86_64 x86_64
CentOS Linux release 7.6.1810 (Core)
Gnome is not installed


Hi,

Prior to upgrading our Nagios system to 5.7.1 we were self monitoring the system which had been done using the Monitor Nagios XI server wizard.

This was working before the upgarde, however after the upgrade we were seeing these error messages:

Code: Select all

View service status details for this host
	
I/O Wait
	Critical 	6m 42s 	5/5 	2020-07-07 07:24:44 	Error: Could not parse JSON from http://192.168.42.3/nagiosxi/ ()
	
Load
	Critical 	6m 37s 	5/5 	2020-07-07 07:24:49 	Error: Could not parse JSON from http://192.168.42.3/nagiosxi/ ()
	
Nagios XI Daemons
	Critical 	6m 23s 	5/5 	2020-07-07 07:25:04 	Error: Could not parse JSON from http://192.168.42.3/nagiosxi/ ()
	
Nagios XI Jobs
	Critical 	6m 20s 	5/5 	2020-07-07 07:25:05 	Error: Could not parse JSON from http://192.168.42.3/nagiosxi/ ()
So I deleted these services and tried agan, but agaiin the same thing happened. This is occuring on both our Nagios systems.

Note we are not moniroring one system from the other but are pointing the wizard towards itself.

Can you please advise ?

Many Thanks

Re: Unable to monitor Nagios system after 5.7.1 upgrade

Posted: Tue Jul 07, 2020 3:00 pm
by scottwilkerson
Can you run the following from the CLI replacing APIKEY with yours and show the output

Code: Select all

/usr/bin/php /usr/local/nagios/libexec/check_nagiosxiserver.php --url='http://192.168.42.3/nagiosxi/' --apikey='APIKEY' --mode=daemons --debug=1
Thanks

Re: Unable to monitor Nagios system after 5.7.1 upgrade

Posted: Thu Jul 09, 2020 5:47 am
by vijilants
Hi Scott,

Please see below

Thanks

Code: Select all

/usr/bin/php /usr/local/nagios/libexec/check_nagiosxiserver.php --url='http://192.168.42.3/nagiosxi/' --apikey='0jksm202' --mode=daemons --debug=1
ACCESSING URL: http://192.168.42.3/nagiosxi/api/v1/system/statusdetail?apikey=0jksm202
RESULT:
Array
(
    [headers] => Array
        (
            [Date] => Thu, 09 Jul 2020 10:45:25 GMT
            [Server] => Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/5.4.16
            [X-Powered-By] => PHP/5.4.16
            [Access-Control-Allow-Origin] => *
            [Access-Control-Allow-Methods] => POST, GET, OPTIONS, DELETE, PUT
            [Content-Length] => 2389
            [Content-Type] => application/json
        )

    [body] =>     <p><pre>SQL Error [nagiosxi] : ERROR:  syntax error at or near "system"
LINE 1: ... 06:45:25','API','nagiosadmin',16,'API endpoint \'system/sta...
                                                             ^</pre></p>
{"iostat":{"updated":"2020-07-09 06:45:06.457122","user":"28.46","nice":"0.00","system":"7.21","iowait":"0.01","steal":"0.00","idle":"64.33"},"sysstat":{"last_check":"1594291501"},"perfdataprocessor":{"last_check":"1594291521"},"dbbackend":{"last_checkin":"2020-07-03 05:45:42","bytes_processed":"281","entries_processed":"0","connect_time":"2020-07-03 05:45:42","disconnect_time":"0000-00-00 00:00:00"},"load":{"updated":"2020-07-09 06:45:21.63107","load1":"8.55","load5":"9.74","load15":"10.02"},"memory":{"updated":"2020-07-09 06:45:21.642906","total":"31877","used":"3182","free":"2696","shared":"1656","buffers":"25998","cached":"26429"},"swap":{"updated":"2020-07-09 06:45:21.653194","total":"30715","used":"368","free":"30347"},"feedprocessor":{"last_check":"1594291521"},"cmdsubsys":{"last_check":"1594291525"},"reportengine":{"last_check":"1594291501"},"nom":{"last_check":"1594291501"},"deadpool_reaper":{"last_check":"1594291501"},"dbmaint":{"last_check":"1594291501"},"cleaner":{"last_check":"1594291501"},"daemons":{"updated":"2020-07-09 06:45:21.5507","daemon":[{"@attributes":{"id":"nagioscore"},"name":"nagios","output":"           \u2514\u250021771 n\/a","return_code":"0","status":"0"},{"@attributes":{"id":"pnp"},"name":"npcd","output":"           \u2023 25848 \/usr\/local\/nagios\/bin\/npcd -d -f \/usr\/local\/nagios\/etc\/pnp\/npcd.cfg","return_code":"0","status":"0"}]},"eventman":{"last_check":"1594291525"},"nagioscore":{"updated":"2020-07-09 06:45:21.618788","activehostchecks":{"val1":"300","val5":"312","val15":"312"},"passivehostchecks":{"val1":"0","val5":"0","val15":"0"},"activeservicechecks":{"val1":"4483","val5":"4689","val15":"4689"},"passiveservicechecks":{"val1":"0","val5":"0","val15":"3"},"activehostcheckperf":{"min_latency":"0","max_latency":"0.5126339793205261","avg_latency":"0.007534044275690242","min_execution_time":"0.001","max_execution_time":"4.016952","avg_execution_time":"0.16141126898734187"},"activeservicecheckperf":{"min_latency":"0","max_latency":"0.9860100150108337","avg_latency":"0.009014606733179144","min_execution_time":"0","max_execution_time":"4.006606","avg_execution_time":"0.1672040824304224"}}}

    [info] => Array
        (
            [url] => http://192.168.42.3/nagiosxi/api/v1/system/statusdetail?apikey=0jksm202
            [content_type] => application/json
            [http_code] => 200
            [header_size] => 293
            [request_size] => 132
            [filetime] => -1
            [ssl_verify_result] => 0
            [redirect_count] => 0
            [total_time] => 0.228423
            [namelookup_time] => 5.2E-5
            [connect_time] => 0.000145
            [pretransfer_time] => 0.000229
            [size_upload] => 0
            [size_download] => 2389
            [speed_download] => 10458
            [speed_upload] => 0
            [download_content_length] => 2389
            [upload_content_length] => 0
            [starttransfer_time] => 0.228389
            [redirect_time] => 0
            [certinfo] => Array
                (
                )

            [primary_ip] => 192.168.42.3
            [primary_port] => 80
            [local_ip] => 192.168.42.3
            [local_port] => 43568
            [redirect_url] => 
        )

)
Error: Could not parse JSON from http://192.168.42.3/nagiosxi/ (    <p><pre>SQL Error [nagiosxi] : ERROR:  syntax error at or near "system"
LINE 1: ... 06:45:25','API','nagiosadmin',16,'API endpoint \'system/sta...
                                                             ^</pre></p>
{"iostat":{"updated":"2020-07-09 06:45:06.457122","user":"28.46","nice":"0.00","system":"7.21","iowait":"0.01","steal":"0.00","idle":"64.33"},"sysstat":{"last_check":"1594291501"},"perfdataprocessor":{"last_check":"1594291521"},"dbbackend":{"last_checkin":"2020-07-03 05:45:42","bytes_processed":"281","entries_processed":"0","connect_time":"2020-07-03 05:45:42","disconnect_time":"0000-00-00 00:00:00"},"load":{"updated":"2020-07-09 06:45:21.63107","load1":"8.55","load5":"9.74","load15":"10.02"},"memory":{"updated":"2020-07-09 06:45:21.642906","total":"31877","used":"3182","free":"2696","shared":"1656","buffers":"25998","cached":"26429"},"swap":{"updated":"2020-07-09 06:45:21.653194","total":"30715","used":"368","free":"30347"},"feedprocessor":{"last_check":"1594291521"},"cmdsubsys":{"last_check":"1594291525"},"reportengine":{"last_check":"1594291501"},"nom":{"last_check":"1594291501"},"deadpool_reaper":{"last_check":"1594291501"},"dbmaint":{"last_check":"1594291501"},"cleaner":{"last_check":"1594291501"},"daemons":{"updated":"2020-07-09 06:45:21.5507","daemon":[{"@attributes":{"id":"nagioscore"},"name":"nagios","output":"           \u2514\u250021771 n\/a","return_code":"0","status":"0"},{"@attributes":{"id":"pnp"},"name":"npcd","output":"           \u2023 25848 \/usr\/local\/nagios\/bin\/npcd -d -f \/usr\/local\/nagios\/etc\/pnp\/npcd.cfg","return_code":"0","status":"0"}]},"eventman":{"last_check":"1594291525"},"nagioscore":{"updated":"2020-07-09 06:45:21.618788","activehostchecks":{"val1":"300","val5":"312","val15":"312"},"passivehostchecks":{"val1":"0","val5":"0","val15":"0"},"activeservicechecks":{"val1":"4483","val5":"4689","val15":"4689"},"passiveservicechecks":{"val1":"0","val5":"0","val15":"3"},"activehostcheckperf":{"min_latency":"0","max_latency":"0.5126339793205261","avg_latency":"0.007534044275690242","min_execution_time":"0.001","max_execution_time":"4.016952","avg_execution_time":"0.16141126898734187"},"activeservicecheckperf":{"min_latency":"0","max_latency":"0.9860100150108337","avg_latency":"0.009014606733179144","min_execution_time":"0","max_execution_time":"4.006606","avg_execution_time":"0.1672040824304224"}}}
)

Re: Unable to monitor Nagios system after 5.7.1 upgrade

Posted: Thu Jul 09, 2020 9:21 am
by scottwilkerson
I think we need to modify a setting in your postgresql.conf

Lets run the following:

Code: Select all

echo "standard_conforming_strings = off" >> /var/lib/pgsql/data/postgresql.conf
systemctl restart postgresql

Re: Unable to monitor Nagios system after 5.7.1 upgrade

Posted: Thu Jul 09, 2020 9:58 am
by vijilants
Thanks Scott.

I ran you fix on both systems and all good now ...Thank you !

Thanks

Re: Unable to monitor Nagios system after 5.7.1 upgrade

Posted: Thu Jul 09, 2020 10:04 am
by scottwilkerson
vijilants wrote:Thanks Scott.

I ran you fix on both systems and all good now ...Thank you !

Thanks
Great!

Locking thread