Hi,
i need some help with regex en regsub within zabbix. I'd like to take multiple strings (from multiple varbinds) and use them in a single trigger name.
So total trigger name:
"AP Connection Lost: Tielt-Jeugd 03 - Jeugd3 1eV grote zaal - 172.24.102.151"
i have the following SNMP trap:
I'd like to get info from multiple lines into a trigger but i'm struggling to make it work. I'm very new to regex and i've tried some online testers with no luck.
The values of 25.0, 26.0 and 29.0 should be in the trigger so that we have an idea of wich access point is lost. All i can come up with is the entire textblock in the triggername, wich offcourse is not very nice on the eye
.
It doesn't help that i cannot test the syntax within zabbix. The tools i tried online dont work for me (regex101 and regextester.com), not even with other regex that we allready use in zabbix that work.
I have this trigger name at the moment "AP Connection Lost (Test trap Ruckus) - {{ITEM.VALUE}.regsub("iso.3.6.1.4.1.25053.2.10.2.2 5.0 type=4 value=STRING:"\s \1)}" but that just displays the entire trap block as displayed above.
Any help is greatly appreciated.
i need some help with regex en regsub within zabbix. I'd like to take multiple strings (from multiple varbinds) and use them in a single trigger name.
So total trigger name:
"AP Connection Lost: Tielt-Jeugd 03 - Jeugd3 1eV grote zaal - 172.24.102.151"
i have the following SNMP trap:
Code:
10:40:31 2023/04/07 PDU INFO: transactionid 45025468 requestid 253388664 receivedfrom UDP: [REDACTED]:40077->[REDACTED]:162 messageid 0 notificationtype TRAP errorstatus 0 community xxxxxxxxxxxxxxx errorindex 0 version 1 VARBINDS: iso.3.6.1.2.1.1.3.0 type=67 value=Timeticks: (145642000) 16 days, 20:33:40.00 iso.3.6.1.6.3.1.1.4.1.0 type=6 value=OID: iso.3.6.1.4.1.25053.2.10.1.23 iso.3.6.1.4.1.25053.2.10.2.13.0 type=4 value=STRING: "Major" iso.3.6.1.4.1.25053.2.10.2.14.0 type=4 value=STRING: "apConnectionLost" iso.3.6.1.4.1.25053.2.10.2.25.0 type=4 value=STRING: "Tielt-Jeugd 03" iso.3.6.1.4.1.25053.2.10.2.23.0 type=4 value=STRING: "C8:08:73:07:F4:B0" iso.3.6.1.4.1.25053.2.10.2.26.0 type=4 value=STRING: "172.24.102.151" iso.3.6.1.4.1.25053.2.10.2.27.0 type=4 value="" iso.3.6.1.4.1.25053.2.10.2.29.0 type=4 value=STRING: "Jeugd3 1eV grote zaal" iso.3.6.1.4.1.25053.2.10.2.28.0 type=4 value="" iso.3.6.1.4.1.25053.2.10.2.30.0 type=4 value=STRING: "Tielt-6.1" iso.3.6.1.4.1.25053.2.10.2.10.0 type=4 value=STRING: "303" iso.3.6.1.4.1.25053.2.10.2.35.0 type=4 value=""
The values of 25.0, 26.0 and 29.0 should be in the trigger so that we have an idea of wich access point is lost. All i can come up with is the entire textblock in the triggername, wich offcourse is not very nice on the eye
.It doesn't help that i cannot test the syntax within zabbix. The tools i tried online dont work for me (regex101 and regextester.com), not even with other regex that we allready use in zabbix that work.
I have this trigger name at the moment "AP Connection Lost (Test trap Ruckus) - {{ITEM.VALUE}.regsub("iso.3.6.1.4.1.25053.2.10.2.2 5.0 type=4 value=STRING:"\s \1)}" but that just displays the entire trap block as displayed above.
Any help is greatly appreciated.
Comment