Page 1 of 1

Error parsing JSON for XI Daemon, Jobs and IO services

Posted: Wed Feb 06, 2019 8:14 am
by hbouma
Lately, we have been seeing issues where XI is unable to parse the JSON when checking another XI instance. This randomly happens and then goes back to normal. We are not yet sure what is happening to cause the JSON information to pass a body of "false".

I have turned on verbose output from the checks, and here is a sample output (Scrubbed for Hostnames, IP's and API Keys)

Code: Select all

ACCESSING URL: https://SERVERA/nagiosxi/api/v1/system/statusdetail?apikey=APIKEY
RESULT:
Array
(
[headers] => Array
(
[Date] => Mon, 04 Feb 2019 20:17:28 GMT
[Server] =>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
[X-Powered-By] => PHP/5.4.16
[Access-Control-Allow-Orgin] => *
[Access-Control-Allow-Methods] => *
[Content-Length] => 6
[Content-Type] => application/json
)

[body] => false

[info] => Array
(
[url] => https://SERVERA/nagiosxi/api/v1/system/statusdetail?apikey=APIKEY
[content_type] => application/json
[http_code] => 200
[header_size] => 283
[request_size] => 233
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
[total_time] => 0.268786
[namelookup_time] => 0.004181
[connect_time] => 0.004438
[pretransfer_time] => 0.131426
[size_upload] => 0
[size_download] => 6
[speed_download] => 22
[speed_upload] => 0
[download_content_length] => 6
[upload_content_length] => 0
[starttransfer_time] => 0.268781
[redirect_time] => 0
[certinfo] => Array
(
)

[primary_ip] => HOSTIP
[primary_port] => PORT
[local_ip] => LOCALIP
[local_port] => LOCALPORT
[redirect_url] => 
)

)
Error: Could not parse JSON from https://SERVERA/nagiosxi (false
)
We are running Nagios XI 5.5.7 on Red Hat 7 64bit VM's.

Re: Error parsing JSON for XI Daemon, Jobs and IO services

Posted: Wed Feb 06, 2019 4:24 pm
by tgriep
If the system is busy and does not return the json data quick enough, the check could timeout and cause the issue you are having.

Try this, edit the checks and add the following option to increase the timeout to 30 seconds and see if that is enough time for the check to run and stop the intermittent parsing errors.

Code: Select all

--timeout=30

Re: Error parsing JSON for XI Daemon, Jobs and IO services

Posted: Thu Feb 07, 2019 8:14 am
by hbouma
I have made this change. Since this is an intermittent issue, it may take up to a week before we know if this fixed out issue.

Re: Error parsing JSON for XI Daemon, Jobs and IO services

Posted: Thu Feb 07, 2019 1:04 pm
by tgriep
OK, I kind of figured that so report back if it happens again.