У меня есть cisco и сервер мониторинга с icinga (a.k.a. нагиос, трук). Я хочу получать ловушки от cisco и показывать их в icinga. Но я не могу увидеть интерфейс и vlan для errdisable trap.
Я скачал mibs с cisco, включая CISCO-ERR-DISABLE-MIB.my. Затем я преобразовал его для snmptt с помощью этой команды :
snmpttconvertmib --in=CISCO-ERR-DISABLE-MIB.my --out=snmptt.conf --exec='/bin/bash /usr/local/bin/trap/submit_check_result $r '"errdisable 2" -net_snmp_perl --format=4
, которая выдала следующую конфигурацию (Я заменил абсолютный путь к mib на... и значения переменных на...):
#
#
#
#
MIB: CISCO-ERR-DISABLE-MIB (file:/.../CISCO-ERR-DISABLE-MIB.my) converted on Wed Sep 8 16:49:53 2021 using snmpttconvertmib v1.4.2
#
#
#
EVENT cErrDisableInterfaceEvent.1.3.6.1.4.1.9.9.548.0.1.1 "Status Events" Normal
FORMAT cErrDisableInterfaceEvent - cErrDisableIfStatusCause:$1
EXEC /bin/bash /usr/local/bin/trap/submit_check_result $r errdisable 2 "cErrDisableInterfaceEvent - cErrDisableIfStatusCause:$1 "
SDESC
The cErrDisableInterfaceEvent is generated when an interface
or {interface, vlan} is error-disabled by the feature
specified in cErrDisableIfStatusCause.
cErrDisableInterfaceEvent is deprecated and replaced by
cErrDisableInterfaceEventRev1.
Variables:
1: cErrDisableIfStatusCause
Syntax="INTEGER"
1: udld
...
9: portSecurityViolation
Descr="This object specifies the feature/event that caused the
{interface, vlan} (or the entire interface) to be
error-disabled."
EDESC
#
#
#
EVENT cErrDisableInterfaceEventRev1.1.3.6.1.4.1.9.9.548.0.2 "Status Events" Normal
FORMAT cErrDisableInterfaceEventRev1 - cErrDisableIfStatusCause:$1
EXEC /bin/bash /usr/local/bin/trap/submit_check_result $r errdisable 2 "$N - $+1 "
SDESC
The cErrDisableInterfaceEventRev1 is generated when an
interface or {interface, vlan} is error-disabled by the
feature specified in cErrDisableIfStatusCause.
cErrDisableInterfaceEventRev1 deprecates
cErrDisableInterfaceEvent to make it RFC 2578 compliant.
According to section 8.5 of RFC 2578, the next
to last sub-identifier in the name of any newly-defined
notification must have the value zero.
Variables:
1: cErrDisableIfStatusCause
Syntax="INTEGER"
1: udld
...
9: portSecurityViolation
Descr="This object specifies the feature/event that caused the
{interface, vlan} (or the entire interface) to be
error-disabled."
EDESC
Есть две ловушки, меня интересует только в cErrDisableInterfaceEventRev1, но не в устаревшем cErrDisableInterfaceEvent.
Это мой файл send-errdisable.sh, который я использую для создания тестового события errdisable:
TO_HOST=icinga.example.com
community=abcabc
snmptrap -m ALL -v 2c -c $community $TO_HOST '' CISCO-ERR-DISABLE-MIB::cErrDisableInterfaceEventRev1 \
CISCO-ERR-DISABLE-MIB::cErrDisableIfStatusCause.2.0 i 1 \
2>/dev/null
Теперь, когда я генерирую событие errdisable, в выходных данных плагина icinga для службы errdisable я получаю следующий текст :
cErrDisableInterfaceEventRev1 - cErrDisableIfStatusCause:udld
, но Я ожидаю, что интерфейс и vlan будут там, вот так:
cErrDisableInterfaceEventRev1 - cErrDisableIfStatusCause.2.0:udld
Почему это не показано? И как это исправить?