Hi there,
I've setup a template with a user macro like so:
{$PROCNAME} => zabbix_agentd
In the template I've created a couple of items. One is of type zabbix-agent, having this key:
sw.proc.status.procname[{$PROCNAME}]
This fires a script that is defined as a UserParameter. The script does some work (gathers stats in /proc for a process (zabbix_agentd, in this example)) and sends data back with zabbix_sender.
The rest of the items in the template are set up as type zabbix-trapper, like so:
sw.proc.utime[{$PROCNAME}]
sw.proc.rss[{$PROCNAME}]
Now, the sw.proc.status.procname[{$PROCNAME}] expands to sw.proc.status.procname[zabbix_agentd], according to the server debug log.
As soon as it queries the client, the client sends its data, like so:
- sw.proc.utime[zabbix_agentd] 168
- ...
The server responds with:
info":"Processed 0 Failed 9 ...
I suspect that the macro isn't being expanded here, as I thought it would.
When I change this item to:
sw.proc.utime[{$PROCNAME}]
to this:
sw.proc.utime[zabbix_agentd]
The server responds with:
info":"Processed 1 Failed 8 ...
So, it does work when the key parameter is set to a static value, instead of a user macro.
Is this intentional, or am I hitting a bug?
Edit: I'm using v1.8.4
Cheers,
- hans
I've setup a template with a user macro like so:
{$PROCNAME} => zabbix_agentd
In the template I've created a couple of items. One is of type zabbix-agent, having this key:
sw.proc.status.procname[{$PROCNAME}]
This fires a script that is defined as a UserParameter. The script does some work (gathers stats in /proc for a process (zabbix_agentd, in this example)) and sends data back with zabbix_sender.
The rest of the items in the template are set up as type zabbix-trapper, like so:
sw.proc.utime[{$PROCNAME}]
sw.proc.rss[{$PROCNAME}]
Now, the sw.proc.status.procname[{$PROCNAME}] expands to sw.proc.status.procname[zabbix_agentd], according to the server debug log.
As soon as it queries the client, the client sends its data, like so:
- sw.proc.utime[zabbix_agentd] 168
- ...
The server responds with:
info":"Processed 0 Failed 9 ...
I suspect that the macro isn't being expanded here, as I thought it would.
When I change this item to:
sw.proc.utime[{$PROCNAME}]
to this:
sw.proc.utime[zabbix_agentd]
The server responds with:
info":"Processed 1 Failed 8 ...
So, it does work when the key parameter is set to a static value, instead of a user macro.
Is this intentional, or am I hitting a bug?
Edit: I'm using v1.8.4
Cheers,
- hans
Comment