Ad Widget

Collapse

creating custom dashboard views

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pds
    Junior Member
    • Apr 2014
    • 11

    #1

    creating custom dashboard views

    The company i'm working for is monitoring if updates are installed on some devices or not. This is can quickly fill last issues.

    To solve this problem i wrote some custom php code through api calls so i could filter the windows updates from the active triggers. I would like to integrate my PHP code in the zabbix dashboard.

    However i don't have a lot of experience yet , with editing the zabbix php code directly. Any advice?
    Last edited by pds; 07-05-2014, 13:53.
  • tatapoum
    Senior Member
    • Jan 2014
    • 185

    #2
    We've started to use dashing (http://shopify.github.io/dashing) to create dashboards for Zabbix triggers. It's a ruby/javascript framework based on Sinatra. Here is how it lows like :
    [img][/img]

    It uses API calls to query the active triggers.
    Last edited by tatapoum; 07-05-2014, 13:28.

    Comment

    • pds
      Junior Member
      • Apr 2014
      • 11

      #3
      Looks pretty sweet, it has a mobile look and feel to it.
      However my knowledge of ruby on rails is pretty limited. I only know plain ruby so far.

      Could you provide some info to get me up and running (TL;DR style). So i can figure out the finetuning my self.

      FYI: For the api calls i used ( http://zabbixapi.confirm.ch/ ). PHP + ruby will probably get a little bit messy.
      Last edited by pds; 07-05-2014, 13:54.

      Comment

      • tatapoum
        Senior Member
        • Jan 2014
        • 185

        #4
        UPDATE : I have set up a github repo : https://github.com/dav3860/zabbix_dashboard.
        - Install ruby 1.9+ and rubygems on your system
        - Follow the instructions at http://shopify.github.io/dashing/#setup
        - test the sample dashboard to validate the setup

        - Follow the instructions here https://gist.github.com/jwalton/6670630 to add the cycling screens feature
        - install the zabby gem
        - Create the widgets, dashboard and job from this gist https://gist.github.com/dav3860/14b29b70afa589c0b94d:
        a) put default.erb in /dashboards
        b) zabbix.rb in /jobs and define the right parameters into the file
        c) create the zabbix, zabbix_list and text folders in /widgets and put the widget files inside.

        - dashing start.
        Last edited by tatapoum; 04-09-2014, 13:40.

        Comment

        • pds
          Junior Member
          • Apr 2014
          • 11

          #5
          i guess my ruby installation process is pretty solid:

          curl - L get.rvm.io | bash -s stable
          source /etc/profile.d/rvm.sh
          rvm requirements

          Install ruby 1.9.3 (snorby doesn't support 2.1.1 - and ruby 1.9.3 is no longer maintained)
          rvm install 1.9.3
          rvm use 1.9.3 --default
          ---

          what gems should i install?

          Comment

          • tatapoum
            Senior Member
            • Jan 2014
            • 185

            #6
            I added my updated Gemfile to the gist. So you just have the run bundle to install the necessary gems.

            Comment

            • pds
              Junior Member
              • Apr 2014
              • 11

              #7
              thnx a lot for the time being, will look further into it on a later basis

              Comment

              • pds
                Junior Member
                • Apr 2014
                • 11

                #8
                double post (sorry):
                i took a look into the ruby on rails application and i would like to stick to the idea of a custom frontend in PHP. Because i have more knowlege of that.

                Does anybody knows if somebody has been kind enough to provide some work like that for free?

                Comment

                • syndeysider
                  Senior Member
                  • Oct 2013
                  • 115

                  #9
                  Wow!

                  Very informative and thank you kindly for the free code.

                  Just moved our main TV to this framework and am displayed aggregated data across multiple screens for Linux, Windows and Network Devices.

                  Looks SO good, especially with our move to Window 8....

                  Thanks again!!!

                  Comment

                  • tatapoum
                    Senior Member
                    • Jan 2014
                    • 185

                    #10
                    You're welcome. You'll notice that you can reset the alerts simply by acknowledging the events in Zabbix.

                    Comment

                    • iaina
                      Junior Member
                      • May 2014
                      • 1

                      #11
                      Thanks for this. We'd just purchased 3 large screens and I was looking for something exactly like this.

                      Got dashing installed last night and successfully got your zabbix dashboard up and running at the same time. Looks great on the big screens, we're using a raspberry pi connected to each of the screens.

                      Comment

                      • syndeysider
                        Senior Member
                        • Oct 2013
                        • 115

                        #12
                        Graphing

                        Not being much of a coder, anyone kind enough to post an example of the .rb content to get the graphs working? Specifically the points and how you would go about plotting them?

                        Spent 2 days on this and not having much luck

                        Comment

                        • tatapoum
                          Senior Member
                          • Jan 2014
                          • 185

                          #13
                          syndeysider: Here is how it works :
                          - dashboards/default.erb is an HTML template file describing the screen. If you look at my gist, it is parametrized so you don't need to modify it.
                          - the files in /widgets define the different widgets that compose the screens. No update required too.
                          - jobs/zabbix.rb is a script that queries the active triggers using the Zabbix API and send the data to the widgets composing the screens. This is what you need to update with your parameters :
                          Code:
                          SERVER = "http://zabbixserver"
                          USER = "apiuser"
                          PASSWORD = "apipassword"
                          SCREENS = {
                                  "Screen 1" => [ "Virtual machines", "Networking"],
                                  "Screen 2" => [ "Windows servers" ],
                          }
                          -> the Zabbix hostgroups "Virtual machines" & "Networking" are grouped into the dashboard screen named "Screen 1", etc.
                          Dashing will cycle between the different screens.

                          Comment

                          • syndeysider
                            Senior Member
                            • Oct 2013
                            • 115

                            #14
                            Thanks so much but I figured that part out

                            The issue is specifically with the Graph object.

                            The exceptionally handsome dashboard framework in Ruby and Coffeescript. - Shopify/dashing


                            If we where to schedule, using your code, another job specifically designed to pull data every 5 seconds, I get confused with the data array and which points to plot in the array so the graph moves correctly and displays the correct data

                            The Metric, Number and Text objects are easy. I even managed to use your code to extend out into pulling more data for servers suited to our needs.

                            Maybe a pointer in the right direction on graphs in ruby might help?

                            Comment

                            • hatchetharris
                              Junior Member
                              • Aug 2014
                              • 2

                              #15
                              Dashing help

                              Hi,

                              I'm pretty new to using ruby and dashing and have followed the outlined steps:

                              - Install ruby 1.9+ and rubygems on your system
                              - Follow the instructions at http://shopify.github.io/dashing/#setup
                              - test the sample dashboard to validate the setup

                              - Follow the instructions here https://gist.github.com/jwalton/6670630 to add the cycling screens feature
                              - install the zabby gem
                              - Create the widgets, dashboard and job from this gist https://gist.github.com/dav3860/14b29b70afa589c0b94d:
                              a) put default.erb in /dashboards
                              b) zabbix.rb in /jobs and define the right parameters into the file
                              c) create the zabbix, zabbix_list and text folders in /widgets and put the widget files inside.

                              However when I have altered the config to use the zabbix server address with the username and password when I check the default page I have various boxes which contain:

                              ["str", [Tilt::StringTemplate]]["erb", [Tilt::ErubisTemplate, Tilt::ERBTemplate]]["rhtml", [Tilt::ErubisTemplate, Tilt::ERBTemplate]]["erubis", [Tilt::ErubisTemplate]]["etn", [Tilt::EtanniTemplate]]["etanni", [Tilt::EtanniTemplate]]["haml", [Tilt::HamlTemplate]]["mab", [Tilt::MarkabyTemplate]]["liquid", [Tilt::LiquidTemplate]]["radius", [Tilt::RadiusTemplate]]["markdown", [Tilt::RedcarpetTemplate, Tilt::RedcarpetTemplate::Redcarpet2, Tilt::RedcarpetTemplate::Redcarpet1, Tilt::RDiscountTemplate, Tilt::BlueClothTemplate, Tilt::KramdownTemplate, Tilt::MarukuTemplate]]["mkd", [Tilt::RedcarpetTemplate, Tilt::RedcarpetTemplate::Redcarpet2, Tilt::RedcarpetTemplate::Redcarpet1, Tilt::RDiscountTemplate, Tilt::BlueClothTemplate, Tilt::KramdownTemplate, Tilt::MarukuTemplate]]["md", [Tilt::RedcarpetTemplate, Tilt::RedcarpetTemplate::Redcarpet2, Tilt::RedcarpetTemplate::Redcarpet1, Tilt::RDiscountTemplate, Tilt::BlueClothTemplate, Tilt::KramdownTemplate, Tilt::MarukuTemplate]]["textile", [Tilt::RedClothTemplate]]["rdoc", [Tilt::RDocTemplate]]["wiki", [Tilt::WikiClothTemplate, Tilt::CreoleTemplate]]["creole", [Tilt::CreoleTemplate]]["mediawiki", [Tilt::WikiClothTemplate]]["mw", [Tilt::WikiClothTemplate]]["ad", [Tilt::AsciidoctorTemplate]]["adoc", [Tilt::AsciidoctorTemplate]]["asciidoc", [Tilt::AsciidoctorTemplate]]["html", [Tilt::PlainTemplate]]

                              From this post it looks like there was a folder conflict:
                              http://stackoverflow.com/questions/2...dashing-widget

                              However I feel there is something I have misconfigured. Any ideas where to look?

                              Cheers
                              Jon

                              Comment

                              Working...