Page 1 of 1

Help with Performance Graphs with Backend API

Posted: Fri Jun 15, 2012 3:17 pm
by cloberjewels
Hi,

I'd like to be able to use the Nagios XI Backend API to pull specific performance graphs.

Something like this url:
http:// mynagiosserver/nagiosxi/includes/components/perfdata/graphApi.php?host=RHBUILD64&service=CHECK_CPU&source=2&view=1&start=&end=&rand=1339785888

When I use that url:
http:// mynagiosserver/nagiosxi/backend/?cmd=pnpproxy&username=images&ticket=myticket&url=http://mynagiosserver/nagiosxi/includes ... 1339785888

It says I'm not logged in.

A previous TOPIC (http://support.nagios.com/forum/viewtop ... api#p13707) mentions that it is possible to pull performance graphs through the Backend API but no details as to how.

Other APIs are working such as getusers, getsysstat, etc... all work fine so I believe I have it configured properly.

Thanks for any help.

Re: Help with Performance Graphs with Backend API

Posted: Fri Jun 15, 2012 3:24 pm
by mguthrie
You *should* be able to access a graph image directly by using the initial URL that you posted:
http:// mynagiosserver/nagiosxi/includes/components/perfdata/graphApi.php?host=RHBUILD64&service=CHECK_CPU&source=2&view=1&start=&end=&rand=1339785888
and then adding just adding the "username=<myUsername>&ticket=<myTicket>" to the end of it. The "Backend API URL" component can give you the backend ticket for the user you're requesting it for.

Re: Help with Performance Graphs with Backend API

Posted: Fri Jun 15, 2012 3:33 pm
by cloberjewels
Ah! I over complicated it. That worked! Thanks.