I was trying to recreate it myself. I set up 2 clean CentOS installs of 2012 and it worked fine between the 2.
I did not how ever enable and try using ssl. I could be wrong, but it's the only thing really out-of-the-ordinary that I can think of that might be fouling it up.
xi 2012R1.0 Breaks monitoring another Nagios xi server
-
- Posts: 256
- Joined: Wed May 25, 2011 10:51 am
- Location: Springfield, IL
Re: xi 2012R1.0 Breaks monitoring another Nagios xi server
Dev & Prod xi: Debian 12 - Nagios xi 2024R1.3
-
- Posts: 4380
- Joined: Mon Jun 14, 2010 10:21 am
Re: xi 2012R1.0 Breaks monitoring another Nagios xi server
Can you verify in the Core Config Manager->Services and see if http:// is maybe hard-coded in the check command for those services?
-
- Posts: 256
- Joined: Wed May 25, 2011 10:51 am
- Location: Springfield, IL
Re: xi 2012R1.0 Breaks monitoring another Nagios xi server
I temporarily enabled http on the main xi server and changed the check (running at command line) to http and it worked... so it is definitely something with https breaking it.
check_xi_nagiosxiserver
Looks ok there.mguthrie wrote:Can you verify in the Core Config Manager->Services and see if http:// is maybe hard-coded in the check command for those services?
check_xi_nagiosxiserver
Code: Select all
/usr/bin/php $USER1$/check_nagiosxiserver.php $ARG1$
Dev & Prod xi: Debian 12 - Nagios xi 2024R1.3
-
- Posts: 4380
- Joined: Mon Jun 14, 2010 10:21 am
Re: xi 2012R1.0 Breaks monitoring another Nagios xi server
Just to check and see something, try updating line 535 of /usr/local/nagios/libexec/check_nagiosxiserver.php from:
To
Code: Select all
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
Code: Select all
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
-
- Posts: 256
- Joined: Wed May 25, 2011 10:51 am
- Location: Springfield, IL
Re: xi 2012R1.0 Breaks monitoring another Nagios xi server
I just figured it out!!!
I enabled debugging in the /usr/local/nagios/libexec/check_nagiosxiserver.php file.
With the check not working, I got:
Well hold on a minute... why is it telling it to use port 80 over https? That will never work...
So I adjusted the check command to:
And bam, it worked. So not only is https:// necessary, but the :443 port now has to be specified.
I enabled debugging in the /usr/local/nagios/libexec/check_nagiosxiserver.php file.
With the check not working, I got:
Code: Select all
[root@nagios httpd]# /usr/bin/php /usr/local/nagios/libexec/check_nagiosxiserver.php --address=mydomain.com --url=https://mydomain.com/nagiosxi --username=nagiosadmin --ticket="xxxxxxxx" --mode=load --warn="5,4,4" --crit="10,10,7"
ACCESSING URL: https://mydomain.com/nagiosxi/backend/?username=nagiosadmin&ticket=xxxxxxx&cmd=getsysstat
RESULT:
Array
(
[headers] => Array
(
)
[body] =>
[info] => Array
(
[url] => https://mydomain.com:80/nagiosxi/backend/
[content_type] =>
[http_code] => 0
[header_size] => 0
[request_size] => 0
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
[total_time] => 0
[namelookup_time] => 0.001075
[connect_time] => 0.003838
[pretransfer_time] => 0
[size_upload] => 0
[size_download] => 0
[speed_download] => 0
[speed_upload] => 0
[download_content_length] => -1
[upload_content_length] => -1
[starttransfer_time] => 0
[redirect_time] => 0
[certinfo] => Array
(
)
)
)
Error: Could not parse XML from https://mydomain.com/nagiosxi ()
So I adjusted the check command to:
Code: Select all
[root@nagios httpd]# /usr/bin/php /usr/local/nagios/libexec/check_nagiosxiserver.php --address=mydomain.com --url=https://mydomain.com:443/nagiosxi --username=nagiosadmin --ticket="xxxxxxx" --mode=load --warn="5,4,4" --crit="10,10,7"
Dev & Prod xi: Debian 12 - Nagios xi 2024R1.3
-
- Posts: 256
- Joined: Wed May 25, 2011 10:51 am
- Location: Springfield, IL
Re: xi 2012R1.0 Breaks monitoring another Nagios xi server
I checked this for you, but that wasn't it. Still need :443 in the urlmguthrie wrote:Just to check and see something, try updating line 535 of /usr/local/nagios/libexec/check_nagiosxiserver.php from:
ToCode: Select all
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
Code: Select all
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
Dev & Prod xi: Debian 12 - Nagios xi 2024R1.3
-
- Posts: 4380
- Joined: Mon Jun 14, 2010 10:21 am
Re: xi 2012R1.0 Breaks monitoring another Nagios xi server
Ok, I'll have to take a look at that function and see what's going on. Obviously it's "supposed" to default to 443 for SSL, but evidently not ; ) Thanks for the report!