Hello all. I'm trying to setup an aggregate prototype item, which is based on an SNMP prototype item. The SNMP prototype key contains quoted strings and I'm having trouble figuring out how to escape them when reference the key in my aggregate prototype's key. I'm able to setup a single aggregate item by escaping everything in the key, but I do not see a way to do this when setting up the Aggregate item prototype. I'm running 4.4.3 and I listed details below on what I've tried so far.
Here is the key from the original SNMP item prototype:
Here is a key of a discovered SNMP item. Zabbix escapes the quoted strings in the raw SNMP data, then encloses all within set of double quotes.
Here is an aggregate item key (not prototype) that worked for me. I had to add a backslash before every double quote in the brackets, including double quotes that were already escaped.
When creating my Aggregrate prototype item, I first tried using the following key
This results in the following key for discovered Aggregate items.
The discovered items go into a Not supported status. It does not match any item keys because the inner quotes are not escaped and there are no unescaped outer quotes in the brackets.
I then tried enclosing {#SNMPINDEX} in escaped double quotes in my Aggregate prototype item key. I had to escape them because I got syntax errors otherwise.
This results in the following key for discovered Aggregate items.
The discovered items go into a Not supported status. This now has the outer quotes in the brackets but the other quotes are not escaped.
Here is the key from the original SNMP item prototype:
Code:
gtmPoolMbrStatPreferred.a.[{#SNMPINDEX}]
Code:
gtmPoolMbrStatPreferred.a.["\"/Partition/GTMPool\".\"/Partition/GTMServer\".\"/Partition/VirtualServer\""]
Here is an aggregate item key (not prototype) that worked for me. I had to add a backslash before every double quote in the brackets, including double quotes that were already escaped.
Code:
grpsum["GTM Host Group","gtmPoolMbrStatPreferred.a.[\"\\"/Partition/GTMPool\\".\\"/Partition/GTMServer\\".\\"/Partition/VirtualServer\\"\"]",last]
When creating my Aggregrate prototype item, I first tried using the following key
Code:
grpsum["GTM Host Group","gtmPoolMbrStatPreferred.a.[{#SNMPINDEX}]",last]
Code:
grpsum["GTM Host Group","gtmPoolMbrStatPreferred.a.[\"/Partition/GTMPool\".\"/Partition/GTMServer\".\"/Partition/VirtualServer\"]",last]
Code:
gtmPoolMbrStatPreferred.a.["/Partition/GTMPool"."/Partition/GTMServer"."/Partition/VirtualServer"]" in group(s) "GTM Host Group"
I then tried enclosing {#SNMPINDEX} in escaped double quotes in my Aggregate prototype item key. I had to escape them because I got syntax errors otherwise.
Code:
grpsum["GTM Host Group","gtmPoolMbrStatPreferred.a.[\"{#SNMPINDEX}\"]",last]
Code:
grpsum["GTM Host Group","gtmPoolMbrStatPreferred.a.[\"\"/Partition/GTMPool\".\"/Partition/GTMServer\".\"/Partition/VirtualServer\"\"]",last]
Code:
gtmPoolMbrStatPreferred.a.[""/Partition/GTMPool"."/Partition/GTMServer"."/Partition/VirtualServer""]" in group(s) "GTM Host Group"
Comment