GET https://<fqdn nagiosXI server>/nagiosxi/api/v1/objects/hostgroup?apikey=<API key>&pretty=1
404: The requested URL /nagiosxi/api/v1/objects/hostgroup was not found on this server.
# tail /var/log/httpd/ssl_error_log
[Fri Feb 02 14:19:39 2018] [error] [client <ip client>] File does not exist: /usr/local/nagiosxi/html/api/v1/objects
# ls -l /usr/local/nagiosxi/html/api/v1/
total 4
-rwxr-x--- 1 nagios nagios 1247 Nov 13 17:20 index.php
GET https://<fqdn nagiosXI server>/nagiosxi/api/v1/index.php?apikey=<API key>&pretty=1
404: NoEndpoint:
# tail /var/log/httpd/ssl_error_log
[Fri Feb 02 14:24:05 2018] [error] [client <ip client>] PHP Notice: Undefined index: request in /usr/local/nagiosxi/html/api/v1/index.php on line 37
How activate NagiosXI REST API?
Thanks,
System:
Nagios XI Version : 5.4.11
<fqdn server> 2.6.32-573.3.1.el6.x86_64 x86_64
Red Hat Enterprise Linux Server release 6.7 (Santiago)
Gnome is not installed
Apache Information
PHP Version: 5.3.3
Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36
You can close this thread, for documentation please tell us who is the owner of creating/updating the file "[...]/ssl.conf", because last summer we updated NagiosXI, but I don't remember any info or warning about SSL and/or API.
Now you have to tell the Apache web server (httpd) where to look for it. Open the /etc/httpd/conf.d/ssl.conf file in vi by executing the following command:
@Francesco, as @mcapra explained, the step for enabling the REST API (in the ssl.conf) is already present in our documentation. I will be locking this topic now. If you have any more questions/issues, please start a new thread. Thank you!
Be sure to check out our Knowledgebase for helpful articles and solutions!