can't access api

This board serves as an open discussion and support collaboration point for Nagios XI. NOTE: Nagios XI customers should use the Customer Support forum to obtain expedited support.

can't access api

Postby scheived » Fri Aug 30, 2019 10:26 am

Any idea why I can't access the API?

getting <title>404 Not Found</title>

nagiosxi.conf
<Directory "/usr/local/nagiosxi/html">
# SSLRequireSSL
Options None
AllowOverride None
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
# AuthName "Nagios XI"
# AuthType Basic
# AuthUserFile /usr/local/nagiosxi/etc/htpasswd.users
# Require valid-user
</Directory>

Alias /nagiosxi "/usr/local/nagiosxi/html"

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule nagiosxi/api/v1/(.*)$ /usr/local/nagiosxi/html/api/v1/index.php?request=$1 [QSA,NC,L]
</IfModule>
scheived
 
Posts: 6
Joined: Tue Jul 16, 2013 9:53 am

Re: can't access api

Postby benjaminsmith » Fri Aug 30, 2019 1:32 pm

Hello @scheived,

Just to verify, do you have API access enabled for your user account? Go to Admin > Users > Manage Users and click on your username to check.

API-access.png

If so, can you post the error message to the following API Call ( fill in your IP address/hostaname and API key )? Thanks.
Code: Select all
curl -XGET "<http://ipaddress/nagiosxi/api/v1/system/status?apikey=#abc123#&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!
User avatar
benjaminsmith
 
Posts: 1722
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: can't access api

Postby scheived » Tue Sep 03, 2019 3:37 pm

I was using https, change it to http and got it working now.
scheived
 
Posts: 6
Joined: Tue Jul 16, 2013 9:53 am

Re: can't access api

Postby scottwilkerson » Tue Sep 03, 2019 3:53 pm

scheived wrote:I was using https, change it to http and got it working now.

great!

Locking
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
scottwilkerson
DevOps Engineer
 
Posts: 16283
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises


Return to Nagios XI

Who is online

Users browsing this forum: MSN [Bot] and 7 guests