Solved

[API] - Graphs

  • 5 January 2022
  • 5 replies
  • 234 views

Badge +1

Hello,

 

Is there a method to get graphs/rrd from an external site ?

For my customer’s extranet i want to display some graphs about equipement.

 

I’m using APIv2 REST.

But nothing about RRD/Graphs in official documentation…

 

Regards,

icon

Best answer by sims24 6 January 2022, 09:36

View original

5 replies

Userlevel 5
Badge +17

With 21.10 you can get metrics from APIv2, is this what you are looking for?

Badge +1

Thanks @rchauvel i’ll test tomorow services metrics.

You sure it’s only on 21.10 ?

We just upgraded yesterday from 19.10 to 21.04 … :grin:

 

Regards,

Userlevel 5
Badge +17

It should also be in 21.04

Userlevel 6
Badge +19

Hi, 

Note that if you would like to directly get the RRD png file instead of raw datapoints, you can also use this endpoint:

https://$CENTREON-IP-OR-DNS$//include/views/graphs/generateGraphs/generateImage.php?akey=$AUTH_KEY$&username=$USER$&hostname=$HOSTNAME$&service=$SERVICENAME$&start=$TIMESTAMPSTART$&end=$TIMESTAMPEND$

Replace $VALUES$ by yours. It requires that your user has an autologin key and config API access:

 

curl "https://X.X.X.X/centreon/include/views/graphs/generateGraphs/generateImage.php?akey=jaUv8KJacW&username=api_graph&hostname=EC2&service=Diskio&start=1640852228&end=1641457028" --output 'rrd_graph.png'

 

Badge +1

Thanks for your help @rchauvel & @sims24 

I can now get PNG image and RAW data :smiley:

 

Regards,

Reply