Hi,
I would like to create a generic template to monitor a network interface where interface name is a macro.
In Template_generic_if, I define a macro:
{$NETIF} => eth0
and several items:
input = net.if.in[{$NETIF},bytes]
output = net.if.out[{$NETIF},bytes]
and triggers, graphs,...
I can then link it to a host.
If network interface name is different, I can just redefine it at host level with:
{$NETIF} => br0
So far so good.
However, if there are several interfaces in my host, I cannot link it several times to the same template.
I have tried to define a new template Template_if_eth1 linked to Template_generic_if that defines:
{$NETIF} => eth1
I can link my host to either Template_generic_if or Template_if_eth1 but not both.
I get error message:
Am I trying to do something impossible or I am missing something ?
Regards,
Alixen
I would like to create a generic template to monitor a network interface where interface name is a macro.
In Template_generic_if, I define a macro:
{$NETIF} => eth0
and several items:
input = net.if.in[{$NETIF},bytes]
output = net.if.out[{$NETIF},bytes]
and triggers, graphs,...
I can then link it to a host.
If network interface name is different, I can just redefine it at host level with:
{$NETIF} => br0
So far so good.
However, if there are several interfaces in my host, I cannot link it several times to the same template.
I have tried to define a new template Template_if_eth1 linked to Template_generic_if that defines:
{$NETIF} => eth1
I can link my host to either Template_generic_if or Template_if_eth1 but not both.
I get error message:
Template with item key [net.if.in[{$NETIF},bytes]] already linked to the host
Regards,
Alixen

Comment