Ad Widget

Collapse

How to use the out_of_mem patch?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • maxijose
    Member
    • May 2007
    • 36

    #1

    How to use the out_of_mem patch?

    I'm sorry to bother you all but I don't know how to use zabbix patches.
    What should I do?
    Should I add by hand the modification and recompile all or is there something else to do?

    Thanks for your answers
  • maxijose
    Member
    • May 2007
    • 36

    #2
    [Solved]

    There's a utility named patch (can install it with yum if you do not have it yet).

    Then you apply your patch doing: "patch (-p 1) < out_of_mem2.patch"

    the option -p 1 is not necessary (see man page of patch)

    And it patches.
    Now everything works fine. No error messages.

    Comment

    • tronite
      Senior Member
      • Jun 2007
      • 147

      #3
      Originally posted by maxijose
      [Solved]

      There's a utility named patch (can install it with yum if you do not have it yet).

      Then you apply your patch doing: "patch (-p 1) < out_of_mem2.patch"

      the option -p 1 is not necessary (see man page of patch)

      And it patches.
      Now everything works fine. No error messages.
      It's people like you that we need on such lists to keep us abrest with patches, thanks for the info, I was also wondering how this is done.

      Comment

      • zombiehunter
        Member
        • Jun 2007
        • 31

        #4
        ugh

        I got this- what does this mean and how can I fix it? I verified that the windows host group still isn't showing up so it must not have patched.
        I didn't restart the zabbix server however. that matter?
        ***EDIT-I tried restarting to no avail***
        I copied the patch into this folder btw.



        netprobe:/home/zabbix/frontends/php/include# patch < perm.patch
        can't find file to patch at input line 5
        Perhaps you should have used the -p or --strip option?
        The text leading up to this was:
        --------------------------
        |Index: ChangeLog
        |================================================= ==================
        |--- ChangeLog (revision 4258)
        |+++ ChangeLog (working copy)
        --------------------------
        File to patch: perm.inc.php
        patching file perm.inc.php
        Hunk #1 FAILED at 1.
        1 out of 1 hunk FAILED -- saving rejects to file perm.inc.php.rej
        patching file perm.inc.php
        netprobe:/home/zabbix/frontends/php/include#
        Last edited by zombiehunter; 09-06-2007, 16:58.

        Comment

        • maxijose
          Member
          • May 2007
          • 36

          #5
          You should know what the patch does first.
          In fact a patch is a file that modifies another (the file to patch) commonly by replacing lines, words... by others or by adding lines, words etc.
          The lines that are removed are preceded by a - and the one that are added are preceeded by a +. Globally it's all it does.

          But, the fact is a patch is made for a precise file: no changes should have been made to the file.
          So two questions arise: Have you changed the file in beetween? Is the patch made for the precise file you have?

          Look at your reject file to see the differences between your file and the file the patch is suppose to patch and do the modification by hand.

          Hope it helped. If someone has better explanation please help.

          PS: if you are not sure the patch will work use this option. It makes a simulation of the patch and creates a rej file if there are errors.

          patch --dry-run < file.patch
          Last edited by maxijose; 09-06-2007, 17:04.

          Comment

          • zombiehunter
            Member
            • Jun 2007
            • 31

            #6
            thanks for the info. It is a patch for windows groups not showing up. I couldnt figure out how to patch though.
            found it here- http://www.zabbix.com/forum/showthread.php?t=6208

            this is what's in the rej file-

            ***************
            *** 1,5 ****
            Changes for 1.4.1:

            - minor fix of zabbix_sender command line help (Alexei)
            - fixed pinger to process DNS name instead of host name (Alexei)
            - fixed possible incorrect memory access in nodewatcher (Alexei)
            --- 1,6 ----
            Changes for 1.4.1:

            + - fixed bug in processing of host groups permissions (Alexei)
            - minor fix of zabbix_sender command line help (Alexei)
            - fixed pinger to process DNS name instead of host name (Alexei)
            - fixed possible incorrect memory access in nodewatcher (Alexei)
            Last edited by zombiehunter; 09-06-2007, 18:55.

            Comment

            • zombiehunter
              Member
              • Jun 2007
              • 31

              #7
              oops

              i was incorrect- THIS is the contents of my rej file- I keep getting failed hunk errors...

              ***************
              *** 281,287 ****
              $group_data['permission'] = $nodes[$group_data['nodeid']]['permission'];
              }

              - $processed[$group_data['permission']] = true;

              if(eval('return ('.$group_data["permission"].' '.perm_mode2comparator($perm_mode).' '.$perm.')? 0 : 1;'))
              continue;
              --- 281,288 ----
              $group_data['permission'] = $nodes[$group_data['nodeid']]['permission'];
              }

              + // $processed[$group_data['permission']] = true;
              + $processed[$group_data['groupid']] = true;

              if(eval('return ('.$group_data["permission"].' '.perm_mode2comparator($perm_mode).' '.$perm.')? 0 : 1;'))
              continue;

              Comment

              Working...