Page 1 of 1

Get access to Reports ( SLA ) from external system

Posted: Wed Nov 02, 2016 6:36 am
by reidara
How can I access the availability reports or SLA reports programmatically from outside the nagios server.

It seems that the JSON API's are missing this.

The sessions cookie 'nagiosxi' are preventing me ( naturally). Is there a way around ?

BR,

Reidar

Re: Get access to Reports ( SLA ) from external system

Posted: Wed Nov 02, 2016 9:07 am
by jomann
You can use the backend ticket, which will log you in. However, your session will remain open until you log out when using this.

Got to Admin > Manage Components > Backend API URL > select the user you want the backend ticket for and click "Apply Settings"

You will get a page with a bunch of URLS. The way to authenticate is shown in the GET variables: ?cmd=gethoststatus&username=<username>&ticket=<ticket>
You must have both the username and ticket passed to be able to authenticate. Treat the ticket like a password though since it can authenticate you to your system.

Re: Get access to Reports ( SLA ) from external system

Posted: Wed Nov 02, 2016 9:16 am
by reidara
Thank you for the attention ;-)

I use the latest nagiosxi version and in the Backend APU URL it show me this: : Deprecated API This feature is now deprecated. Please use the new REST API that is documented here.

And I have used the standard REST JSON objects. But they dont give me what I need. I need reports.

BR, Reidar

Re: Get access to Reports ( SLA ) from external system

Posted: Wed Nov 02, 2016 9:18 am
by jomann
The authentication method (username & ticket combo) is not being removed, it's just that those endpoints that use the "backend" URL will eventually be removed in some later version of Nagios XI.

Re: Get access to Reports ( SLA ) from external system

Posted: Thu Nov 03, 2016 3:55 am
by reidara
I have created a user. But in the Backend API URL page the dropdown does not list any user at all. Does this mean that the function is depreaciated ?

Re: Get access to Reports ( SLA ) from external system

Posted: Thu Nov 03, 2016 8:52 am
by reidara
Thank you. I found the backend ticket in the database for the user.

Re: Get access to Reports ( SLA ) from external system

Posted: Thu Nov 03, 2016 9:19 am
by rkennedy
Awesome, are we good to mark this thread as resolved?

Re: Get access to Reports ( SLA ) from external system

Posted: Fri Nov 04, 2016 3:03 am
by reidara
Yepp ;-) :D

Re: Get access to Reports ( SLA ) from external system

Posted: Fri Nov 04, 2016 9:31 am
by avandemore
Glad your issue is resolved, thanks for using the Nagios forums. Please start a new thread if you have future issues.