Downloading Graphs via API/Direct Link

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
JGCG
Posts: 45
Joined: Fri Sep 29, 2017 6:31 am

Downloading Graphs via API/Direct Link

Post by JGCG »

Hi,

Is it possible to download the performance graphs via the API, or is there a way of getting a direct link to the image itself?
I have Nagios auto logging tickets in our ITSM tool and would like the performce graph adding to the call when it is logged.

I've read the following article: https://support.nagios.com/kb/article.php?id=91 which details how to link directly to graph explorer graphs, but not how to link directly to a JPG or PNG image or how to automatically extract the graph from this page.

Thanks.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Downloading Graphs via API/Direct Link

Post by cdienger »

I can file a feature request for accessing the graph images directly, but right now it isn't readily available. Raw data is available through the API though. See Help > REST API Docs > Objects Reference > Data Exporting, for examples and details.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
JGCG
Posts: 45
Joined: Fri Sep 29, 2017 6:31 am

Re: Downloading Graphs via API/Direct Link

Post by JGCG »

cdienger wrote:I can file a feature request for accessing the graph images directly, but right now it isn't readily available. Raw data is available through the API though. See Help > REST API Docs > Objects Reference > Data Exporting, for examples and details.
If you could, that would be great.

I've done some digging and I'm able to extract the graphs I need using the depreciated backend API:

Code: Select all

https://nagios/nagiosxi/includes/components/perfdata/graphApi.php?host=THEHOST&view=2&username=APIUSERNAME&ticket=APIKEY
The graph it returns is not a pretty as the normal, but for now it will do.

Edit: Scrap that, the backend API only works if you're logged in to the UI.
It seems a recent upgrade has disabled the ability from editing the settings of the 'Backend API URL' in the 'Manage Components' section so my old token key from a few months back does not work.
https://nagios/nagiosxi/admin/component ... kendapiurl returns ' Component function does not exist.'

There's been quite a few REST API changes too recently which have not been docmented or mentioned in the change logs!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Downloading Graphs via API/Direct Link

Post by scottwilkerson »

Under Admin -> System Settings -> Backwards Comparability Tab you can re-enable to old ticket system
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Sampath.Basireddy
Posts: 252
Joined: Wed Dec 14, 2016 12:30 pm

Re: Downloading Graphs via API/Direct Link

Post by Sampath.Basireddy »

With Backward Compatibility enabled, I still don't see "wrench and screwdriver" icon against Backend API URL to get the Ticket for users.

Any other steps to to performed?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Downloading Graphs via API/Direct Link

Post by lmiltchev »

After you've enabled the Backward Compatibility, you can go to Admin > Manage Users > <any user> > Edit. On the right-hand side you should wee the Insecure Login Settings for your user, along with the ticket. Make sure that you select the box to ensure that insecure login is enabled for this user. You could also generate a new insecure ticket if needed.
example01.PNG
You do not have the required permissions to view the files attached to this post.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Sampath.Basireddy
Posts: 252
Joined: Wed Dec 14, 2016 12:30 pm

Re: Downloading Graphs via API/Direct Link

Post by Sampath.Basireddy »

Perfect, that worked. Thank so much @lmiltchev
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Downloading Graphs via API/Direct Link

Post by lmiltchev »

I am glad I could help! :)
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked