View Full Version : 1.8 vs Macros
Hi,
So I'm testing 1.8 and I can not find any good example about simple MACRO. I would like change the name of interface in several hosts. How can I do it?
Best regards,
e.
Creating:
{NEWMACRO} = <value>
Example:
{NET_IFACE} = sit0
In 'Iten' you need use:
net.if.in[${NET_IFACE},bytes]
[]s,
Luciano
So I have to put every macro into for example Template_Linux?
I have one template bind to 20 hosts. Now I should modify Template_Linux and in every item put macros?
Best regards,
e.
Hi,
You need modification only in template_linux ane the new macro to appear all hosts which used template_linux
Still I can't get sth.
I use template_linux in 20 hosts. In two of them I want to change the name of interface. If I put Macro in template_linux I will have to put macro in every of the hosts even if they gonna use ethX?
Best regards,
e.
i'm not sure i got the question just right... but if i did, you would define interface name either as a global macro, or a template macro, then _only_ redefine it for hosts where you want to use different interface name.
there actually are some examples in the manual ;) - http://www.zabbix.com/documentation/1.8/manual/config/macros#global_and_host_level_macros
Hit me or doc.
I've tried to set up a macro on template and host level (Can I do it on the group host?) and every syntax that I've checke fail. I still see in the item {$CUSTOM_LEVEL} rather then a value of it.
What is the right syntax for entering the macro?
Best regards,
e.
tell what and where exactly have you entered, and where do you see that string
In the Template_Linux I've puttted {$NET_IFACE} -> eth0. In the item:
net.if.in[${NET_IFACE},bytes]. I've tried with {$NET_IFACE} the result was still the same. Even if I've put {$NET_IFACE} -> bg1 I still see: "net.if.in[${NET_IFACE},bytes].
Best regards,
e.
correct syntax is {$NAME}.
while it will still show macro in the frontend, it should work perfectly when data is retrieved.
how, it could be argued that it should be also replaced in some locations in the frontend - if so, where would you expect macro to be replaced by the current value ?