Ad Widget

Collapse

Get a graph from an extranet

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ghislain
    Senior Member
    • Jun 2005
    • 160

    #1

    Get a graph from an extranet

    hi,

    I was wondering if i could import a graph from zabbix in my extranet to give some view to my customer of some static graph so i started searching a little. At first i would think a simple curl to the graph url will do it but i got a problem in linking the url to the server.

    Ie if i have a server01.myserver.com and a graph name cpuload how could i build the url to retreive the graph ?

    It seems the url is made of the database id of the host and the graph but i see no way in the api to retreive the image of the graph. So i guess there is no way to use it for that i must build the url by hand , authenticate and retreive the graph. Seems a little hard to do and automate. Si the way would be:

    - API call to http://www.zabbix.com/documentation/.../api/graph/get with a filter on graph name and hostname to get the graph id that seems unique even in templated graphs.

    - use curl to connect to the frontend
    - build the url /chart2.php?graphid=XXX&sid=f2054851b316800e&width= 600&period=YYYYY&stime=UNIXTIME
    - get the image
    - logout



    Do anyone knows of a an easier way ?
    Regards,
    Ghislain.
  • stevenberkholz
    Junior Member
    • Jun 2012
    • 6

    #2


    This works for me.

    I just removed the "&stime="

    You will also have to enable the guest user and add that user to allowed to view that data.

    Then the graph will come up with no login required.

    Then you could either passthrough or pull the image.

    Comment

    • ghislain
      Senior Member
      • Jun 2005
      • 160

      #3
      well giving the guest user the full view right seems.. a little unsecure to me

      I have to find another solution. Also you have to gather the graph id so the API call is still needed, to bad the API cannot give us a binary blob for a graph image.
      Regards,
      Ghislain.

      Comment

      • nelsonab
        Senior Member
        Zabbix Certified SpecialistZabbix Certified Professional
        • Sep 2006
        • 1233

        #4
        There is a feature in Zabcon to pull a graph. I will be discussing it on Saturday during the conference.
        RHCE, author of zbxapi
        Ansible, the missing piece (Zabconf 2017): https://www.youtube.com/watch?v=R5T9NidjjDE
        Zabbix and SNMP on Linux (Zabconf 2015): https://www.youtube.com/watch?v=98PEHpLFVHM

        Comment

        Working...