Using check_nagiosxiserver,and some error happened

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
ahm002
Posts: 16
Joined: Mon Jun 01, 2020 4:04 am

Using check_nagiosxiserver,and some error happened

Post 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
You do not have the required permissions to view the files attached to this post.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Using check_nagiosxiserver,and some error happened

Post 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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
ahm002
Posts: 16
Joined: Mon Jun 01, 2020 4:04 am

Re: Using check_nagiosxiserver,and some error happened

Post 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.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Using check_nagiosxiserver,and some error happened

Post 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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
ahm002
Posts: 16
Joined: Mon Jun 01, 2020 4:04 am

Re: Using check_nagiosxiserver,and some error happened

Post by ahm002 »

So far so good,keep on watching. it hasnt happened for a week more.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Using check_nagiosxiserver,and some error happened

Post 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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked