Zabbix 障害、回復 SNMPトラップ 自動クローズ トリガー設定に関する情報です。テンプレートで設定するケースではなく、個別で設定する場合の参考情報です。
海外のZabbixのフォーラムに情報がありました。
I try to work with SNMP Traps.
So i can receive SNMP Traps but now i want to close a problem if there is a recovery trap but i have no idea how to do thisFor now i did create some items to sort the SNMP Traps for example:
Name: SNMP Trap: Internet Link down
Key: snmptrap["path-monitor-failure"]
Name: SNMP Trap: Internet Link up
Key: snmptrap["path-monitor-recovery"]
Then i did create a trigger:
Name: Palo Alto Firewall Internet Link Down
Problem Expression: {CL04 Template Receive SNMP Trap Palo Alto:snmptrap["path-monitor-failure"].regexp(.*)}=1
Recovery Expression: {CL04 Template Receive SNMP Trap Palo Alto:snmptrap["path-monitor-recovery"].regexp(.*)}=1
But i think i'm on the wrong way!Now my question is, how to auto close a trigger when the recovery snmp trap is received?
Many thanks for your help !
Regards,
KevinFail SNMP Trap
11:06:48 2018/12/07 PDU INFO:
receivedfrom UDP: [10.2.128.9]:35229->[10.2.176.247]:162
errorstatus 0
version 1
requestid 1922816940
errorindex 0
notificationtype TRAP
community public
transactionid 40508
messageid 0
VARBINDS:
DISMAN-EVENT-MIB::sysUpTimeInstance type=67 value=Timeticks: (424163633) 49 days, 2:13:56.33
SNMPv2-MIB::snmpTrapOID.0 type=6 value=OID: SNMPv2-SMI::enterprises.25461.2.1.3.2.0.1551
SNMPv2-SMI::enterprises.25461.2.1.3.1.2 type=4 value=STRING: "2018/12/07 11:06:48"
SNMPv2-SMI::enterprises.25461.2.1.3.1.3 type=4 value=STRING: "010401003313"
SNMPv2-SMI::enterprises.25461.2.1.3.1.4 type=4 value=STRING: "SYSTEM"
SNMPv2-SMI::enterprises.25461.2.1.3.1.5 type=4 value=STRING: "routing"
SNMPv2-SMI::enterprises.25461.2.1.3.1.7 type=4 value=""
SNMPv2-SMI::enterprises.25461.2.1.3.1.8 type=70 value=Counter64: 981535
SNMPv2-SMI::enterprises.25461.2.1.3.1.9 type=4 value=STRING: "0x0"
SNMPv2-SMI::enterprises.25461.2.1.3.1.12 type=4 value=STRING: "C4FWSM03-01"
SNMPv2-SMI::enterprises.25461.2.1.3.1.300 type=4 value=STRING: "path-monitor-failure"
SNMPv2-SMI::enterprises.25461.2.1.3.1.301 type=4 value=STRING: "default"
SNMPv2-SMI::enterprises.25461.2.1.3.1.302 type=4 value=STRING: "general"
SNMPv2-SMI::enterprises.25461.2.1.3.1.303 type=2 value=INTEGER: 5
SNMPv2-SMI::enterprises.25461.2.1.3.1.304 type=4 value=STRING: "Path monitoring failed for static route destination 0.0.0.0/0 with next hop 212.117.121.81. Route removed."
Recovery SNMP Trap11:04:30 2018/12/07 PDU INFO:
notificationtype TRAP
errorindex 0
requestid 1922816939
version 1
receivedfrom UDP: [10.2.128.9]:48859->[10.2.176.247]:162
errorstatus 0
messageid 0
community public
transactionid 40484
VARBINDS:
DISMAN-EVENT-MIB::sysUpTimeInstance type=67 value=Timeticks: (424149843) 49 days, 2:11:38.43
SNMPv2-MIB::snmpTrapOID.0 type=6 value=OID: SNMPv2-SMI::enterprises.25461.2.1.3.2.0.1552
SNMPv2-SMI::enterprises.25461.2.1.3.1.2 type=4 value=STRING: "2018/12/07 11:04:30"
SNMPv2-SMI::enterprises.25461.2.1.3.1.3 type=4 value=STRING: "010401003313"
SNMPv2-SMI::enterprises.25461.2.1.3.1.4 type=4 value=STRING: "SYSTEM"
SNMPv2-SMI::enterprises.25461.2.1.3.1.5 type=4 value=STRING: "routing"
SNMPv2-SMI::enterprises.25461.2.1.3.1.7 type=4 value=""
SNMPv2-SMI::enterprises.25461.2.1.3.1.8 type=70 value=Counter64: 981528
SNMPv2-SMI::enterprises.25461.2.1.3.1.9 type=4 value=STRING: "0x0"
SNMPv2-SMI::enterprises.25461.2.1.3.1.12 type=4 value=STRING: "C4FWSM03-01"
SNMPv2-SMI::enterprises.25461.2.1.3.1.300 type=4 value=STRING: "path-monitor-recovery"
SNMPv2-SMI::enterprises.25461.2.1.3.1.301 type=4 value=STRING: "default"
SNMPv2-SMI::enterprises.25461.2.1.3.1.302 type=4 value=STRING: "general"
SNMPv2-SMI::enterprises.25461.2.1.3.1.303 type=2 value=INTEGER: 5
SNMPv2-SMI::enterprises.25461.2.1.3.1.304 type=4 value=STRING: "Path monitoring for static route destination 0.0.0.0/0 with next hop 212.117.121.81 recovered. Route restored."
ご返信ありがとうございます!
さて、両方のイベント(失敗と回復)をキャッチするアイテムを作成しました。
snmptrap[("path-monitor-failure")|("path-monitor-recovery")]
そしてトリガー問題式:
{CL04 Template Receive SNMP Trap Palo Alto:snmptrap[("path-monitor-failure")|("path-monitor-recovery")].regexp(""path-monitor-failure"")}=1
回復式:
{CL04 Template Receive SNMP Trap Palo Alto:snmptrap[("path-monitor-failure")|("path-monitor-recovery")].regexp(""path-monitor-recovery"")}=1
リンクが 4 つあるため、照合用のタグです...タグ: NextHop 値: {{ITEM.VALUE}.regsub("(ネクストホップあり)(.*)*1", " \2")}
これはすべて完璧に機能するようになりました。
ただし
、トリガーの名前には、タグの regsub も使用します: Internet Link {{ITEM.VALUE}.regsub("(with next hop)(.*)*2", "\2")} Down名前にタグ値を使用する解決策があることをご存知ですか?
また、値をIPアドレスから人間が読める名前に変更する方法はありますか? 1.1.1.1 = "inet Access Main" のように、項目内で IP を読み取り可能な名前に置き換えようとしましたが、SNMP トラップ全体がこの値に置き換えられました。
「引用元」
https://www.zabbix.com/forum/zabbix-help/370385-auto-close-snmp-trigger
太字にした部分が動作しました。Zabbix 障害、回復 SNMPトラップ 自動クローズ トリガー設定を参賀している方に参考になると思います。