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

Check Cisco Flash Space

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

    Check Cisco Flash Space

    Check Cisco routers to see if there is space in the Flash memory system to store another IOS version. Edit the variable $need that's in the Action-Commands section below to insert the minimum flash space that's needed. Batch operation on a schedule is best done with this scrip

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

    Script:
        Cisco new model router Flash Space Utilization Check

    Script-Description:
        Check Cisco routers to see if there is space in the Flash memory
        system to store another IOS version.
        Edit the variable $need that's in the Action-Commands section below
        to insert the minimum flash space that's needed.
        Batch operation on a schedule is best done with this script.

        The script CiscoFlashSpaceUserInput accepts user input, which may
        be useful if you run it interactively.

        You may need to modify the list of supported devices in the
        Script-Filter.


    Script-Filter:
        $Vendor eq "Cisco" and $type eq "Router"
        and ($Model like /72../
          or $Model like /26../
          or $Model like /36../
          or $Model like /38../
          or $Model like /28../)

    #########################################################################
    Action:
        Show FileSystem

    Action-Description:
        Get the filesystem space info.

    Action-Commands:
        show file systems
        SET: $need = 6193468

    Output-Triggers:
        Process FlashInfo

    # Typical output:
    # Need to identify the line that starts with '*' as the main filesystem
    # and check the space free on it.
    #vpn1>ena
    #Password:
    #vpn1#sh file systems
    #File Systems:
    #
    #     Size(b)     Free(b)      Type  Flags  Prefixes
    #       30712       27584     nvram     rw   nvram:
    #           -           -    opaque     rw   null:
    #           -           -    opaque     rw   system:
    #           -           -   network     rw   tftp:
    #*   16777216     5125972     flash     rw   flash:
    #           -           -     flash     rw   slot0:
    #           -           -     flash     rw   slot1:
    #           -           -    opaque     wo   lex:
    #           -           -    opaque     ro   xmodem:
    #           -           -    opaque     ro   ymodem:
    #           -           -   network     rw   rcp:
    #           -           -   network     rw   pram:
    #           -           -   network     rw   ftp:
    #
    #
    #########################################################################
    Issue:
        Process FlashInfo

    Issue-ID:
        FileSystemUtilizationHigh

    Issue-Severity:
        Info

    Issue-Description:
    The following devices don't contain at least $need bytes of flash memory to accomodate
    loading a new IOS version along with the current IOS version.

    Issue-Variables:
        $version    string
        $size        /\\d+/
        $free        /\\d+/

    Issue-Template:
    \* [[$size]] [[$free]] .*

    Issue-Filter:
        $free < $need

    Issue-Details:
        Name        $Name
        Host        $IPAddress
        Model        $Model
        IOS        $version
        Size        $size
        Free        $free
        Need        $need    

    #########################################################################
    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: , ,
  • 05-16-2008 8:49 AM In reply to

    Re: Check Cisco Flash Space User Input

     Check Cisco routers to see if there is space in the Flash memory system to store another IOS version.

            This script reads the amount of flash space that's needed from a user input form. Batch operation on a schedule is best done with this script.      The script CiscoFlashSpace uses a fixed variable within the script, which may be useful if you run it in batch mode or on a periodic schedule where you aren't able to enter the value.
             
            You may need to modify the list of supported devices in the Script-Filter.


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

    Script:
        Cisco new model router Flash Space Utilization Check

    Script-Description:
        Check Cisco routers to see if there is space in the Flash memory
        system to store another IOS version.

            This script reads the amount of flash space that's needed from
        a user input form.
            Batch operation on a schedule is best done with this script.       
            The script CiscoFlashSpace uses a fixed variable within the script,
        which may be useful if you run it in batch mode or on a periodic
        schedule where you aren't able to enter the value.
             
            You may need to modify the list of supported devices in the
            Script-Filter.

    Script-Filter:
        $Vendor eq "Cisco" and $type eq "Router"
        and ($Model like /72../
          or $Model like /26../
          or $Model like /36../
          or $Model like /38../
          or $Model like /28../)

    Script-Variables:
        $SpaceNeeded text "Replace this text with the amount of filesystem free space that is needed"

    #########################################################################
    Action:
        Show FileSystem

    Action-Description:
        Get the filesystem space info.

    Action-Commands:
        show file systems

    Output-Triggers:
        Process FlashInfo

    # Typical output:
    # Need to identify the line that starts with '*' as the main filesystem
    # and check the space free on it.
    #vpn1>ena
    #Password:
    #vpn1#sh file systems
    #File Systems:
    #
    #     Size(b)     Free(b)      Type  Flags  Prefixes
    #       30712       27584     nvram     rw   nvram:
    #           -           -    opaque     rw   null:
    #           -           -    opaque     rw   system:
    #           -           -   network     rw   tftp:
    #*   16777216     5125972     flash     rw   flash:
    #           -           -     flash     rw   slot0:
    #           -           -     flash     rw   slot1:
    #           -           -    opaque     wo   lex:
    #           -           -    opaque     ro   xmodem:
    #           -           -    opaque     ro   ymodem:
    #           -           -   network     rw   rcp:
    #           -           -   network     rw   pram:
    #           -           -   network     rw   ftp:
    #
    #
    #########################################################################
    Issue:
        Process FlashInfo

    Issue-ID:
        FileSystemUtilizationHigh

    Issue-Severity:
        Info

    Issue-Description:
    The following devices don't contain at least $need bytes of flash memory to accomodate
    loading a new IOS version along with the current IOS version.

    Issue-Variables:
        $version    string
        $size        /\\d+/
        $free        /\\d+/

    Issue-Template:
    \* [[$size]] [[$free]] .*

    Issue-Filter:
        $free < $SpaceNeeded

    Issue-Details:
        Name        $Name
        Host        $IPAddress
        Model        $Model
        IOS        $version
        Size        $size
        Free        $free
        Need        $SpaceNeeded   

    #########################################################################
    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: , ,
Page 1 of 1 (2 items)