Welcome to Netcordia Connection Sign in | Join | Help
in Search

Interfaces with a media type set to SFP

Last post 05-14-2008 3:00 PM by mgriffin. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 05-14-2008 3:00 PM

    Interfaces with a media type set to SFP

    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    

    ########################################################################

    Filed under: , , ,
Page 1 of 1 (1 items)