03-21-2024 08:20 AM
I have to track and monitor BOOTFLASH for which i need total free flash space for the entire flash memory device as a whole, instead of each partition's free space.
Is there any EEM script for the above ?
Device: Cisco IOS XE Software, Version 17.09.04a
03-21-2024 08:57 AM
Hello @Ansh 1 ,
You can use the command dir boot flash: | include bytes to get the free and total amount of space on the boot flash filesystem.
router#dir bootflash: | include bytes
2885718016 bytes total (329277440 bytes free)
You can include this command in your EEM script which will be dependant on what kind of monitoring and alerting you want from your script.
Hope this helps.
03-21-2024 09:33 AM
Hello,
adding to @liviu.gheorghe suggestions, you can use a script such as the one below, which would run every day at midnight and send an email to you with the output of that command"
event manager environment _email_to your-to-mail@domain.com
event manager environment _email_server your.mail.server
event manager environment _email_from your-from-mail@domain.com
event manager applet send_boot_flash_info
event timer cron name daily cron-entry "0 0 * * *"
action 1.0 cli command "enable"
action 1.1 cli command "dir boot flash: | include bytes"
action 1.2 mail server "$_email_server" to "$_email_to" from "$_email_from" subject "$_event_pub_time: Bootflash Info" body "$_cli_result"
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide