Ad Widget

Collapse

Any way to automate downloading of png graph data?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jeenam
    Member
    • Oct 2007
    • 43

    #1

    Any way to automate downloading of png graph data?

    Does anyone know how to go about downloading png graph data using wget? Can it be done? The problem we're running into is passing the authentication credentials with the zabbix URL for wget. Any assistance with this would be greatly appreciated.
  • jeenam
    Member
    • Oct 2007
    • 43

    #2
    We figured out how to do this. Here's the deal. First create a user and set their session timeout to "0" (infinite - session timeout disabled). Then use that user to obtain the following:


    #!/bin/sh

    USER=username
    PASS=password
    OUTFILE=/tmp/picture.png
    COOKIEFILE=/tmp/zabbix_cookies
    ITEM=XXXX
    PERIOD=604800

    wget --quiet -O /dev/null --post-data="form=1&form_refresh=1&name=$USER&password=$P ASS&enter=Enter" --save-cookies $COOKIEFILE --keep-session-cookies 'https://zabbix.server.com/zabbix/index.php'

    wget --quiet --post-data='' -O $OUTFILE --load-cookies=$COOKIEFILE "https://zabbix.server.com/zabbix/chart.php?itemid=$ITEM&from=0&period=$PERIOD&width =1393"

    uuencode /tmp/file.png file.png | mail -s "Subject" [email protected]

    Comment

    • just2blue4u
      Senior Member
      • Apr 2006
      • 347

      #3
      hey, i think this could be a really cool feature for alert messages...
      Zabbix being able to send custom alert emails with the appropriate graph included...
      Big ZABBIX is watching you!
      (... and my 48 hosts, 4513 items, 1280 triggers via zabbix v1.6 on CentOS 5.0)

      Comment

      Working...