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

    #16
    Originally posted by Alexei
    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.
    Agree. Unfortunately, I have not been able to figure out a better way to do it.

    I could use a "where like" clause and search against the trigger description, but the problem I see there is that I would have to change item information to get anything meaningful out of it. For example using this against a flapping ping check. If I have only a single ping, it is obvious which host and trigger it belongs to, but what happens when I have 15K hosts, all with the same exact text in their trigger name. This trigger fires, tests all 15K, and throws 15 alerts. Which 15 of the 15K hosts am I getting the alerts on? So to get around that I would have to add further code to the trigger that would somehow alter the function callers item variable directly which has some nasty implications, and frankly I am not a good enough C coder to do that

    Another possibility would be to create a new "flap detection" page in the UI and have it construct the item / trigger, which I should probably do anyway, but we still run into the issue of what happens when the real trigger is deleted.

    Would appreciate any feedback on better ways of doing this one.
    4. PID file locking. This is already in ZABBIX.
    Possibly in 1.3.x, but it's certainly not in 1.1.x.

    James, is it possible to have a list of all bits of new functionality introduced by this patch?
    I will update the Changelog with that information soon.
    Unofficial Zabbix Developer

    Comment

    • Palmertree
      Senior Member
      • Sep 2005
      • 746

      #17
      James,
      When you get a chance please post your newest update for the 1.1.6 bulk load fixes that includes the txtcount to valcount updates. I really appreciate the hardwork you guys are putting into these patches. Keep up the good work.

      Comment

      • Palmertree
        Senior Member
        • Sep 2005
        • 746

        #18
        James,

        I found an error or a typo in the audit.php file. AUDIT_ACTION_DETELE should be AUDIT_ACTION_DELETE.

        [Mon Mar 12 14:31:33 2007] [error] [client x.x.x.x] PHP Notice: Use of undefined constant AUDIT_ACTION_DETELE - assumed 'AUDIT_ACTION_DETELE' in /var/www/html/zabbix/audit.php on line 147

        Comment

        • Palmertree
          Senior Member
          • Sep 2005
          • 746

          #19
          Also found this is the include/classes/graph.ini.php file.

          [Mon Mar 12 14:44:56 2007] [error] [client x.x.x.x] PHP Notice: Undefined index: 1 in /var/www/html/zabbix/include/classes/graph.inc.php on line 1031, referer: https://www.somesite.com/zabbix/hist...h&itemid=35736

          I made the following replacements which seamed to work but I am not sure if I did it right. Maybe someone else can clarify.

          Replaced this:

          $curr_data = &$this->data[$this->items[$i]["itemid"]][$type];
          $curr_data->count = NULL;
          $curr_data->min = NULL;
          $curr_data->max = NULL;
          $curr_data->avg = NULL;
          $curr_data->clock = NULL;
          $curr_data->sum = NULL;

          foreach($sql_arr as $sql)
          {
          $result=DBselect($sql);
          while($row=DBfetch($result))
          {
          $idx=$row["i"];
          $curr_data->count[$idx] = $row["count"];
          $curr_data->min[$idx] = $row["min"];
          $curr_data->max[$idx] = $row["max"];
          $curr_data->avg[$idx] = $row["avg"];
          $curr_data->clock[$idx] = $row["clock"];
          $curr_data->sum[$idx] += $row["avg"];
          $curr_data->shift_min[$idx] = 0;
          $curr_data->shift_max[$idx] = 0;
          $curr_data->shift_avg[$idx] = 0;
          }
          }

          With this:
          $curr_data->count = NULL;
          $curr_data->min = NULL;
          $curr_data->max = NULL;
          $curr_data->avg = NULL;
          $curr_data->clock = NULL;
          $this->items[$i]["sum"] = NULL;

          foreach($sql_arr as $sql)
          {
          $result=DBselect($sql);
          while($row=DBfetch($result))
          {
          $idx=$row["i"];
          $curr_data->count[$idx] = $row["count"];
          $curr_data->min[$idx] = $row["min"];
          $curr_data->max[$idx] = $row["max"];
          $curr_data->avg[$idx] = $row["avg"];
          $curr_data->clock[$idx] = $row["clock"];
          $this->items[$i]["sum"] += $row["avg"];
          $curr_data->shift_min[$idx] = 0;
          $curr_data->shift_max[$idx] = 0;
          $curr_data->shift_avg[$idx] = 0;
          }
          }

          /* calculate missed points */

          Comment

          • James Wells
            Senior Member
            • Jun 2005
            • 664

            #20
            Originally posted by Palmertree
            When you get a chance please post your newest update for the 1.1.6 bulk load fixes that includes the txtcount to valcount updates.
            I plan to post that on Tuesday. Tuesday's patch will contain mostly clean up, fixing bugs that you and others have reported with the bulk patch, but will also contain two new triggers; gvalcount and lvalcount. Gvalcount is the non-string portion of valcount, but instead of looking for exact matches it counts the number of times the returned data is greater than a certain value. lvalcount is for less than.
            Unofficial Zabbix Developer

            Comment

            • Palmertree
              Senior Member
              • Sep 2005
              • 746

              #21
              Thanks. Great work.

              Comment

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

                #22
                James,

                Would it be possible to split this big patch into number of smaller ones? I'm thinking of one patch per feature. This would simplify integration very much! Thanks.
                Alexei Vladishev
                Creator of Zabbix, Product manager
                New York | Tokyo | Riga
                My Twitter

                Comment

                • James Wells
                  Senior Member
                  • Jun 2005
                  • 664

                  #23
                  Originally posted by Alexei
                  Would it be possible to split this big patch into number of smaller ones? I'm thinking of one patch per feature. This would simplify integration very much! Thanks.
                  Early on in the development, it would have, but the many of the later changes depend too heavily on the earlier individual patches which were submitted, but never commented / acted on. For example, the improved Acknowledge patch relies on some of the bug fix patches which went before it, such as the comment protection patch. And the graph item grouping patch relies on some of the code from the dependency filter patch. And the report generator, which I am currently working on, relies on bug fixes I made to the IT Services section, which in turn rely on features provided by the improved Acknowledge patch.
                  Unofficial Zabbix Developer

                  Comment

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

                    #24
                    Fair enough. We will review your patch at some point, probably when we start thinking about improving of SLA functionality (March). Some functionality, like new trigger functions, could be integrated even earlier.
                    Alexei Vladishev
                    Creator of Zabbix, Product manager
                    New York | Tokyo | Riga
                    My Twitter

                    Comment

                    • bbrendon
                      Senior Member
                      • Sep 2005
                      • 870

                      #25
                      Originally posted by Alexei
                      Fair enough. We will review your patch at some point, probably when we start thinking about improving of SLA functionality (March). Some functionality, like new trigger functions, could be integrated even earlier.
                      Thanks for the comments Alexei.

                      If at all possible, the acknowledgment patch is extremely important for us and probably others because we can't use actions with repeats without it.
                      Unofficial Zabbix Expert
                      Blog, Corporate Site

                      Comment

                      • safl
                        Senior Member
                        • May 2005
                        • 103

                        #26
                        Alexei,

                        The valcount function patch is quite standalone.

                        Comment

                        • James Wells
                          Senior Member
                          • Jun 2005
                          • 664

                          #27
                          Sorry for the delay in posting the new patch.

                          This patch is mostly bug fixes against the bulk patch, but also adds two new triggers, again based on Safl's work;
                          1. GVALCOUNT -- This trigger requires two parameters, the first parameter is a value you wish to compare against, while the second parameter is the number of seconds too look back or the number of item updates. This one returns the number of times the item check exceeded the first parameter. For example {host:icmppingsec.gvalcount(1.0,300)} will return how many times icmppingsec took over 1 second to complete in the last 5 minutes.
                          2. LVALCOUNT -- This trigger requires two parameters, the first parameter is a value you wish to compare against, while the second parameter is the number of seconds too look back or the number of item updates. This one returns the number of times the item check was less than the first parameter. For example {host:icmppingsec.gvalcount(1.0,300)} will return how many times icmppingsec took less than 1 second to complete in the last 5 minutes.


                          Additionally, in this patch, I have made a bit more progress on the PDF report generator, as well as started cleaning out code that is no longer used and started converting various inline code snippets to functions. For example the trigger priority code was written about 5 different times, the same code for each one, I made a function out of it.

                          The patch is posted at the top of the thread
                          Last edited by James Wells; 14-03-2007, 16:34.
                          Unofficial Zabbix Developer

                          Comment

                          • Palmertree
                            Senior Member
                            • Sep 2005
                            • 746

                            #28
                            James,

                            Great work on the bulk patches. Your help and others makes this a great product.

                            I found one error were the audit logs were not displaying. I only had to remove the $ sign on line 97 in the db.inc.php file.

                            Before:
                            //SDI('DBselect: ['.$query.']');

                            COpt::savesqlrequest($query);

                            $result = false;

                            if($DB_TYPE == "MYSQL")
                            {
                            if(is_numeric($limit))
                            {
                            $query .= ' limit '.intval($limit);
                            if($is_numeric($offset))
                            {
                            $query .= ' offset '.intval($offset);
                            }
                            }
                            $result=mysql_query($query,$DB);
                            if(!$result)
                            {
                            echo "Error in query [$query] [".mysql_error()."]";
                            }
                            }

                            After:
                            //SDI('DBselect: ['.$query.']');

                            COpt::savesqlrequest($query);

                            $result = false;

                            if($DB_TYPE == "MYSQL")
                            {
                            if(is_numeric($limit))
                            {
                            $query .= ' limit '.intval($limit);
                            if(is_numeric($offset))
                            {
                            $query .= ' offset '.intval($offset);
                            }
                            }
                            $result=mysql_query($query,$DB);
                            if(!$result)
                            {
                            echo "Error in query [$query] [".mysql_error()."]";
                            }
                            }

                            Comment

                            • James Wells
                              Senior Member
                              • Jun 2005
                              • 664

                              #29
                              Grrr. I remember seeing that, but forgot to fix it. Thanx for catching it.
                              Unofficial Zabbix Developer

                              Comment

                              • Palmertree
                                Senior Member
                                • Sep 2005
                                • 746

                                #30
                                Just another quick note. I had to comment out line 1032 in the graph.inc.php file because I was getting an "Undefined index" in the httpd logs. I've been messing around with it to see if I can fix the sum function. So far no luck. :-)

                                $result=DBselect($sql);
                                while($row=DBfetch($result))
                                {
                                $idx=$row["i"];
                                $curr_data->count[$idx] = $row["count"];
                                $curr_data->min[$idx] = $row["min"];
                                $curr_data->max[$idx] = $row["max"];
                                $curr_data->avg[$idx] = $row["avg"];
                                $curr_data->clock[$idx] = $row["clock"];
                                # $curr_data->sum[$idx] += $row["avg"];
                                $curr_data->shift_min[$idx] = 0;
                                $curr_data->shift_max[$idx] = 0;
                                $curr_data->shift_avg[$idx] = 0;
                                }

                                Comment

                                Working...