I have a template to capture SNMP traps from a server.
It has two items receiving all messages correctly:
For "server is Down" messages
For "server is UP" messages
The trap server receives this kind of message (UP or DOWN):
**The "service" name changes**
I can capture the service name using this macro function:
So, I thought of creating a trigger like this:
Problem:
Recovery:
But Zabbix states that the expression is invalid
Any idea how to capture and distinguish the service name in the trigger expression?
It has two items receiving all messages correctly:
For "server is Down" messages
Code:
snmptrap["\.1729\.104\.0\.4"]
Code:
snmptrap["\.1729\.104\.0\.3"]
The trap server receives this kind of message (UP or DOWN):
Code:
SNMPv2-SMI::enterprises.1729.100.1.10.12.0 type=4 value=STRING: "service:server is DOWN"
I can capture the service name using this macro function:
Code:
{{ITEM.VALUE}.iregsub("\"(.*):server is DOWN\"",\1)}
So, I thought of creating a trigger like this:
Problem:
Code:
find(/System SnmpV2/snmptrap["\.1729\.104\.0\.4"],#1,"regexp","\"{{ITEM.VALUE}.iregsub("\"(.*):serv er is DOWN\"",\1)}:server is DOWN\"")=1
Code:
find(/System SnmpV2/snmptrap["\.1729\.104\.0\.3"],#1,"regexp","\""{{ITEM.VALUE}.iregsub("\"(.*):ser ver is UP\"",\1)}":server is UP\"")=1
Cannot update trigger
Invalid parameter "/1/expression": incorrect expression starting from "find(/System SnmpV2/snmptrap["\.1729\.104\.0\.4"],#1,"regexp",""{{ITEM.VALUE}.iregsub(""(.*):serv er is DOWN"",\1)}:server is DOWN"")=1".
Invalid parameter "/1/expression": incorrect expression starting from "find(/System SnmpV2/snmptrap["\.1729\.104\.0\.4"],#1,"regexp",""{{ITEM.VALUE}.iregsub(""(.*):serv er is DOWN"",\1)}:server is DOWN"")=1".
Comment