Ad Widget

Collapse

SNMP: Using value in trigger name

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • barbaros
    Member
    • Aug 2010
    • 32

    #1

    SNMP: Using value in trigger name

    Guys, I need some small advice.

    I monitor my network switches in a standard way, using two status values:
    Code:
    ([email protected] ~)# snmpwalk -v 2c -c XXXxxxXXX 192.168.2.254 ifAdminStatus.65
    IF-MIB::ifAdminStatus.65 = INTEGER: up(1)
    
    ([email protected] ~)# snmpwalk -v 2c -c XXXxxxXXX 192.168.2.254 ifOperStatus.65
    IF-MIB::ifOperStatus.65 = INTEGER: up(1)
    I have standard triggers, with interface number in the description:
    Code:
    Link down on interface65 on {HOST.NAME}: {SWITCH-CORE-1.local:ifAdminStatus.65.last(0)}=1 and {SWITCH-CORE-1.local:ifOperStatus.65.last(0)}=2
    The problem is that network admins are complaining that "interface65" tells them nothing. They lives in the world of aliases .

    All of the interfaces have configured descriptions (aliases in this example):
    Code:
    ([email protected] ~)# snmpwalk -v 2c -c XXXxxxXXX 192.168.2.254 ifAlias.65
    IF-MIB::ifAlias.65 = STRING: ### Uplink To FIREWALL-CORE
    So simple question is: is there any way to use one value (ifAlias in this example) in trigger name?
  • BDiE8VNy
    Senior Member
    • Apr 2010
    • 680

    #2
    When I have understood you right, then you could just add the item having the alias value to the trigger expression in a non-affecting way.

    This is an example of mine, just to show the idea (pay attention to bold text):

    Trigger name
    Enabled port {#SNMPVALUE} ({ITEM.VALUE4}) in state: {ITEM.VALUE3}

    Trigger expression (line breaks are not part of the expression)
    {Template Brocade Fabric - Base:snmp.agent[SW-MIB::swFCPortPhyState.{#SNMPINDEX}].last()}>2&
    {Template Brocade Fabric - Base:snmp.agent[SW-MIB::swFCPortLinkState.{#SNMPINDEX}].last()}#2&
    {Template Brocade Fabric - Base:snmp.agent[SW-MIB::swFCPortOpStatus.{#SNMPINDEX}].last()}#1&
    {Template Brocade Fabric - Base:snmp.agent[SW-MIB::swFCPortName.{#SNMPINDEX}].strlen()}>-1


    Trigger description
    Physical state is greater than noTransceiver (2)
    AND Link state is not disabled (2)
    AND Operational status is not online (1)
    AND length of name is greater than -1

    The latter allows to put the name into the trigger description

    Comment

    • chuonglh
      Junior Member
      • May 2015
      • 5

      #3
      Maybe you can try this
      Link down on interface65 on {HOST.NAME}:{ITEM.VALUE1} : {SWITCH-CORE-1.local:ifAlias.65.str(this_does_not_exist)}=0 and {SWITCH-CORE-1.local:ifAdminStatus.65.last(0)}=1 and {SWITCH-CORE-1.local:ifOperStatus.65.last(0)}=2
      You might be interested in http://sysnet-adventures.blogspot.fr...interface.html

      Comment

      • Garry Zverev
        Junior Member
        • Feb 2021
        • 2

        #4
        Thank you for answers.

        Comment

        Working...