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!!
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!!

Comment