Koozali.org: home of the SME Server

Obsolete Releases => SME 7.x Contribs => Topic started by: wjp79 on November 23, 2009, 05:38:30 PM

Title: Zabbix template
Post by: wjp79 on November 23, 2009, 05:38:30 PM
Hello.

I'm trying to setup zabbix agent on a sme server.

I need to change the "server=" entry in the etc/zabbix-agent-conf. But when I update the sme server, the changes are lost. How do I change the template?

I could not find the information on the wiki or the forums.

Tnx in advance
Title: Re: Zabbix template
Post by: Stefano on November 23, 2009, 06:37:31 PM
wjp79, welcome here

But when I update the sme server, the changes are lost. How do I change the template?
I could not find the information on the wiki or the forums.

I suggest you to read the developers' manual (link is above), you'll find there everything you need.
ciao
Title: Re: Zabbix template
Post by: cactus on November 23, 2009, 09:06:41 PM
I suggest you to read the developers' manual (link is above), you'll find there everything you need.
Or you can at least point them to the topics they are looking for as it can be a large and daunting document.... so here we go, you can find all relative details in the SME Server Developers Guide referenced earlier looking for the configuration database and the templating system.

In brief: SME Server is making use of an internal configuration database and a templating engine to generate configuration files. The templates are small fragments that can be overwritten by so called custom templates. The original templates should not be modified as they are updated automatically on updates and upgrades, they are what make up the configuration files and the reason why your changes directly to the configuration files are lost.

The nice thing about the template system is you can create overwrites, called custom templates, that stick over updates and upgrades. Most off the times this is not even needed as most of the times a simple change to a property of the internal configuration database in combination of a regeneration of the configuration file and when needed a restart of affected services might be enough.

Since I am unfamiliar with the Zabbix contrib I am not sure if you can achieve your task by modifying a database entry so you might not even need the custom template fragment.

In case you really can not do it with a database setting you can create a custom template. To do so you have to mirror the folder tree below /etc/e-smith/templates for the relevant template fragment in the /etc/e-smith/templates-custom tree.
After that you copy the template fragment you need to modify to the mirrored tree and make your modifications there.

After you have made your modification you will need to regenerate the configuration file and restart affected services, most off the times this can be done by one of the events the server-manager is using when making configuration changes. Which event to run is not always clear as for different part of the server different events apply.
To expand you can always do something like this:
Code: [Select]
expand-template /path/to/expanded/configuration/file
For questions we welcome you back here, for practical examples you can search the forums on the keywords "custom template" as I think you will find some examples written towards practical examples some users had. I remember I have given a few in the past at least.