Nagios XI API question
Re: Nagios XI API question
Attached
You do not have the required permissions to view the files attached to this post.
Re: Nagios XI API question
Can you run those 3 commands from before but substitute the "x.x.x.x" with the actual IP address of your Nagios XI server and post the txt files?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Nagios XI API question
Sorry I thought I did that. Guess that is what I get for trying to multi-task. 
You do not have the required permissions to view the files attached to this post.
Re: Nagios XI API question
Looking at the file, there seems to be an issue with the SSL connection -
Have you imported the full certificate chain? This may be the issue.
Code: Select all
* About to connect() to 10.131.98.100 port 443 (#0)
* Trying 10.131.98.100... connected
* Connected to 10.131.98.100 (10.131.98.100) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* CAfile: /etc/pki/tls/certs/ca-bundle.crt
CApath: none
* Peer's certificate issuer is not recognized: 'CN=WSFG Enterprise CA2,DC=WS,DC=WSFGRP,DC=NET'
* NSS error -8179
* Closing connection #0
* Peer certificate cannot be authenticated with known CA certificates
Former Nagios Employee
Re: Nagios XI API question
To follow up on this, I had a remote session that was similar. The underlying issue, is that his HTTPS didn't have a rule for the API. You may need to add this in your <VirtualHost> directive in your SSL file.
Code: Select all
<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>
Former Nagios Employee
Re: Nagios XI API question
I have imported teh certificate chain awhile back and still got the same error message:
I added this to the <VirtualHost> section, about 4 lines down and still nothing changed. Developer that was working on this has temporarily transferred to another assignment which I why there hasn't been any new activity on my side. We'll be back at it probably in a few weeks.
Code: Select all
https://nagiosl1t.ws.wsfgrp.net/nagiosxi/api/v1/objects/hoststatus?apikey=elarg9deek3m242gsmvr65a9s7ttiobvdkqqq668p8tqasb6g8vlb9u7fp2uhdts&pretty=1
404
Not Found
The requested URL /nagiosxi/api/v1/objects/hoststatus was not found on this server.
Apache/2.2.15 (CentOS) Server at nagiosl1t.ws.wsfgrp.net Port 443Re: Nagios XI API question
Can you post your ssl_error_log and error_log for us to look at? I'd like to see what file it says is missing.
Also, a copy of your /etc/httpd/conf.d/ssl.conf file will help as well.
Also, a copy of your /etc/httpd/conf.d/ssl.conf file will help as well.
Former Nagios Employee
Re: Nagios XI API question
The ssl_error log is empty.
You do not have the required permissions to view the files attached to this post.
Re: Nagios XI API question
I didn't see the section below in the ssl.conf...
Is it present in the "/etc/httpd/conf.d/nagiosxi.conf"? If you don't have it, the api commands will fail (if you are using ssl). Did you configure SSL in XI by following this document?
Code: Select all
<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>Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Nagios XI API question
Yes, it is in the nagiosxi.conf (attached) and yes I followed that guide to setup SSL.
You do not have the required permissions to view the files attached to this post.