I am running Zabbix 5.4.4 and receiving a Zabbix trap and would like to add some info from the trap data to a tag on the trigger.
The trigger fires off fine but the regex that looks for the string in the item data does not work. It keeps giving me back the complete item data in full in the tag
Here is a link to the data and a working regex https://regex101.com/r/dCpLnq/1
In the trigger tag I have put
Name = XXXXX
Value = {{ITEM.VALUE}.iregsub("35043.1.1.1201.5.1.2.0 type=4 value=STRING: (\n*.*)"gm, \1)}
I have tried a bunch of different ways but none work
{{ITEM.VALUE}.iregsub("35043.1.1.1201.5.1.2.0 type=4 value=STRING: (\n*.*)"gm, \1)}
{{ITEM.VALUE}.iregsub(35043.1.1.1201.5.1.2.0 type=4 value=STRING: (\n*.*) , \1)}
{{ITEM.VALUE}.iregsub(35043.1.1.1201.5.1.2.0 type=4 value=STRING: (\n*.*) , \0)}
{{ITEM.VALUE}.iregsub("35043.1.1.1201.5.1.2.0 type=4 value=STRING: (\n*.*)" , "\1")}
{{ITEM.VALUE}.iregsub("35043.1.1.1201.5.1.2.0 type=4 value=STRING: (\n*.*)", \1)}
{ITEM.VALUE}.iregsub(35043.1.1.1201.5.1.2.0 type=4 value=STRING: (\n*.*), \1)
The issue is the Tag value gets set at (the full snmptrap string)
DMS NAME: {13:48:47 2021/08/31 PDU INFO:
requestid 863955185
errorstatus 0
errorindex 0
messageid 0
receivedfrom UDP: [172.16.1.2]:58447->[10.100.0.13]:162
And not
"SOLiD DMS-1200"
Any help would be much appreciated
The trigger fires off fine but the regex that looks for the string in the item data does not work. It keeps giving me back the complete item data in full in the tag
Here is a link to the data and a working regex https://regex101.com/r/dCpLnq/1
In the trigger tag I have put
Name = XXXXX
Value = {{ITEM.VALUE}.iregsub("35043.1.1.1201.5.1.2.0 type=4 value=STRING: (\n*.*)"gm, \1)}
I have tried a bunch of different ways but none work
{{ITEM.VALUE}.iregsub("35043.1.1.1201.5.1.2.0 type=4 value=STRING: (\n*.*)"gm, \1)}
{{ITEM.VALUE}.iregsub(35043.1.1.1201.5.1.2.0 type=4 value=STRING: (\n*.*) , \1)}
{{ITEM.VALUE}.iregsub(35043.1.1.1201.5.1.2.0 type=4 value=STRING: (\n*.*) , \0)}
{{ITEM.VALUE}.iregsub("35043.1.1.1201.5.1.2.0 type=4 value=STRING: (\n*.*)" , "\1")}
{{ITEM.VALUE}.iregsub("35043.1.1.1201.5.1.2.0 type=4 value=STRING: (\n*.*)", \1)}
{ITEM.VALUE}.iregsub(35043.1.1.1201.5.1.2.0 type=4 value=STRING: (\n*.*), \1)
The issue is the Tag value gets set at (the full snmptrap string)
DMS NAME: {13:48:47 2021/08/31 PDU INFO:
requestid 863955185
errorstatus 0
errorindex 0
messageid 0
receivedfrom UDP: [172.16.1.2]:58447->[10.100.0.13]:162
And not
"SOLiD DMS-1200"
Any help would be much appreciated
Comment