Page 1 of 1

Using check_nagiosxiserver,and some error happened

Posted: Tue Oct 13, 2020 8:19 pm
by ahm002
We deployed check_nagiosxiserver.php to check one nagios server JOBS running status from another nagios server.
and sometimes it had errors like
"Error: Could not parse XML from http://hostIP/nagiosxi/ ()" and made alerts and notifications.
any clue why this would happend?
set up screenshot as attached files.
thanks

Re: Using check_nagiosxiserver,and some error happened

Posted: Wed Oct 14, 2020 2:01 pm
by benjaminsmith
Hi,

This is often caused by syntax issues with the URL, can you post the whole check command to thread, take about any sensitive information. In the CCM, find the service and click on the Run Check Command button to view the entire string.
[[email protected] ~]$ /usr/bin/php /usr/local/nagios/libexec/check_nagiosxiserver.php --address=$HOSTADDRESS$ --url='http://192.168.23.115/nagiosxi' --apikey='JdqXNOLmVmGgt7l5NNVDinUho2OUJuuscmIqDM2Xsu8RjJMK0fJbdcnTC7aYalfU' --mode=jobs
All jobs are running okay.
Regards,
Benjamin

Re: Using check_nagiosxiserver,and some error happened

Posted: Thu Oct 15, 2020 4:27 am
by ahm002
the result after press "run check command"
some data has been taken out for security reason.

[nagios@twxxxxx ~]$ /usr/bin/php /usr/local/nagios/libexec/check_nagiosxiserver.php --address=x.x.x.x --url=http://x.x.x.x/nagiosxi/ --username=nxxx --ticket="oooooo" --mode=jobs All jobs are running okay.

the problem doesn't happen all the time but soemtimes it did happen.
After sending out notifications, it will recover to OK by itself short time later ,quite annoying actually.

Re: Using check_nagiosxiserver,and some error happened

Posted: Thu Oct 15, 2020 1:14 pm
by benjaminsmith
Hi @ahm002,

Since this is happening on and off, let's increase the timeout on this check. The default value is only 10 seconds. You can increase this by adding the ---timeout=<seconds> option in the command string.

For example, to increase this to 30 seconds, the command would look like:

Code: Select all

/usr/local/nagios/libexec/check_nagiosxiserver.php --address=$HOSTADDRESS$ --url='http://192.168.23.115/nagiosxi' --apikey='JdqXNOLmVmGgt7l5NNVDinUho2OUJuuscmIqDM2Xsu8RjJMK0fJbdcnTC7aYalfU' --mode=jobs --timeout=30
Let me know if that helps reduce the number of notifications.

Benjamin

Re: Using check_nagiosxiserver,and some error happened

Posted: Mon Oct 19, 2020 12:11 am
by ahm002
So far so good,keep on watching. it hasnt happened for a week more.

Re: Using check_nagiosxiserver,and some error happened

Posted: Mon Oct 19, 2020 2:47 pm
by benjaminsmith
So far so good,keep on watching. it hasnt happened for a week more.
That's good to hear. We'll keep this open.

Thanks,
Benjamin