Ad Widget

Collapse

Need some help - pulling Zabbix data to 3rd party

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Axilla
    Senior Member
    • Aug 2010
    • 130

    #1

    Need some help - pulling Zabbix data to 3rd party

    We're currently building a custom intranet for our company and we're wanting to pull some specific data from zabbix and have a "Overview" page inside our intranet.

    Now for most of it, it is just a matter of pulling the data from MySQL and plugging it into the intranet page. So I'm going to create a list of stuff we're interested in displaying and if you can shed some light on the best most efficient way possible please do

    -Displaying Graphs(Planned on using a bash script to dump the specific Graph to a .png file then have the intranet get it and display it)

    -Displaying UP/Down of Certain Devices(Planned on checking Database for Host Status and Displaying output to intranet)

    -All Systems OK(This I'm unsure of the best way)
  • fjrial
    Senior Member
    • Feb 2010
    • 140

    #2
    Hi:

    I have to do the same for my company.. I've deployed zabbix, and now I've to build some custom pages to deploy in our webpage in order to display to our customers their stats...

    I'll try to do this by using the zabbix api:
    http://www.zabbix.com/documentation/1.8/api

    I think this is the best and the easy way..

    Comment

    • Axilla
      Senior Member
      • Aug 2010
      • 130

      #3
      problem with the API is it doesn't support pulling graphs.. just the data.. so already the API is lacking feature that I need. At least thats what I read yesterday. I could use RRD Tool to graph that data, but already thats kind of reinventing the wheel that I am using zabbix for.

      Comment

      • danrog
        Senior Member
        • Sep 2009
        • 164

        #4
        There are a bunch of ways to do this. This comes from a perl script I have but really you can put this in any script.

        Code:
        my $cmdLogin    = `curl  -s -c $cookie -d 'form=1&form_refresh=1&name=$login&password=$pass&enter=Enter' zabbix.domain.com/zabbix/index.php`;
        
        if ($source eq "itemid") {
                        $chart = "chart.php?itemid";
        } else {
                        $chart = "chart2.php?graphid";
        }
        
        my $cmdImage = `curl  -s -b $cookie -o "$output" 'http://zabbix.domain.com/zabbix/$chart=$graphid&period=$period&stime=$stime&width=$width&height=$height'`;

        Comment

        • Axilla
          Senior Member
          • Aug 2010
          • 130

          #5
          thats easy enough.. thanks

          Comment

          • thjoku
            Junior Member
            • Feb 2013
            • 3

            #6
            @danrog, i tried your script.

            But the png file that gets saved is as follows


            [root@linux-zabbix graphreport]# ls -lrt
            total 8
            -rw-r--r-- 1 root root 901 Feb 20 17:56 Graphs.528.jpeg
            -rw-r--r-- 1 root root 901 Feb 20 17:56 Graphs.527.jpeg


            [root@linux-zabbix graphreport]# more Graphs.528.jpeg
            <table class="warningTable" align="center"><tr class="header"><td class="">You are not logged in.</td></tr><tr class="content"><td class=""><span cl
            ass="">You cannot view this URL as a&nbsp;<strong class="">guest</strong>. You must login to view this page.<br class="" />If you think this message
            is wrong, please consult your administrators about getting the necessary permissions.</span></td></tr><tr class="footer"><td class=""><div class="b
            uttons"><input class="input formlist" type="button" id="login" name="login" value="Login" onclick="javascript: document.location = &quot;index.php?r
            equest=http%3A%2F%2F10.91.1.106%3A80%2Fzabbix%2Fch art2.php%3Fgraphid%3D528%26period%3D604800%26stime %3D20130213000019%26width%3D570%26height%3D234&q
            uot;;" /><input class="input formlist" type="button" id="back" name="back" value="Cancel" onclick="javascript: window.history.back();" /></div></td>
            </tr></table>
            [root@linux-zabbix graphreport]#

            Comment

            Working...