Script:
Detect Interface Match
Script-Description:
This script looks for interfaces with a media type set to SFP.
As long as it's not listed as "Not Connected", it throws an issue.
Script-Filter:
$Vendor eq "Cisco"
and $Type eq "Switch"
and $sysDescr like /IOS/
########################################################################
Action:
Get All Interfaces
Action-Description:
Execute the "show interfaces" command and process the output
using the "Process Interfaces" trigger.
Action-Commands:
SET: $matchFound = "no"
terminal length 0
show interfaces
Output-Triggers:
Process Interfaces
########################################################################
Trigger:
Process Interfaces
Trigger-Description:
Determine if the interface has media SFP connected.
Trigger-Variables:
$ifName /GigabitEthernet.*/
$ifSFPtype string
Trigger-Template:
[[$ifName]] is .+, line protocol is .*
...
Keepalive .*
.*media type is [[$ifSFPtype]]
Trigger-Filter:
$ifSFPtype in ["1000BaseSX SFP","1000BaseLX SFP","1000BaseT SFP"]
Trigger-Commands:{$ifSFPtype ne "Not Present"}
SET: $matchFound = "yes"
Output-Triggers:
Process Match Found
########################################################################
Issue:
Process Match Found
Issue-ID:
matchFoundIssue
Issue-Severity:
Info
Issue-Description:
If the above matched our criteria, display an error with interface info
Issue-Filter:
$matchFound = "yes"
Issue-Details:
Interface $ifname
Media Type $ifSFPtype
########################################################################