Ad Widget

Collapse

How to export graphs as pictures?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dephil
    Junior Member
    • Mar 2010
    • 4

    #1

    How to export graphs as pictures?

    Hi guys.

    First of all I need to give you an short introduction of what I'm planning to do. I'd like to send daily emails to all admins in my company including the status of our most important switches and firewals etc. These emails should contain information about the uptime etc of these switches and I'd like to include some images of important graphs in these emails as an attachment. It should be something like a 'automated daily reporting system'. If Zabbix already has such a function that will be perfect. If not, how can I cause Zabbix to export specific graphs as pictures at a defined time?


    I had a closer look on config.inc.php at the function called "function ImageOut(...)". This function uses the PHP function ImagePNG($image); to print an image (the image of the graph) in the webbrowser. By changing the function

    "ImagePNG($image);"

    to

    "ImagePNG($image,"/var/www/zabbix_pics/pic1.png");"

    I got Zabbix to save all graphs as a picture on my harddrive instead of showing them in the browser. So, it's not impossible to save graphs as pictures but this solution is just for testing purpose. I need to expand this (or more) php files, but before I do so, I'd like to know if there's anybody, who has a better idea how to get my 'problem' solved.

    I'm still using Zabbix 1.6.7 (an upgrade to 1.8 is comming soon). Is version 1.8 able to export graphs as pictures?

    I would be grateful for any help
  • richlv
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Oct 2005
    • 3112

    #2
    personally, i'd suggest for now to simply wget the graphs and then use them in the emails.

    you can do this either by allowing guest user access to them, or configuring zabbix with http auth and then authenticating that way
    Zabbix 3.0 Network Monitoring book

    Comment

    • dephil
      Junior Member
      • Mar 2010
      • 4

      #3
      Oh, that was easy Thanks a lot!!!

      Enabling the guest account and changing user rights for guest to view the graphs solved my problem. Now I'm able to wget these graphs by executing this command:

      wget "http://1.2.3.4/zabbix/chart2.php?graphid=XXXX&period=3600&width=800"

      where XXXX is the graph's ID.

      Thanks richlv!

      Comment

      • danrog
        Senior Member
        • Sep 2009
        • 164

        #4
        Check out this thread/script.

        Zerg has created a nice little perl script that will send via email a list of screens and the graphs associated with them. It works great.

        Comment

        • Jun.Liu
          Member
          • Apr 2007
          • 91

          #5
          Originally posted by dephil
          Oh, that was easy Thanks a lot!!!

          Enabling the guest account and changing user rights for guest to view the graphs solved my problem. Now I'm able to wget these graphs by executing this command:

          wget "http://1.2.3.4/zabbix/chart2.php?graphid=XXXX&period=3600&width=800"

          where XXXX is the graph's ID.

          Thanks richlv!
          that's a very convenience method! but how can I know the graph's ID? it seems it need be searched in database?

          Comment

          • richlv
            Senior Member
            Zabbix Certified Trainer
            Zabbix Certified SpecialistZabbix Certified Professional
            • Oct 2005
            • 3112

            #6
            Originally posted by Jun.Liu
            that's a very convenience method! but how can I know the graph's ID? it seems it need be searched in database?
            in frontend, edit the graph and look at the url - graphid should be included there
            Zabbix 3.0 Network Monitoring book

            Comment

            • dephil
              Junior Member
              • Mar 2010
              • 4

              #7
              Thanks danrog! It works really great. Solved my problem Damn, that's nice!

              Originally posted by danrog
              Check out this thread/script.

              Zerg has created a nice little perl script that will send via email a list of screens and the graphs associated with them. It works great.

              Comment

              Working...