Ad Widget

Collapse

Trigger for IfOperStatus

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • JayJay
    Junior Member
    • Sep 2011
    • 8

    #1

    Trigger for IfOperStatus

    Hi,

    I am hoping someone can help me create a trigger for IfOperStatus on a switch.

    I want an email to send out if a port changes from "1 (UP)" to "2 (Down). Then a recovery message once it changes back to "1 (UP").

    This way I will be able to monitor if a port is unplugged and send out a notification saying "Port X has been disconnect" and a recovery message of "Port X has been reconnected"

    I also want the trigger (or possibly a separate trigger) to activate if a port changes from "2 (Down)" to "1 (UP)".

    I cannot seem to find the right expression(s) on the trigger to achieve this.

    I am running Zabbix 2.0.0RC2.

    Any help would be much appreciated.
  • netmon
    Member
    • Feb 2012
    • 30

    #2
    Hi,

    I use the following expression to monitor if the IfOperStatus is different from IfAdminStatus.
    I use this for linux devices, therefore you would need to modify it for your purposes.

    {NetworkDevice:ifDescr.["{#SNMPINDEX}"].strlen(0)}<0|
    ({NetworkDevice:ifOperStatus.["{#SNMPINDEX}"].sum(#10)}#{NetworkDevice:ifAdminStatus.["{#SNMPINDEX}"].sum(#10)})
    My trigger name looks like this:
    Inteface ({ITEM.VALUE1}) Status changed on {HOSTNAME}

    {ITEM.VALUE1} is the Value of expression NetworkDevice:ifDescr.["{#SNMPINDEX}"].strlen(0)}<0 which allows me to get the name of the affected interface.

    The OIDs you are monitoring should be of type INTEGER, therefore you can just use numeric operators.
    See: http://www.zabbix.com/documentation/...ers/expression
    And: http://www.zabbix.com/documentation/...gers/functions

    Comment

    • JayJay
      Junior Member
      • Sep 2011
      • 8

      #3
      Hi Netmon,

      Thank you very much for your quick response (and apologies for my lack of).

      You gave me an idea with the comparison. I am think of using the following trigger to tell if something has been plugged into a port on a switch

      {Template_Switch_Monitoring:ifOperStatus.1.last(#1 )}=1&{Template_Switch_Monitoring:ifOperStatus.1.la st(#2)}=2

      Then the opposite if something has been unplugged.

      {Template_Switch_Monitoring:ifOperStatus.1.last(#1 )}=2&{Template_Switch_Monitoring:ifOperStatus.1.la st(#2)}=1

      I can then have a trigger for each of the above events.
      I now just need to test this on an SNMP low level discovery.

      Jay
      Last edited by JayJay; 03-05-2012, 18:13.

      Comment

      • netmon
        Member
        • Feb 2012
        • 30

        #4
        Hi Jay,

        On LLD that should also work.

        Checkout github.com/simonkowallik/Zabbix-Addons if you should miss some discovery functionality within zabbix LLD. But if you use Cisco, you probably will be fine with Zabbix LLD. :-)

        Comment

        Working...