New API error "No API Key provided"
New API error "No API Key provided"
I have tried a few things that have surfaced in this forum regarding this topic, but I cannot seem to make it work. I am attaching my ssl.conf and nagiosxi.conf in hopes that someone can tell me why I can't use the API. TYIA.
You do not have the required permissions to view the files attached to this post.
Re: New API error "No API Key provided"
Could you please show us how you're attempting to access the API?
Also, a tail of your /var/log/httpd/ssl_error_log when you attempt to access it will help as well.
Also, a tail of your /var/log/httpd/ssl_error_log when you attempt to access it will help as well.
Former Nagios Employee
Re: New API error "No API Key provided"
rkennedy wrote:Could you please show us how you're attempting to access the API?
Code: Select all
curl -XGET "https://nagiosxi.uark.edu/nagiosxi/api/v1/objects/servicegroup?apikey=<MYAPIKEY>&pretty=1" -kNothing appears in that log when I try to access, however I get the following warning when I restart apache:rkennedy wrote:Also, a tail of your /var/log/httpd/ssl_error_log when you attempt to access it will help as well.
Code: Select all
AH01909: RSA certificate configured for 127.0.0.1:443 does NOT include an ID which matches the server nameRe: New API error "No API Key provided"
I figured out what this error was, by the way. I don't think its relevant.ScottG wrote:Code: Select all
AH01909: RSA certificate configured for 127.0.0.1:443 does NOT include an ID which matches the server name
Re: New API error "No API Key provided"
Can you share the verbose output of that curl?
Feel free to PM it if you have security concerns.
Have you also tried using/creating a new API key?
Code: Select all
curl -XGET "https://nagiosxi.uark.edu/nagiosxi/api/v1/objects/servicegroup?apikey=<MYAPIKEY>&pretty=1" -k -vHave you also tried using/creating a new API key?
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
Re: New API error "No API Key provided"
Here you go:mcapra wrote:Can you share the verbose output of that curl?
Code: Select all
$ curl -v -XGET "https://nagiosxi.uark.edu/nagiosxi/api/v1/objects/servicegroup?apikey=<MYAPIKEY>&pretty=1"
* About to connect() to nagiosxi.uark.edu port 443 (#0)
* Trying 10.7.2.37...
* Connected to nagiosxi.uark.edu (10.7.2.37) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* CAfile: /etc/pki/tls/certs/ca-bundle.crt
CApath: none
* SSL connection using TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
* Server certificate:
* subject: CN=nagiosxi.uark.edu,OU=UITS - IT Services,O=University of Arkansas,STREET=University of Arkansas,L=Fayetteville,ST=AR,postalCode=72701,C=US
* start date: Jul 21 00:00:00 2016 GMT
* expire date: Jul 21 23:59:59 2018 GMT
* common name: nagiosxi.uark.edu
* issuer: CN=InCommon RSA Server CA,OU=InCommon,O=Internet2,L=Ann Arbor,ST=MI,C=US
> GET /nagiosxi/api/v1/objects/servicegroup?apikey=<MYAPIKEY>&pretty=1 HTTP/1.1
> User-Agent: curl/7.29.0
> Host: nagiosxi.uark.edu
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Wed, 14 Sep 2016 20:26:57 GMT
< Server: Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.1e-fips PHP/5.4.16
< X-Powered-By: PHP/5.4.16
< Access-Control-Allow-Orgin: *
< Access-Control-Allow-Methods: *
< Content-Length: 31
< Content-Type: application/json
<
* Connection #0 to host nagiosxi.uark.edu left intact
{"error":"No API Key provided"}I'm trying to figure out how to create new keys now.mcapra wrote:Have you also tried using/creating a new API key?
Re: New API error "No API Key provided"
There isn't a very good way to "regenerate" a user's API key at the moment. This feature is planned for 5.3.0 though.
Creating a new user, logging in as that user, and clicking the user's name in the top-right corner is a good way to secure a fresh API key.
Creating a new user, logging in as that user, and clicking the user's name in the top-right corner is a good way to secure a fresh API key.
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
Re: New API error "No API Key provided"
I used the key for the "nagiosadmin" local account and got the same result.
Re: New API error "No API Key provided"
What is the Nagios XI version that you are currently using?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: New API error "No API Key provided"
5.2.9lmiltchev wrote:What is the Nagios XI version that you are currently using?