Ad Widget

Collapse

PATCH: Bulk Fixes / Changes For 1.1.6

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • James Wells
    Senior Member
    • Jun 2005
    • 664

    #1

    PATCH: Bulk Fixes / Changes For 1.1.6

    Greetings,

    Attached is a bulk patch for 1.1.6. This patch adds new features, and bug fixes against Zabbix 1.1.6. Some of the other patches on the forums that are include in this are;
    To use this patch to it's fullest, against a populated Zabbix DB, you will need to execute the following MySQL (Or other commands for other DBs) commands;
    Code:
    alter table `items` change `key_` `key_` VARCHAR(255) NOT NULL;
    alter table config add ackduration int(4) DEFAULT '1800' NOT NULL;
    alter table alerts add ackuntil int(4) DEFAULT '0' NOT NULL;
    Additionally, to take advantage of the new improved Server Status, you will need to edit a new configuration file called server.inc.php, in the Zabbix UI include directory. This file contains a couple of new configuration entries that are used to gather status using native Zabbix tools. Please read the thread posted at PATCH: Improved Server Status In Reports for further details on using this patch.

    EDIT: 02 Mar 07 - Updated the patch to resolve issues found by Palmertree and some of my co-workers.

    EDIT: 08 Mar 07 -- Updated the patch, see what has changed

    EDIT: 14 Mar 07 -- Created add-on patch. This patch is meant to be applied over the existing bulk patch. See what has changed
    EDIT: 14 Mar 07 #2 -- I had a small typo in the patch G patch, you will need to add the H patch as well. Sorry for the inconvenience.
    EDIT: 17 Mar 07 -- Fixed the latest round of issues. I have also begun documenting classes and functions in the UI. The documentation, what there is of it anyway, can be viewed with phpdoc. My goal is to completely document the UI's functions and classes to ease the transition from 1.1.6 to 1.4 and or custom UI's.
    EDIT: 29 Mar 07 -- This patch is mostly adding more phpdoc components, however, there are a couple of minor bug fixes as well.
    Attached Files
    Last edited by James Wells; 29-03-2007, 18:12.
    Unofficial Zabbix Developer
  • bbrendon
    Senior Member
    • Sep 2005
    • 870

    #2
    Nice work james!

    Any comments from Alexei when these will be officially supported?
    Unofficial Zabbix Expert
    Blog, Corporate Site

    Comment

    • Palmertree
      Senior Member
      • Sep 2005
      • 746

      #3
      Very nice work James.

      Just a FYI. I am getting the following in the HTTPD logs:

      [Wed Feb 28 14:03:53 2007] [error] [client x.x.x.x] PHP Notice: Undefined variable: gray in /var/www/html/zabbix/map.php on line 350, referer: https://www.somesite.com/zabbix/scre...n=0&screenid=1

      I just replace "gray" with "grey" on line 350.

      Again, nice work.

      Comment

      • Palmertree
        Senior Member
        • Sep 2005
        • 746

        #4
        I had to add the following to tr_status.php to fix a variable not found for $cond


        $time=date("[H:i:s]",time());
        if(isset($_REQUEST["fullscreen"]))
        {
        $cond=(isset($_REQUEST["hostid"])) ? "&hostid=".$_REQUEST["hostid"] : "";
        show_table_header("<A HREF=\"tr_status.php?onlytrue=$onlytrue&noactions= $noactions&compact=$compact&sort=$sort\">".S_TRIGG ERS_BIG." $time</A>");

        $hostcond=(isset($_REQUEST["hostid"])&&($_REQUEST["hostid"]>0))
        ? " and h.hostid=".$_REQUEST["hostid"] : "";

        $p0=$p1=$p2=$p3=$p4=$p5=0;

        Comment

        • Palmertree
          Senior Member
          • Sep 2005
          • 746

          #5
          James, when I try to ack a triggered alert I see a drop down menu for ack duration but there is not submit button. Any ideas?

          Thanks for the great patch. Keep up the good work.

          Comment

          • James Wells
            Senior Member
            • Jun 2005
            • 664

            #6
            Thanx Palmertree. These issues and a few others have now been resolved.
            Unofficial Zabbix Developer

            Comment

            • James Wells
              Senior Member
              • Jun 2005
              • 664

              #7
              Well, I have fixed a few more issues, and added new features and cleaned up a bunch of stuff, so I thought I would re-post this patch.

              Two new features to notes are the inclusion of two new triggers;
              1. txtcount -- This one was actually submitted by Safl. It basically adds a little swatch capability to Zabbix. Additionally, this gave me a clue on how to create the second new trigger. Thanx Safl.
              2. trgcnt -- This trigger allows you to alert based on the number of time another trigger goes true. Thats the good news, the bad news is that I haven't yet figured out how to make this trigger user friendly. I will explain a bit more about this trigger and how to use it below.


              In addition to the bugs listed above, this bulk patch also fixes a bug that has been in the 1.1 release since before 1.1Alpha5 and has been documented as a bug no less than 20 times since then, THE TRIGGER DEPENDENCIES BUG. In fact when you apply this patch and look at the triggers configuration page, it should be fairly obvious what the bug is.

              Other bugs that have been fixed;
              1. Cyclical SMS Buffer -- Submitted by Aris.
              2. Pid File Locking -- Submitted by Scarab
              3. And both of the patches currently in the SVN for 1.1.7.... Oh wait, we had those in the previous bulk patch.


              To use the new trgcnt trigger, you need to understand that this trigger is not tied to an item, instead it is tied to a trigger, unfortunately, Zabbix doesn't currently have a way to disconnect a trigger from an item, so we make this work, we have to create items that are checked often, but will always return value other than "Not Supported". For example, I use zabbix[items_unsupported]. I then create a trigger for another item, for example icmpping. I set the icmpping trigger to trigger as informational if the server can't ping the agent. I then create a trgcnt trigger that will trigger, only if the icmpping trigger fires more than 5 times in 5 minutes. The trigger looks like this;
              Code:
              {HOST:zabbix[items_unsupported].trgcnt(10344,300)}>5
              In this example, I have an item created on each of my hosts with an update interval of 2 minutes. The item is actually an internal check by the Zabbix Server, in this case a check to see how many unsupported items we have in the DB. Now, as I said above, trgcnt is not actually tied to the item, frankly I don't care how many unsupported items we have, instead, this trigger checks to see how many times triggerid 10344 has gone true over the last 300 seconds (5 minutes), if that value is greater than 5, we generate a new alert.... Wheeeee, we have preliminary flap detection.

              Finally, in this patch, I have gotten quite a bit closer to getting the new PDF report generation feature working. Right now, I can generate reports for yesterday, last week, last month, and last quearter, for an entire group of servers. The report will list every trigger that has gone true, their duration, and percentage of time that the trigger was true. It will also list all of the servers in the group, and will eventually include all of the graphs for the hosts in that group. If you decide you want to get a feel for how it looks right now, please log into your UI, after applying this patch of course, then change the file portion of the URL in your web browser to look at report6.php. Not much to look at right now, but it is getting there.
              Last edited by James Wells; 14-03-2007, 16:18.
              Unofficial Zabbix Developer

              Comment

              • bbrendon
                Senior Member
                • Sep 2005
                • 870

                #8
                Might all of this be going into 1.4? This patch is expanding my the second. At what point will this be a separate branch of zabbix?
                Unofficial Zabbix Expert
                Blog, Corporate Site

                Comment

                • jbothe
                  Junior Member
                  • Sep 2006
                  • 10

                  #9
                  Is this patch considered 1.1.7? The footer has been changed...

                  Comment

                  • James Wells
                    Senior Member
                    • Jun 2005
                    • 664

                    #10
                    Originally posted by jbothe
                    Is this patch considered 1.1.7? The footer has been changed...
                    Woops, sorry 'bout that. It's actually 1.1.6, but it has had both changes in 1.1.7(SVN) since before the SVN was made public. It should show 1.1.6, but I brain farted and forgot to reset it back to 1.1.6 after doing an SVN compare this morning.
                    Unofficial Zabbix Developer

                    Comment

                    • James Wells
                      Senior Member
                      • Jun 2005
                      • 664

                      #11
                      After posting this patch, I was discussing the trgcnt function with my company's Zabbix Admin and I realized a possible problem with the function. As written it works great for small scale deployments, but when you start getting larger deployments, like we have where I work, you run into a potential show-stopper issue.

                      As I wrote when I added the feature, it is not tied to an item, as other triggers are, you still have to use an item, but it doesn't do anything with the value returned by the item. So far so good, however, because of the fact that you have to use an item that can never return ZBX_NOTSUPPORTED, you are actually fairly limited on the choices. To solve this problem, I created another patch, against the bulk patch which provides an unlimited number of "bogus" items. These items are internal checks only and always return 1.

                      To use the new checks simply create an item of type Zabbix Internal with the key of zbxping[<Number or String>]. The value between the brackets can be anything you want as the Zabbix server simply drops it. For example, zbxping[10344], with a periodicity of 150 (2-1/2 minutes). Then attach the trgcnt trigger to it.

                      Finally, I have one more annoyance that I realized while writing this extra patch. Because the trgcnt is a seperate trigger from the one you are testing for, all macros will be specific to the trgcnt item itself. You can still get some meaningful data here, but it will require a bit of finagling.

                      Finally, this second patch will work correctly on a stock 1.1.6 for anyone who wants to create "bogus" items.
                      Attached Files
                      Unofficial Zabbix Developer

                      Comment

                      • Alexei
                        Founder, CEO
                        Zabbix Certified Trainer
                        Zabbix Certified SpecialistZabbix Certified Professional
                        • Sep 2004
                        • 5654

                        #12
                        I would like to thank James for the great work of creating and maintaining this set of patches. Most of the patches will be integrated into ZABBIX in one form or another.

                        Just a couple of comments:

                        1. txtcount(txt,period). I would be happy to see more generalized function which would support non-text items as well. Something like valcount(value, period):

                        valcount(123,300) #integer
                        valcount(error,300) #string/text

                        I don't mind to improve the patch myself.

                        2. trgcnt(triggerid,period). The idea is very good, yet I would implement it differently (if possible) to get rid of use of the triggerid. This is extremely user unfriendly and there is no normal way to see trigger id in ZABBIX GUI (1.3.x). If one deletes the trigger ZABBIX won't notice this.

                        3. SMS patch. We had no chance to test it yet, but it should be fine.

                        4. PID file locking. This is already in ZABBIX.

                        James, is it possible to have a list of all bits of new functionality introduced by this patch?
                        Alexei Vladishev
                        Creator of Zabbix, Product manager
                        New York | Tokyo | Riga
                        My Twitter

                        Comment

                        • safl
                          Senior Member
                          • May 2005
                          • 103

                          #13
                          Alexei> Regarding txtcount, I actually created that patch/function
                          See: http://www.zabbix.com/forum/showthread.php?t=5408

                          I'll do a more generalized version today, and also expand the patch with some of the missing frontend code.

                          Cheers!

                          Comment

                          • Alexei
                            Founder, CEO
                            Zabbix Certified Trainer
                            Zabbix Certified SpecialistZabbix Certified Professional
                            • Sep 2004
                            • 5654

                            #14
                            Thanks, Safl! I won't touch your original code, will wait for a new one instead
                            Alexei Vladishev
                            Creator of Zabbix, Product manager
                            New York | Tokyo | Riga
                            My Twitter

                            Comment

                            • safl
                              Senior Member
                              • May 2005
                              • 103

                              #15
                              Here it is, the new and improved version of txtcount!
                              valcount!

                              Patch is right here:

                              Comment

                              Working...