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

Change SNMP Location in Cisco IOS

Last post 12-12-2008 11:38 AM by pvogelsang. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 05-16-2008 8:46 AM

    Change SNMP Location in Cisco IOS

     

     Update the SNMP server location on IOS devices whose name does not indicate that it is a console server, pstn gateway, or IPv6 device.  It is likely that you'll want to modify the script to add other location specific information.

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

    Script:
        SNMP location update

    Script-Description:
        Update the SNMP server location on IOS devices whose name
        does not indicate that it is a console server, pstn gateway,
        or IPv6 device.  It is likely that you'll want to modify the
        script to add other location specific information.

    Script-Filter:
        $Vendor eq "Cisco"
        and $sysDescr like /IOS/
        and $Name not like /.*(V|v)6.*/
        and $Name not like /.*(console|Console|pstn).*/

    #########################################################################
    Action:
        Show SNMP Location

    Action-Description:
        This command shows the information contained in the SNMP server
        location field.

    Action-Commands:
        SET:$doit="yes"
        show snmp location

    Output-Triggers:
        Update
        Update SNMP Location LAN
        Update SNMP Location WAN

    #########################################################################
    Trigger:
        Update

    Trigger-Description:
        Make sure LAN or WAN don't already exist.

    Trigger-Variables:
        $snmpLocation    "/(WAN|LAN|wan|lan|INTERNET|internet|Internet)/"

    Trigger-Template:
        [[$snmpLocation]]

    Trigger-Commands:
        SET:$doit="no"

    #########################################################################
    Trigger:
        Update SNMP Location LAN

    Trigger-Description:
        Update the SNMP server location with LAN.

    Trigger-Variables:
        $snmpLocationLAN    "/[\\w ]+/"

    Trigger-Template:
        [[$snmpLocationLAN]]

    Trigger-Filter:
        $doit eq "yes"
        and ($Type eq "Switch-Router"
        or $Type eq "Router")
        and $Name not like /.*-(A|a)$/

    Trigger-Commands:
        config terminal
        snmp-server location $snmpLocationLAN LAN
        end
        write memory

    #########################################################################
    Trigger:
        Update SNMP Location WAN

    Trigger-Description:
        Update the SNMP server location with WAN.

    Trigger-Variables:
        $snmpLocationWAN    "/[\\w ]+/"

    Trigger-Template:
        [[$snmpLocationWAN]]

    Trigger-Filter:
        $doit eq "yes"
        and $Type eq "Router"
        and ($Name like /.*-(A|a)$/

    Trigger-Commands:
        config terminal
        snmp-server location $snmpLocationWAN WAN
        end
        write memory

    #########################################################################
    Patrick Voglesang
    VP Operations, Netcordia, Inc.
    (T) +1 410 266 6161 x309 (M) +1 724 272 1042 (F) +1 410 573 9779
    (E) pvogelsang@netcordia.com www.netcordia.com

    Filed under: , , ,
  • 12-12-2008 11:38 AM In reply to

    Re: Change SNMP Location in Cisco IOS

    Change SNMP Location in Cisco IOS
    Patrick Voglesang
    VP Operations, Netcordia, Inc.
    (T) +1 410 266 6161 x309 (M) +1 724 272 1042 (F) +1 410 573 9779
    (E) pvogelsang@netcordia.com www.netcordia.com

Page 1 of 1 (2 items)