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
#########################################################################