Ad Widget

Collapse

WIP: Custom Dashboard

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • danrog
    Senior Member
    • Sep 2009
    • 164

    #1

    WIP: Custom Dashboard

    Here is the latest version of my top10 dashboard. I am still working on a config page so you can modify each of the widgets to match your own environment so for right now you just have to edit the top10.php file to either select your item key or item description and then you have to update the header with your own description. Most of these follow the base template key's and description so for the most part it should just work.

    As the title states, this is a work in progress and I've only just started working on this (in my spare time).

    The Top/Bottom 10 blocks only query the history table and I only calculate the average for the last hour. I don't foresee using the trends table at all or calculating more then an hours worth of data (thats what reports are for).

    According to the debug output, I see and average of .1 seconds for each of these new blocks, so speed is not an issue (for me) right now either.

    This does NOT touch existing files (instead I just made duplicates and renamed them) so this doesn't change any code. I did make and test this only on 1.8.3 so I don't know if it will work with anything below that.

    To install:
    Copy top10.php to zabbix web root
    Copy top10.inc.php to zabbix/include directory

    If the group dashboard filter is set, these new blocks will filter the query based on those groups.
    Attached Files
    Last edited by danrog; 23-09-2010, 00:34. Reason: Added new attachments and updated original post to reflect my changes
  • walterheck
    Senior Member
    • Jul 2009
    • 153

    #2
    Sounds nice! Do you happen to have a few screenshots for us so we can see what this looks like so we don't have to download and install it to see?

    Thanks!
    Free and Open Source Zabbix Templates Repository | Hosted Zabbix @ Tribily (http://tribily.com)

    Comment

    • danrog
      Senior Member
      • Sep 2009
      • 164

      #3
      Here is a screen shot of the latest top10 dashboard. I'll upload the two new php files tomorrow (or the next day).
      Attached Files

      Comment

      • QuakENT
        Member
        • Jun 2010
        • 40

        #4
        Well dude, this definitely ROCKS

        Comment

        • mushero
          Senior Member
          • May 2010
          • 101

          #5
          Can I just say this is awesome ! Gives me new ideas I never knew I could think of, so many useful possibilities for this in our shop.

          Now, how can we extend this, and even add to real dashboard as new options.

          I put it on our 1.8.3 system, but got many errors - maybe because we don't have your items, but got this on Zombies and others, plus your UDP section in the code shows up as DNS in our system:

          Undefined variable: type[/var/www/html/zabbix-1.8.3/include/top10.inc.php:46]
          Undefined variable: itemids[/var/www/html/zabbix-1.8.3/include/top10.inc.php:75]
          implode() [<a href='function.implode'>function.implode</a>]: Invalid arguments passed[/var/www/html/zabbix-1.8.3/include/top10.inc.php:75]

          Error in query [ SELECT avg( h.value ) AS avg, hs.host, i.itemid, i.units FROM history h ...

          SQL had hundreds of server IDs in it for our servers in this group/user, which won't scale in the IN statement. In this query, the itemid is blank

          ...WHERE h.itemid IN () AND h.clock...
          ---

          Comment

          • mushero
            Senior Member
            • May 2010
            • 101

            #6
            Sorry to post twice, but the popup graphs are SUPER ! I wish we had these elsewhere, especially on main dashboard for any given trigger/event; now, that would be absurdly useful, too.

            Comment

            • mushero
              Senior Member
              • May 2010
              • 101

              #7
              Here is solution - your items (of course) don't match mine, so anyone can just change lines like this in top10.php to change the quoted text to match ONE of your items, and all will be happy;

              $top10dash7 = make_top10($dashconf,'CPU - Load avg 5min', 10, 'DESC');

              But we have many items with the name like "Innodb $1" which breaks the lookup by description; I had to change a couple items to make this. Not sure how to handle that; Best way is to use the itemid of the item from the template, but that may be too complex. Another way is use the $x system like the Template does, but also makes for complex SQL. Leave that for later, I guess.

              Let me repeat how VERY cool this all is.

              Comment

              • mushero
                Senior Member
                • May 2010
                • 101

                #8
                Loving this all too much but suggest improvements to the graph, including a MUCH shorter scale (not a week as it seems to default to), and ideally the ability to drag for time, etc. like usual and/or a link to a real graph page to do the same.

                To change chart period, change 21600 below to 3600, 7200, etc. (in include/top10.inc.php):

                $img = new Cimg('chart.php?width=500&height=100&period=21600& itemid='.$row['itemid']);

                Also need to move chart window to the left if using table col 3 or 4 otherwise off the screen (and up if near bottom). And need to be able to drag it.

                In most cases we'll see something odd, click to get a graph, see something odd, and investigate further with a big graph, etc.

                And then folks can add this code to the real dashboard top 20 issues, etc.

                My brain is still thinking off all the ways to use this . . .

                Comment

                • Robert.hau
                  Junior Member
                  Zabbix Certified Specialist
                  • Jun 2010
                  • 10

                  #9
                  Custom Dashboard

                  Guys,
                  I have taken the top10.php and create a new one. I am still very interested in if someone can help setup a config page for it. I basically created a bunch of the table blocks, and set them if they are defined to appear but if they aren't to not load. I have this setup for 7 across and 4 down, but should be easy to add more down. I also added a Max Column. This is helpful when you are trying to identifiy a process that was running hot at some point, but only for a second.

                  The only thing i don't like is there doesn't seem to be a way to get the last value, so your only getting a rounded value for the last 12 hours.

                  Click image for larger version

Name:	dashboard.jpg
Views:	1
Size:	60.7 KB
ID:	309467
                  Last edited by Robert.hau; 05-04-2011, 15:59.

                  Comment

                  • Robert.hau
                    Junior Member
                    Zabbix Certified Specialist
                    • Jun 2010
                    • 10

                    #10
                    Working Gen_dash

                    I have attached my latest gen_dash.php and the include php.

                    the include has 2 functions
                    make_top10 and make_last10.

                    i tried to make a last10 values work but its not so easy. Currently its the same as the top10.

                    The change to this file vs the previous guys is. I changed some of the naming convention so i can add more easier, as well as make it more generic.

                    If you are using this with values that are constantly changing you can tune the time value much lower on the include value. If you are not then you will need to tune it much higher. I have some last values that only change every 12 hours, so they will actually not display if not set to 12 hours.
                    Attached Files

                    Comment

                    • efrain02
                      Banned
                      • Apr 2011
                      • 81

                      #11
                      Wow this looks great. The latest one (Gen_dash) for wich version of zabbix is?

                      Comment

                      • Robert.hau
                        Junior Member
                        Zabbix Certified Specialist
                        • Jun 2010
                        • 10

                        #12
                        Dashboard

                        I tested it with 1.8.3 without any issues.

                        Comment

                        • efrain02
                          Banned
                          • Apr 2011
                          • 81

                          #13
                          Thanks i'm gonna check this out

                          Comment

                          • Shriram.Fowkar
                            Junior Member
                            • Jan 2011
                            • 17

                            #14
                            Hi,

                            Any new version of gen_dash available ?

                            Comment

                            • efrain02
                              Banned
                              • Apr 2011
                              • 81

                              #15
                              maybe for zabbix 1.8.4???

                              Comment

                              Working...