I'm trying to create a set of trigger prototypes in a Cisco template to evaluate two port channel pairs based on the Operational Status or the port channels. If one or the other is down it would trigger a high alert. If both are down it would trigger a critical alert. The problem is I'm drawing a complete blank on how to do this. Here is what the template is currently creating when it discovers the interfaces:
Template Macros:
{$SEV_INFO} = ^Server
{$SEV_MOD} = ^Link to
{$SEV_WARN} = (PDU-|WAP-|ATS-|UPS-)
Item Prototypes that I'd like to use:
Name: Operational status of interface $1
Key: ifOperStatus[{#SNMPVALUE}] (value of 1 means its up, 2 means its down)
Trigger Prototypes (that currently exist):
Low Trigger: {Template App SNMPv3 Cisco Interfaces - Access Devices:ifAlias[{#SNMPVALUE}].regexp({$SEV_WARN})}=1 and {Template App SNMPv3 Cisco Interfaces - Access Devices:ifOperStatus[{#SNMPVALUE}].diff(0)}>0
Med Trigger: {Template App SNMPv3 Cisco Interfaces - Access Devices:ifAlias[{#SNMPVALUE}].regexp({$SEV_MOD})}=1 and {Template App SNMPv3 Cisco Interfaces - Access Devices:ifOperStatus[{#SNMPVALUE}].diff(0)}>0
So here are my questions:
Template Macros:
{$SEV_INFO} = ^Server
{$SEV_MOD} = ^Link to
{$SEV_WARN} = (PDU-|WAP-|ATS-|UPS-)
Item Prototypes that I'd like to use:
Name: Operational status of interface $1
Key: ifOperStatus[{#SNMPVALUE}] (value of 1 means its up, 2 means its down)
Trigger Prototypes (that currently exist):
Low Trigger: {Template App SNMPv3 Cisco Interfaces - Access Devices:ifAlias[{#SNMPVALUE}].regexp({$SEV_WARN})}=1 and {Template App SNMPv3 Cisco Interfaces - Access Devices:ifOperStatus[{#SNMPVALUE}].diff(0)}>0
Med Trigger: {Template App SNMPv3 Cisco Interfaces - Access Devices:ifAlias[{#SNMPVALUE}].regexp({$SEV_MOD})}=1 and {Template App SNMPv3 Cisco Interfaces - Access Devices:ifOperStatus[{#SNMPVALUE}].diff(0)}>0
So here are my questions:
- In both of the trigger expressions above they are using a regexp against the macros associated with the template. I guess i'm not fully understanding how those are working. Is it if the regex = the value its a 1? Can someone please explain what is happening there?
- To me it looks like these triggers are evaluating the severity of the "error" for the interface rather than if its just up/down. If that's the case can I just get rid of the first half of the expression and just evaluate if the port is up or down?
- These triggers are using the SNMPVALUE as the macro, but I am only interested in a couple of ports that get discovered (i.e. TenGigabitEthernet5/1 and TenGigabitEthernet6/1). I want to create triggers for the following scenarios:
- TenGigabitEthernet5/1 is up but TenGigabitEthernet6/1 is down (or vise versa)
- TenGigabitEthernet5/1 AND TenGigabitEthernet6/1 are down.