Cisco Nexus: Scheduled Backup

Create Backup-Script on nexus
nexus> enable
nexus# echo "copy running-config tftp://ipaddress-of-tftp-server/$(SWITCHNAME)_$(TIMESTAMP) vrf default" >> scheduledbkp

Maybe you need to use another vrf. This depends on what vrf you configure on your Management-VLAN-Interface

Create Task using Embedded Event Manager (EEM)
nexus> enable
nexus# conf t
nexus(config)# event manager applet scheduled_backup
nexus(config-applet)# event snmp oid 1.3.6.1.4.1.9.9.109.1.1.1.1.6.1 get-type exact entry-op le entry-val 12345 poll-interval 86400
nexus(config-applet)# action 1.0 cli command enable
nexus(config-applet)# action 2.0 run-script bootflash:scheduledbkp
nexus(config-applet)# action 3.0 priority notifications msg auto-backup_completed
nexus(config-applet)# end
nexus# copy running-config startup-config
nexus# exit
Description
  • snmp oid 1.3.6.1.4.1.9.9.109.1.1.1.1.6.1: check CPU-Load
  • entry-val 12345: if CPU-Load is below 12345%
  • poll-interval 86400: run actions every 86400 seconds
Hint

On Windows use Solarwinds TFTP Server as it can run as service
https://www.solarwinds.com/free-tools/free-tftp-server

Leave a Reply

Your email address will not be published. Required fields are marked *