Page 1 of 3
check_nagiosxiserver.php issue from NagiosXI
Posted: Tue Oct 13, 2015 3:20 am
by rajasegar
This check based on /usr/bin/php /usr/local/nagios/libexec/check_nagiosxiserver.php was working fine for ages.
Suddenly decided to fail for no reason and I have no idea what is the problem.
IP address masked.
This works fine from CCM Test Check Command
Code: Select all
COMMAND: /usr/bin/php /usr/local/nagios/libexec/check_nagiosxiserver.php --address=10.10.10.10 --url=http://10.10.10.10/nagiosxi/ --username=nagiosadmin --ticket="ei55555" --mode=iowait --warn="10" --crit="15"
OUTPUT: Ok: I/O Wait = 0.73%|iowait=0.73%;10;15;;
Works fine from command line also.
Code: Select all
[nagios@nagiosprodxi1 ~]$ /usr/bin/php /usr/local/nagios/libexec/check_nagiosxiserver.php --address=10.10.10.10 --url=http://10.10.10.10/nagiosxi/ --username=nagiosadmin --ticket="ei55555" --mode=iowait --warn="10" --crit="15"
Ok: I/O Wait = 0.77%|iowait=0.77%;10;15;;
[nagios@nagiosprodxi1 ~]$
However under nagiosxi it gives
Error: Could not parse XML from
http://10.10.10.10/nagiosxi/ ()
Capture.JPG
Can someone advice what could be the problem?
Re: check_nagiosxiserver.php issue from NagiosXI
Posted: Tue Oct 13, 2015 9:08 am
by hsmith
Are you running SSL on the server you are trying to check?
Re: check_nagiosxiserver.php issue from NagiosXI
Posted: Wed Oct 14, 2015 6:55 pm
by rajasegar
hsmith wrote:Are you running SSL on the server you are trying to check?
No SSL.
Re: check_nagiosxiserver.php issue from NagiosXI
Posted: Wed Oct 14, 2015 7:06 pm
by Box293
Are you checking the XI server locally or are you checking remote XI servers?
What is the version of the XI server(s).
Is Mod_Gearman executing these checks? If yes, what happens when you test on the command line of all your workers?
Re: check_nagiosxiserver.php issue from NagiosXI
Posted: Wed Oct 14, 2015 7:23 pm
by rajasegar
Box293 wrote:Are you checking the XI server locally or are you checking remote XI servers?
What is the version of the XI server(s).
Is Mod_Gearman executing these checks? If yes, what happens when you test on the command line of all your workers?
It is checking locally. Mod gearman is not handling this check.
V5.2 as per my signature.
Re: check_nagiosxiserver.php issue from NagiosXI
Posted: Wed Oct 14, 2015 7:34 pm
by Box293
Can you edit the check in CCM and add --debug=1 to the end of the $ARG1$ field.
Save and apply config.
Go and force the service to perform the check.
Does this output debug information in the status output?
Re: check_nagiosxiserver.php issue from NagiosXI
Posted: Wed Oct 14, 2015 7:39 pm
by rajasegar
I just checked from the mod_gearman servers. It is working fine also.
As updated earlier I am not using gearman for this check.
Re: check_nagiosxiserver.php issue from NagiosXI
Posted: Wed Oct 14, 2015 7:50 pm
by rajasegar
Box293 wrote:Can you edit the check in CCM and add --debug=1 to the end of the $ARG1$ field.
Save and apply config.
Go and force the service to perform the check.
Does this output debug information in the status output?
Code: Select all
ACCESSING URL: http://10.10.10.10/nagiosxi//backend/?username=nagiosadmin&ticket=ei555555&cmd=getsysstat
RESULT:
Array
(
[headers] => Array
(
)
[body] =>
[info] => Array
(
[url] => http://10.10.10.10:80/nagiosxi//backend/
[content_type] =>
[http_code] => 0
[header_size] => 0
[request_size] => 314
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
[total_time] => 10.009108
[namelookup_time] => 0.000122
[connect_time] => 0.000677
[pretransfer_time] => 0.000682
[size_upload] => 51
[size_download] => 0
[speed_download] => 0
[speed_upload] => 5
[download_content_length] => -1
[upload_content_length] => 0
[starttransfer_time] => 0
[redirect_time] => 0
[certinfo] => Array
(
)
)
)
Error: Could not parse XML from http://10.17.19.235/nagiosxi/ ()
Re: check_nagiosxiserver.php issue from NagiosXI
Posted: Thu Oct 15, 2015 12:40 pm
by tgriep
The only thing that looks different is that the ticket number from when you are running the command from the command line is different when you ran the debug, that may be causing it.
Can you post the service check here so we can review it?
Re: check_nagiosxiserver.php issue from NagiosXI
Posted: Thu Oct 15, 2015 6:29 pm
by rajasegar
tgriep wrote:The only thing that looks different is that the ticket number from when you are running the command from the command line is different when you ran the debug, that may be causing it.
Can you post the service check here so we can review it?
No. I masked the ticket number in the original post but forgot to change in the output.
Please note that this started giving problems only after the 5.2 upgrade.
Code: Select all
define service {
host_name nagiosprodxi1
service_description Nagios: I/O Wait
use STPT-Standard-Nagios-Services
check_command check_xi_nagiosxiserver!--address=10.10.10.10 --url=http://10.10.10.10/nagiosxi/ --username=nagiosadmin --ticket="ei555555" --mode=iowait --warn="10" --crit="15" --debug=1!!!!!!!
max_check_attempts 2
check_interval 5
retry_interval 5
register 1
}