Ad Widget

Collapse

PATCH: Template Patch for Zabbix 1.1.1

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Zabbixazzer
    Junior Member
    • Jul 2006
    • 15

    #1

    PATCH: Template Patch for Zabbix 1.1.1

    Here there is Template Patch for Zabbix 1.1.1 - USE IT ONLY WITH ZABBIX VERSION 1.1.1

    This is a patch for the web interface, so you can apply it also AFTER having compiled and/or installed zabbix 1.1.1



    - Install instructions

    - download the file "template_patch_1.1.1.zip" attached to this post and extract it, it contains 3 files:
    ==> "template_patch_1.1.1.diff" --> is the patch file
    ==> "COPYING" --> contains a copy of the GPL license (I was unsure if it is needed to release patches, so I included it just to be sure )
    ==> "INSTALL" --> install instructions, same as here...

    - place the file "template_patch_1.1.1.diff" into the directory of php files of the web frontend.
    It's the same directory where there is the file "index.php".
    If you are applying the patch directly to the program sources, the directory is "frontends/php".

    - launch the following command:

    $ patch -p1 < template_patch_1.1.1.diff

    - now you will have a new option in the web frontend interface...
    If you open the configuration of any host you will find the "Add stuff from template" button...
    Have fun!



    - What does it do (Use instructions)

    It adds a very simple and non-invasive feature.
    After applying this patch to the php frontend, if you go into Configure--->Hosts, and then you click on the name of an host, then if you look at the bottom, under the template selector, you will find a new button named "Add stuff from template".
    To use it, select the template you want as if you were linking the host to the template, but don't click on the "Save" button, which would effectively link the template to the host, instead click on the "Add stuff from template" button, which copies all Items, Triggers and Graphs of the template into the host, but without linking it.
    It's the same result you would have by re-creating all items, triggers and graphs in the host by hand, but this way is very, very much faster!!



    - Known issues - VERY IMPORTANT - READ!!

    You can also add stuff from a template to another template by using the same procedure, but do not use the button to add stuff from a template to itself, otherwise that would result in wrong database entries, and you will have to remove that entries "manually" from the database.
    Apart from this, have fun!!


    - Why I've done it

    At the beginning I was using Zabbix 1.1beta7 to monitor a group of approximately 30 servers. My problem was that with the new templating-feature, which uses linking, I was in trouble: every server is different so I was supposed to re-create all Items and Triggers by hand for every server, which required too much time for me.
    A possible "stylish" solution maybe would be allowing single hosts to link to multiple templates, but I think that such an important, complex and invasive modification should be decided by the project leader, and of course I don't want to do any fork() of the project!!
    Also, such a modification would require too much programming-time for me!!
    So I modified the code of the php frontend by adding some functions and a couple of other lines of code, to obtain this banal, but very helpful "Add stuff from template" button.
    Then after some time I migrated to Zabbix 1.1 final and then to Zabbix 1.1.1 and I re-created the patch for the 1.1.1 version and used it for some time: most of the server-farm-monitoring configuration was already done when I was using 1.1beta7, but after migrating to 1.1.1 I've made many changes to the zabbix configuration, also using this template feature, and it still seems to work fine...
    I hope this feature will be useful for you all too!


    - Does it work? Yes, it does! - Please read here if you want detailed info

    I used a lot the 1.1beta7 version (never released) and it worked fine, the 1.1.1 version should also be fine: I tested it for some time and it seems to be ok.
    The only thing I did not test are the "applications" options in the Items, because I've never used the "applications" feature by now (it's quite new)... anyway, it should work fine too...
    Another thing: I've used a lot this patch with templates that contained Items and Triggers, but quite never with templates that also contained Graphs: I just don't needed that, maybe the Graph-copy feature is quite useless... anyway, I tested it also a little with templates containing Graphs, just to be sure, and it seems to work.
    If there are issues, please report into this thread.



    IMPORTANT: I'm not responsible for any damage to your data, you have full responsibility of what you do with this patch, be careful, if you are unsure of the results of what you are doing, please backup your data before doing anything (one or more database dumps in this case would be very useful)!!!

    PS: I know that most forum-readers just don't need all these instructions on how to apply a patch and so on, but I'm just trying to make this patch usable by all, also newbies!!
    Attached Files
    Last edited by Zabbixazzer; 30-08-2006, 23:31.
  • abi
    Member
    • Jun 2006
    • 81

    #2
    yeah, thats cool! I was waiting for someone implementing that

    Comment

    • Zabbixazzer
      Junior Member
      • Jul 2006
      • 15

      #3
      Wow, I'm happy that this helps at least 1 person!!

      BTW, for everybody: I'd like to receive some feedback in this thread or by forum's private messages...
      Does it work fine?
      Do you think it is helpful?

      Comment

      • makini
        Member
        • Jul 2006
        • 59

        #4
        works quite well for now...

        the patch worked quite nicely...

        we have an installation monitoring around 30 machines, manually cloning items & triggers from few templates would have heavily impacted my brain functions... so it definitely helped.

        on the note of including 'multiple templates per host' feature in the main tree... As Alexei posted here - it was suppose to be considered for v1.2 but since v1.2 is skipped, it will probably appear in the stable 1.4 - see the Roadmap.

        Comment

        • ShivaS
          Member
          • Oct 2005
          • 51

          #5
          amazing!

          very good and useful patch!
          we have around 70 machines with diff applications and this patch saved a lot of our time!
          thanks a lot!

          Comment

          • jcrocker
            Junior Member
            • Aug 2006
            • 2

            #6
            Ditto on the Danke

            Very helpful in our maint. operations! Thanks.

            Comment

            • Hiney
              Junior Member
              • Aug 2006
              • 11

              #7
              Well done.

              I like the fact that i can use it to "copy" a template, and then edit th new one. We have a bunch of Oracle App servers that don't quite suit the unix_t template.

              thanks VM.

              H

              Comment

              • sysigs
                Junior Member
                • Aug 2005
                • 27

                #8
                thank for this patch it was helpfull.

                Comment

                • emx
                  Junior Member
                  • Aug 2006
                  • 19

                  #9
                  Nice patch, minor install issues

                  Thanks for this nice patch which will surely turn out to be very useful.

                  I run into two minor issues when patching:

                  - I patched as root and as such I needed to "chown zabbix:zabbix" the files modified.
                  - I run SELinux so I also had to update the rules to make it work
                  chcon -R -u system_u -r object_r -t httpd_sys_content_t /var/www/html/zabbix

                  Comment

                  • Zabbixazzer
                    Junior Member
                    • Jul 2006
                    • 15

                    #10
                    Thanks to you all for your feedback!!


                    Originally posted by emx
                    - I patched as root and as such I needed to "chown zabbix:zabbix" the files modified.
                    - I run SELinux so I also had to update the rules to make it work
                    chcon -R -u system_u -r object_r -t httpd_sys_content_t /var/www/html/zabbix
                    I've never tested the patch into a SELinux system, so thanks for reporting this!!

                    Comment

                    • nikoula
                      Junior Member
                      • Jul 2005
                      • 29

                      #11
                      many thanks

                      your patch is really enjoyable !!!
                      thx for your time to made it !!

                      Comment

                      • knarfling
                        Member
                        • Sep 2006
                        • 47

                        #12
                        Zabbix 1.1.2

                        First of all, Thank you very, very much for the patch.

                        I am new to Zabbix and did not understand the items/triggers/hosts relationships at first. Being able to copy from an existing template made this understanding much easier.

                        Second, will you be working on a patch for Zabbix 1.1.2?

                        (I did try it, and it seems to link things rather than copy them on 1.1.2)

                        Thank you,
                        Knarfling

                        Comment

                        • pasztorl
                          Junior Member
                          • Jul 2006
                          • 15

                          #13
                          When I copy from a template witch has a trigger depended by another trigger within the source template it copy the trigger with dependency, but the dependency points to the template's trigger.
                          So the patch not handle the trigger dependency correctly I think.
                          Can you fix this?

                          Comment

                          • pasztorl
                            Junior Member
                            • Jul 2006
                            • 15

                            #14
                            Application property not used

                            Comment

                            • Zabbixazzer
                              Junior Member
                              • Jul 2006
                              • 15

                              #15
                              I'll try to make a 1.1.2 version of the patch as soon as possible, and I'll also try to fix the bugs reported by pasztorl...

                              Let's hope I'll finish soon...

                              Comment

                              Working...