Ad Widget

Collapse

IT Service, improves performance and flexibility of interval

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vian
    Junior Member
    • Jun 2009
    • 3

    #1

    IT Service, improves performance and flexibility of interval

    Because of the large number of services monitored, my company needed to improve the performance of SLA calculations and allow the flexibility of interval calculation including the user possibility to set the desired interval.

    The code is all commented, and to customize it is just a matter of changing small portions of the code, as it was divided in several helper functions.

    Note: The patch is for Zabbix-1.6.4

    I appreciate any help or suggestions to improvement.

    Thanks in advance,
    Attached Files
    Last edited by vian; 15-06-2009, 14:46.
  • Elias Junior
    Junior Member
    • Jun 2009
    • 6

    #2
    Hi, folks!

    I am one of the developers who helped vian when developing this patch.

    Just to add more information:
    This patch implements about the same functionality that flexguy's (available here: http://www.zabbix.com/forum/showthread.php?t=11798), but also offers the option for you to select a custom period, by choosing two dates.

    Also, this patch improves a great deal the performance of the chart generation by using image resizing to create the charts, instead of making HTTP requests to chart_sla.php and creating an image on-the-fly (this was eating up our server resources).

    Hope it helps out somebody else!

    Comment

    • Fatima R R Tonon
      Zabbix Certified Specialist
      Zabbix Certified Specialist
      • Oct 2004
      • 29

      #3
      Congratulations

      Elias congratulations, was excellent and very quick!

      Comment

      • exkg
        Senior Member
        Zabbix Certified Trainer
        Zabbix Certified Specialist
        • Mar 2007
        • 718

        #4
        Oi Fatima,

        Testamos por aqui tambem e funcionou perfeitamente na 1.6.4.


        Elias,

        Otimo trabalho


        Aly / Alexei,

        What you think about this patch? I need say: its a great feature and customers use to ask for ... We know 'IT Services' is being redefined, what can we expect for new versions ?


        []s,
        Luciano
        --
        Luciano Alves
        www.zabbix.com
        Brazil | México | Argentina | Colômbia | Chile
        Zabbix Performance Tuning

        Comment

        • Elias Junior
          Junior Member
          • Jun 2009
          • 6

          #5
          thank you guys, glad you liked!

          hope it gets upstream!

          Comment

          • exkg
            Senior Member
            Zabbix Certified Trainer
            Zabbix Certified Specialist
            • Mar 2007
            • 718

            #6
            Ops ...

            A new little change in 'srv_status.php':

            ==========
            function create_chart_sla($goodsla, $problem, $sla_ok){
            $percentage = 20;
            $p = min($problem, $percentage);
            ==========

            We change to:

            ==========
            function create_chart_sla($goodsla, $problem, $sla_ok){
            $percentage = 100;
            $p = min($problem, $percentage);
            ==========

            ... to get the correct scale in SLA graph.



            []s,
            Luciano
            --
            Luciano Alves
            www.zabbix.com
            Brazil | México | Argentina | Colômbia | Chile
            Zabbix Performance Tuning

            Comment

            • Elias Junior
              Junior Member
              • Jun 2009
              • 6

              #7
              Originally posted by exkg
              Ops ...

              A new little change in 'srv_status.php':

              $percentage = 20;

              We change to:

              $percentage = 100;

              ... to get the correct scale in SLA graph.
              yes, that was something i questioned my mates about, and they said that it was supposed to show only the percentage above 80%, and consider total failure anything below it, so...

              i'll check with them later, and update the patch.

              thank you!

              Comment

              • Aly
                ZABBIX developer
                • May 2007
                • 1126

                #8
                Originally posted by exkg
                Oi Fatima,

                Testamos por aqui tambem e funcionou perfeitamente na 1.6.4.


                Elias,

                Otimo trabalho


                Aly / Alexei,

                What you think about this patch? I need say: its a great feature and customers use to ask for ... We know 'IT Services' is being redefined, what can we expect for new versions ?


                []s,
                Luciano
                Don't worry, we've noticed this patch, we will soon review it and probably include it in zabbix, if authors don't mine?!
                Zabbix | ex GUI developer

                Comment

                • Elias Junior
                  Junior Member
                  • Jun 2009
                  • 6

                  #9
                  Originally posted by Elias Junior
                  yes, that was something i questioned my mates about, and they said that it was supposed to show only the percentage above 80%, and consider total failure anything below it, so...

                  i'll check with them later, and update the patch.
                  i've checked, and they are right!
                  we just changed the way the charts are rendered, zabbix already behaved like this.
                  so, i think the patch is all right.

                  Comment

                  • vian
                    Junior Member
                    • Jun 2009
                    • 3

                    #10
                    Originally posted by Aly
                    Don't worry, we've noticed this patch, we will soon review it and probably include it in zabbix, if authors don't mine?!
                    Of course we don't mind, we are glad to be useful!!!

                    Comment

                    • exkg
                      Senior Member
                      Zabbix Certified Trainer
                      Zabbix Certified Specialist
                      • Mar 2007
                      • 718

                      #11
                      Hi,

                      i've checked, and they are right!
                      we just changed the way the charts are rendered, zabbix already behaved like this.
                      so, i think the patch is all right.

                      Yes we know about. But I'm in doutbt yet ... we have changed this value since first times to get correct graph scale. If we preserve '20' graph isn't in scale ... but, we didnt deep avaliation.


                      []s,
                      Luciano
                      --
                      Luciano Alves
                      www.zabbix.com
                      Brazil | México | Argentina | Colômbia | Chile
                      Zabbix Performance Tuning

                      Comment

                      • Elias Junior
                        Junior Member
                        • Jun 2009
                        • 6

                        #12
                        fix for strange things JS related

                        hey, folks!

                        when making the previous patch, we changed the way the javascript codes were being scheduled for execution when the page was loaded.
                        the approach was registering a function with onload="zbxCallPostScripts();" in html body, and putting all the code in that function.
                        the problem with that approach is that code is that onload sometimes executes when the page is not completely loaded yet (images, css, etc). (more about this problem here: http://docs.jquery.com/How_jQuery_Wo...Document_Ready ).

                        we changed that code to use prototype's library observe method, in order to our code for date selectors work appropriately.
                        the problem is, there were code that relied in the previously behaviour (like the code for the scrollbar in history.php?action=showgraph), that behaved strangely with our changes.
                        our fault, sorry!

                        so here is a fix (a patch to be applied on top of the previous) that restores previous approach using window.onload, but still supports the approach using document.observe, and everything is working again.
                        Attached Files

                        Comment

                        • zabbix_zen
                          Senior Member
                          • Jul 2009
                          • 426

                          #13
                          patch for 1.6.5

                          Hi mates / Oi Elias

                          Would it be possible for you guys to modify the given patch for version 1.6.5?
                          I've run it using a --dry-run but it outputed,

                          Hunk #2 FAILED at 254.
                          Hunk #3 succeeded at 341 (offset -2 lines).
                          1 out of 4 hunks FAILED -- saving rejects to file frontends/php/srv_status.php.rej
                          patching file frontends/php/include/page_footer.php
                          Hunk #1 succeeded at 38 (offset -1 lines).
                          patching file frontends/php/include/page_header.php
                          patching file frontends/php/include/locales/en_gb.inc.php
                          Hunk #1 succeeded at 1028 (offset -212 lines).
                          Hunk #2 FAILED at 1201.
                          1 out of 2 hunks FAILED -- saving rejects to file frontends/php/include/locales/en_gb.inc.php.rej


                          Problem is I'm still kind of a newbie when it comes to patches.

                          Bom ver que também fizeram patch para o pt_br.inc.php ( já que sou português) apesar de termos a nossa instalação ZABBIX configurada em inglês.

                          Obrigado e óptimo trabalho!
                          Thanks,

                          João

                          Comment

                          • Elias Junior
                            Junior Member
                            • Jun 2009
                            • 6

                            #14
                            hey, man, thank you for your feedback, sorry for the delay to answer!
                            I'm currently working with other stuff, and I don't know if I'll have the time to see the changes necessaries for the 1.6.5 version to build a new patch.

                            I noticed that some of our changes are into the Pre 1.6.6, with code much better than ours, so I think it's best to wait for it, and do a new patch then, if necessary.

                            Comment

                            Working...