can't access api

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
scheived
Posts: 18
Joined: Tue Jul 16, 2013 9:53 am

can't access api

Post by scheived »

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

Re: can't access api

Post by benjaminsmith »

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"
You do not have the required permissions to view the files attached to this post.
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!
scheived
Posts: 18
Joined: Tue Jul 16, 2013 9:53 am

Re: can't access api

Post by scheived »

I was using https, change it to http and got it working now.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: can't access api

Post by scottwilkerson »

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

Locking
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked