Script:
Get rxTotalDrops
Script-Description:
This script looks for rxTotalDrops on individual interfaces within modules
If the rxTotalDrops value is higher than our defined threshold,
the script will throw an issue.
Script-Filter:
$Vendor eq "Cisco"
and $sysDescr like /Catalyst/
# Uncomment the below two lines to have the script run at 4AM nightly
#Script-Devices: All
#Script-Schedule: 0 4 * * *
########################################################################
Action:
Show Modules
Action-Description:
Execute the "show module" command and process the output
looking for "Ethernet" and "Multilayer Switch Feature" modules
Action-Commands:
SET: $matchFound = "no"
SET: $totalDropsThresh = 1000
terminal length 0
show module
Output-Triggers:
Process Modules
########################################################################
Trigger:
Process Modules
Trigger-Description:
Parse through the output
set the following variable values
modNum - the module number
modType - make sure it's an Ethernet or Multilayer Switch Feature module
Trigger-Variables:
$modNumEth int
$modTypeEth /\w+/
Trigger-Template:
[[$modNum]] \d+ \d+ \w+ [[$modType]] .*
Trigger-Commands:{ $modType eq "Ethernet" or $modType eq "Switch" }
show counters $modNum
Output-Triggers:
Process Module Interfaces
########################################################################
Trigger:
Process Module Interfaces
Trigger-Description:
Parse through the output
set the following variable values
portName - I.E. Port 1/1
totalDrops - rxTotalDrops
Trigger-Variables:
$portName /Port .*/
$totalDrops int
Trigger-Template:
[[$portName]]
...
.+ rxTotalDrops .+ [[$totalDrops]]
Trigger-Commands:{ $totalDrops >= $totalDropsThresh }
SET: $matchFound = "yes"
Output-Triggers:
Process RXTotalDrops Exceeded
########################################################################
Issue:
Process RXTotalDrops Exceeded
Issue-ID:
rxTotalDropsExceeded
Issue-Severity:
error
Issue-Description:
If the above matched our criteria, display an error with interface info
Issue-Filter:
$matchFound = "yes"
Issue-Details:
IPAddress $IPAddress
Module $modNum
ModuleType $modType
Port $portName
DroppedPackets $totalDrops
########################################################################