Ad Widget

Collapse

map recurence

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SLMitch
    Member
    • May 2006
    • 39

    #1

    map recurence

    When we use a map in which we have an other map as an object, and if they are 1 error (not more) in the more deep map, status may be OK : the recursion use the same variable in each loop, and can lose information of 1 problème.

    When we are more probleme, info is not important and probleme is not visible.

    This patch make a temporary variable in order to memorize when a problem occur. The temporary variable is uniq and may be re-writen in a loop, but its result are only important in the case of 1 problem.

    Code:
    diff -uwBb zabbix-1.1-orig/frontends/php/include/maps.inc.php zabbix-1.1/frontends/php/include/maps.inc.php
    --- zabbix-1.1-orig/frontends/php/include/maps.inc.php        2006-05-23 16:04:50.000000000 +0200
    +++ zabbix-1.1/frontends/php/include/maps.inc.php     2006-07-12 15:27:12.000000000 +0200
    @@ -291,8 +291,16 @@
                                    " where sysmapid=".$db_element["elementid"]);
                            while($db_subelement = DBfetch($db_subelements))
                            {// recursion
    -                               $count += get_info_by_selementid($db_subelement["selementid"],$info,$color);
    +                               $tmp = get_info_by_selementid($db_subelement["selementid"],$info,$color);
    +                               $count += $tmp;;
    +                               if($tmp)
    +                               {
    +                                       $infotmp=$info;
    +                                       $colortmp=$color;
    +                               }
                            }
    +                       $info=$infotmp;
    +                       $color=$colortmp;
    
                            if($count==0)
                            {
  • raminix
    Member
    • Jun 2006
    • 37

    #2
    You sir are a gentleman and a scholar. Your patch works perfectly and has put my biggest issue with Zabbix to bed.

    Thanks!

    Comment

    • bdo
      Junior Member
      • Oct 2005
      • 15

      #3
      Yes thx for this Patch !!!


      --bdo
      Zabbix 1.1.1

      Comment

      • ci_newman
        Junior Member
        • Jul 2006
        • 15

        #4
        As above, you're a star!!

        We had to tweak it slightly to allow it to read *1 problem* opposed to taking its value from the trigger (if that makes sense). As the loop will only be *seen* if there is one problem, we set a static reply as reads below:

        Code:
        diff -uwBb zabbix-1.1-orig/frontends/php/include/maps.inc.php zabbix-1.1/frontends/php/include/maps.inc.php
        --- zabbix-1.1-orig/frontends/php/include/maps.inc.php        2006-05-23 16:04:50.000000000 +0200
        +++ zabbix-1.1/frontends/php/include/maps.inc.php     2006-07-12 15:27:12.000000000 +0200
        @@ -291,8 +291,16 @@
        				" where sysmapid=".$db_element["elementid"]);
        			while($db_subelement = DBfetch($db_subelements))
        			{// recursion
        -				//$count += get_info_by_selementid($db_subelement["selementid"],$info,$color);
        +			           $tmp = get_info_by_selementid($db_subelement["selementid"],$info,$color);
        +                                $count += $tmp;;
        +                                if($tmp)
        +                                {
        -                                         $infotmp=$info;
        -                                         $colortmp=$color;
        +						$infotmp	= "1 ".S_PROBLEMS_SMALL;
        +						$colortmp	= $colors["Red"];
        +
        +                                }
        +                        }
                                $info=$infotmp;
                                $color=$colortmp;
        
        			if($count==0)
        Most excellent find though Sorts out one a few of my minor annoyances

        Comment

        • richlv
          Senior Member
          Zabbix Certified Trainer
          Zabbix Certified SpecialistZabbix Certified Professional
          • Oct 2005
          • 3112

          #5
          i didn't test it , but is the original problem still present in latest version ?
          Zabbix 3.0 Network Monitoring book

          Comment

          Working...