Page 1 of 1

Getting nagios performance graph without login into nagios

Posted: Tue Nov 22, 2016 12:36 pm
by yunushaikh
Hello Experts,

Is is possible to get the nagios any service or host performance graph without nagios login?
Please let me know how todo this

Re: Getting nagios performance graph without login into nagi

Posted: Tue Nov 22, 2016 12:46 pm
by dwhitfield
There are at least a couple of ways to do this. Exporting would require a custom script, but once you export then you have a ton of options. This is the most secure option, and we can explore it further if you prefer.

You could also use the direct url for the graph in question. This would require:
1. The url - right click on the graph in question and open in a new tab and then view the image. This is the base url for the image.
2. Create a *read-only* XI user with only rights to the services in question.
3. Go to Admin --> Manage Components --> Backend API. Select your newly created read-only user and copy the string "username=<user>&ticket=<ticket#>" from the end of one of the fields.
4. Append the backend ticket url to the image url. For example:

Code: Select all

https://x.xx.x.x/nagiosxi/includes/components/perfdata/graphApi.php?host=x.x.x.x&service=Networking_for_VMHost&source=1&view=1&start=&end=&rand=1381269385&username=<user>&ticket=<ticket#>
5. Embed the new url from step 4 in the "clients" app.

Couple of notes:
Ticket IDs will allow them to log into your XI server, so make sure the rights are minimal (READ-ONLY).
If they cannot route to your xi server, the URL solution will not work for you.

Like the exporting situation, if you describe a bit more about what you would like to do, we can help tailor the direct URL option to your needs.

Re: Getting nagios performance graph without login into nagi

Posted: Wed Jan 04, 2017 11:19 pm
by yunushaikh
Nice explanation Sir,

I was able to do this and it worked fine. Just a change I made was instead of graphAPI.php it was graph.php
https://x.xx.x.x/nagiosxi/includes/comp ... et=<ticket#>

graphAPI gave a message of there is no performance data available. Dont know the reason. nagiosxi version is 5.3.2

You can close this thread.
Thanks a lot