Nagios xi Server config wizard

This support forum board is for support questions relating to Nagios xi, our flagship commercial network monitoring solution.
kalyanpabolu
Posts: 246
Joined: Fri Jul 03, 2020 4:18 am

Nagios xi Server config wizard

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

Re: Nagios xi Server config wizard

Post 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
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!
kalyanpabolu
Posts: 246
Joined: Fri Jul 03, 2020 4:18 am

Re: Nagios xi Server config wizard

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

Re: Nagios xi Server config wizard

Post 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
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!
kalyanpabolu
Posts: 246
Joined: Fri Jul 03, 2020 4:18 am

Re: Nagios xi Server config wizard

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

Re: Nagios xi Server config wizard

Post 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
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!
pingreply
Posts: 1
Joined: Sat Jun 13, 2020 3:10 am

Re: Nagios xi Server config wizard

Post 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
kalyanpabolu
Posts: 246
Joined: Fri Jul 03, 2020 4:18 am

Re: Nagios xi Server config wizard

Post by kalyanpabolu »

Hello,

We are using Nagios xi 5.7.3.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Nagios xi Server config wizard

Post 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"
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!
kalyanpabolu
Posts: 246
Joined: Fri Jul 03, 2020 4:18 am

Re: Nagios xi Server config wizard

Post 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 ~]#