Skip to main content
Solved

[API] - Graphs

  • January 5, 2022
  • 5 replies
  • 337 views

Forum|alt.badge.img+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,

Best answer by sims24

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'

 

5 replies

rchauvel
Centreonian
Forum|alt.badge.img+18
  • Centreonian
  • January 5, 2022

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


Forum|alt.badge.img+1
  • Author
  • Steward *
  • January 5, 2022

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,


rchauvel
Centreonian
Forum|alt.badge.img+18
  • Centreonian
  • January 5, 2022

It should also be in 21.04


sims24
Forum|alt.badge.img+19
  • Ranger ***
  • Answer
  • January 6, 2022

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'

 


Forum|alt.badge.img+1
  • Author
  • Steward *
  • January 6, 2022

Thanks for your help @rchauvel & @sims24 

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

 

Regards,