Page 1 of 2

Nagios XI Server config wizard

Posted: Sun Sep 27, 2020 11:54 am
by kalyanpabolu
Hi team,

We are trying to monitor one Nagios server from another Nagios server using Nagios XI Server config wizard. We are getting below error:

Error: Could not parse JSON from http://10.44.3.8/ ()

Could you please help here?

Re: Nagios XI Server config wizard

Posted: Mon Sep 28, 2020 2:42 pm
by benjaminsmith
Hi,

It's possible that it is just timing out before it's getting any data back, you can edit the check in the CCM and add the following option

Code: Select all

--timeout=30
See: Using The Core Config Manager For Service Management

If that does not resolve the error, please run the following check from the command line and post the output. Thanks, Benjamin

Code: Select all

/usr/bin/php /usr/local/nagios/libexec/check_nagiosxiserver.php --url='http://192.168.42.3/nagiosxi/' --apikey='APIKEY' --mode=daemons --debug=1

Re: Nagios XI Server config wizard

Posted: Tue Sep 29, 2020 11:50 am
by kalyanpabolu
Hello,

Adding timeout in command definition didn't help.

Below is the output of another command.

[root@vmaz-nagiosxi ~]# /usr/bin/php /usr/local/nagios/libexec/check_nagiosxiserver.php --url='http://10.44.3.8/' --apikey='*********************************' --mode=daemons --debug=1
ACCESSING URL: http://10.44.3.8//api/v1/system/statusdetail?
apikey=************************************
RESULT:
Array
(
[headers] => Array
(
[Status] => 404
)

[body] =>
[info] => Array
(
[url] => http://10.44.3.8//api/v1/system/statusdetail?
apikey=****************************************************
[content_type] => text/html; charset=iso-8859-1
[http_code] => 404
[header_size] => 176
[request_size] => 177
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
[total_time] => 0.000488
[namelookup_time] => 2.3E-5
[connect_time] => 0.000116
[pretransfer_time] => 0.000175
[size_upload] => 0
[size_download] => 224
[speed_download] => 224000
[speed_upload] => 0
[download_content_length] => 224
[upload_content_length] => -1
[starttransfer_time] => 0.000459
[redirect_time] => 0
[redirect_url] =>
[primary_ip] => 10.44.3.8
[certinfo] => Array
(
)

[primary_port] => 80
[local_ip] => 10.44.3.8
[local_port] => 55794
)

)
Error: Could not parse JSON from http://10.44.3.8/ ()
[root@vmaz-nagiosxi ~]#

Re: Nagios XI Server config wizard

Posted: Wed Sep 30, 2020 12:20 pm
by benjaminsmith
HI,

Thanks for running that command, it's getting an HTTP error. Could there by a proxy running or firewall getting in the way.

Are you able to ping the XI server?

Code: Select all

ping <ip address>
Can you run a nmap to check the ports open on that address as well?

Code: Select all

nmap <ip address>
Thanks, Benjamin

Re: Nagios XI Server config wizard

Posted: Thu Oct 01, 2020 10:04 am
by kalyanpabolu
Hello,

Below is the output:

[root@HO1-NAGIOSXI ~]# ping 10.44.3.8
PING 10.44.3.8 (10.44.3.8) 56(84) bytes of data.
64 bytes from 10.44.3.8: icmp_seq=1 ttl=61 time=125 ms
64 bytes from 10.44.3.8: icmp_seq=2 ttl=61 time=125 ms
64 bytes from 10.44.3.8: icmp_seq=3 ttl=61 time=125 ms
^C
--- 10.44.3.8 ping statistics ---
4 packets transmitted, 3 received, 25% packet loss, time 5ms
rtt min/avg/max/mdev = 125.221/125.317/125.468/0.108 ms
[root@HO1-NAGIOSXI ~]#
[root@HO1-NAGIOSXI ~]#
[root@HO1-NAGIOSXI ~]#
[root@HO1-NAGIOSXI ~]# nmap 10.44.3.8
Starting Nmap 7.70 ( https://nmap.org ) at 2020-10-01 19:02 +04
Nmap scan report for 10.44.3.8
Host is up (0.13s latency).
Not shown: 995 closed ports
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
443/tcp open https
3306/tcp open mysql
9090/tcp open zeus-admin

Nmap done: 1 IP address (1 host up) scanned in 3.67 seconds
[root@HO1-NAGIOSXI ~]#



=====================


[root@vmaz-nagiosxi ~]# ping 10.1.0.220
PING 10.1.0.220 (10.1.0.220) 56(84) bytes of data.
64 bytes from 10.1.0.220: icmp_seq=1 ttl=61 time=125 ms
64 bytes from 10.1.0.220: icmp_seq=2 ttl=61 time=125 ms
64 bytes from 10.1.0.220: icmp_seq=3 ttl=61 time=125 ms
64 bytes from 10.1.0.220: icmp_seq=4 ttl=61 time=125 ms
^C
--- 10.1.0.220 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 7ms
rtt min/avg/max/mdev = 125.068/125.121/125.174/0.434 ms
[root@vmaz-nagiosxi ~]#
[root@vmaz-nagiosxi ~]#
[root@vmaz-nagiosxi ~]#
[root@vmaz-nagiosxi ~]# nmap 10.1.0.220
Starting Nmap 7.70 ( https://nmap.org ) at 2020-10-01 19:03 +04
Nmap scan report for 10.1.0.220
Host is up (0.13s latency).
Not shown: 996 filtered ports
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
443/tcp open https
9090/tcp open zeus-admin

Nmap done: 1 IP address (1 host up) scanned in 43.15 seconds
[root@vmaz-nagiosxi ~]#

Re: Nagios XI Server config wizard

Posted: Thu Oct 01, 2020 4:01 pm
by benjaminsmith
Hi,

Perfect, that looks good. What version is this XI server running? The API functionality might not be available on this system.

Thanks,
Benjamin

Re: Nagios XI Server config wizard

Posted: Mon Oct 05, 2020 5:03 am
by pingreply
Hi,

I just had the same issue. The problem is that the script tries to get data from /api/v1..<etc>
But current location is /nagiosxi/api/v1..<etc>

I changed it in the php-file and this works on my side.

Regards, Edwin

Re: Nagios XI Server config wizard

Posted: Mon Oct 05, 2020 7:53 am
by kalyanpabolu
Hello,

We are using Nagios XI 5.7.3.

Re: Nagios XI Server config wizard

Posted: Tue Oct 06, 2020 8:40 am
by benjaminsmith
Hi,

@@pingreply, Thank you!

Let's just make sure you have the latest version of the Nagios XI Server wizard, it should be 1.3.3. To confirm this go to Admin > System Extensions > Manage Config Wizards and scroll down to the XI Wizard.

If it's running the latest version, as suggested, try running the following API command to verify if you're able to get a valid return and let us know the results.

Code: Select all

curl -XGET "http://<ip_address/nagiosxi/api/v1/system/status?apikey=<the api key>&pretty=1"

Re: Nagios XI Server config wizard

Posted: Tue Oct 06, 2020 8:44 am
by kalyanpabolu
Hello,

Below is the output:

[root@HO1-NAGIOSXI ~]# curl -XGET "http://10.1.0.220/api/v1/system/status? ... ********=1"
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /api/v1/system/status was not found on this server.</p>
</body></html>
[root@HO1-NAGIOSXI ~]#