Отображение SNMP Traps о Loop Detect в Zabbix

В этой статье я приведу пример отображения SNMP Traps о Loop Detect в Zabbix.

Настроим SNMP Traps например как я описывал в статье:
Настройка Zabbix SNMP Traps

Потом необходимо указать нужные OID в файле /etc/snmp/snmptt.conf, например для D-Link DES-3200 я указал:

# LoopDetected (ixnfo.com tested on des3200 c1 v4.48)
EVENT LoopDetected .1.3.6.1.4.1.171.11.113.1.3.2.20.0.3 "Status Events" Normal
FORMAT ZBXTRAP $aA Loop Detected Port:$1
# LoopDetected (ixnfo.com tested on des3200 a1 v1.83)
EVENT LoopDetected .1.3.6.1.4.1.171.11.113.1.5.2.20.0.3 "Status Events" Normal
FORMAT ZBXTRAP $aA Loop Detected Port:$1

Если вы не знаете какие SNMP OID шлют ваши коммутаторы при LoopDetected, то можно попросить у производителя архивы с MIB и OID либо настроить SNMP Trap на коммутаторе, потом сделать петлю и нужные OID отобразится в файле /var/log/snmptt/snmpttunknown.log

Покажу еще несколько OID которые я определил когда D-Link коммутаторы их присылали:

# swDoSAttackDetected
EVENT swDoSAttackDetected .1.3.6.1.4.1.171.12.59.4.0.1 "Status Events" Normal
FORMAT swDoSAttackDetected $1 IP:$2 PORT:$3

# System change operation mode from normal to exhausted
EVENT swSafeGuardChgToExhausted .1.3.6.1.4.1.171.12.19.4.1.0.1 "Status Events" Normal
FORMAT SafeGuard Exhausted (swSafeGuardChgToExhausted) 1-$1
# System change operation mode from exhausted to normal
EVENT swSafeGuardChgToNormal .1.3.6.1.4.1.171.12.19.4.1.0.2 "Status Events" Normal
FORMAT SafeGuard Normal (swSafeGuardChgToNormal) 1-$1
# The process of upgrading the firmware via SNMP has finished
EVENT agentFirmwareUpgrade .1.3.6.1.4.1.171.12.1.7.2.0.7 "Status Events" Normal
FORMAT Upgrading the firmware via SNMP has finished. Version:$1
# Illegal DHCP server is detected
EVENT swFilterDetectedTrap .1.3.6.1.4.1.171.12.37.100.0.1 "Status Events" Normal
FORMAT Illegal DHCP server IP address detected IP:$1 PORT:$2(swFilterDetectedTrap)
# The configuration is completely saved, uploaded or downloaded
EVENT agentCfgOperCompleteTrap .1.3.6.1.4.1.171.12.1.7.2.0.9 "Status Events" Normal
FORMAT CFG Saved. User: $3 (agentCfgOperCompleteTrap) 1-$1 2-$2
#
EVENT swUnitTPChange .1.3.6.1.4.1.171.12.11.2.2.1.0.4 "Status Events" Normal
FORMAT Stacking topology is Chain. Master ($1 $2 MAC: $3) (swUnitTPChange)
...

Приведу пример настройки SNMP Traps на D-Link DES-3200 (A1/B1/C1):

enable snmp
enable snmp traps
create snmp community IXNFO view CommunityView read_only
create snmp host 192.168.2.2 v2c IXNFO
# включим нужные traps
config loopdetect trap loop_detected
config temperature trap state enable
# отключим ненужные traps
config snmp coldstart_traps disable
config snmp warmstart_traps disable
disable snmp authenticate_traps
disable snmp linkchange_traps
config bpdu_protection trap none
config traffic trap none
config dos_prevention trap disable
config filter dhcp_server trap disable

Пример настройки SNMP Traps на ZyXEL MES-3528:

snmp-server trap-community IXNFO
snmp-server trap-destination 192.168.2.2
snmp-server trap-destination 192.168.2.2 enable traps system loopguard

Пример настройки SNMP Traps на Huawei Quidway S2326:

snmp-agent
snmp-agent community read cipher IXNFO
snmp-agent target-host trap address udp-domain 192.168.2.2 params securityname cipher IXNFO v2c
snmp-agent trap enable
snmp-agent trap enable feature-name securitytrap
snmp-agent trap enable feature-name dhcp_trap
snmp-agent trap enable feature-name error-down trap-name hwerrordown
snmp-agent trap enable feature-name ldt trap-name hwldtportloop

display snmp-agent trap all
display current-configuration

Пример Zabbix триггера:

{ixnfo_com_template:snmptrap[".1.3.6.1.4.1.171.11.113.1.3.2.20.0.3"].nodata(1h)}=0

Также можно настроить syslog и смотреть логи всех коммутаторов на сервере.

Смотрите также мои статьи:
Примеры триггеров для Zabbix
Другие мои статьи про Zabbix
Установка Rsyslog + Loganalyzer + MySQL

Оставьте комментарий

Добавить комментарий