- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
08-31-2018 12:16 PM - edited 09-12-2018 09:29 AM
Script calculates an MD hash of the running configuration and compares
it to the previous MD5 hash, if the hash matches the config has not
changed and no action is taken. If hash is different the script will copy the configuraton
to an FTP server.
Script will trigger based on a crontab entry of "0 0 * * *" and this equals
everyday at midnight.
Requirements:
Three EEM environmental variables must be created in the device CLI
event manager environment ftpserver <ftp ip address>
event manager environment ftpuser <username>
event manager environment ftppass <ftp password>
Forth environment variable is optional. If set the script will set the OIDs in the CISCO-COPY-CONFIG-MIB to do the FTP transfer. If this variable is not set the script will use normal CLI to perform the FTP transfer.
event manager environment community <snmp community>
Note that snmp community must have write permission if using SNMP.
snmp-server community <snmp community> rw
Script can also be executed manually on the CLI exec mode:
event manager run config_backup.tcl

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
I tried running a show command with a double pipe from the CLI, but that didn't work. What I ended up doing was before writing the contents of $result to a file, I added the following:
regsub -all -line "Current configuration(.*)\n" $result "" result
This would remove all lines starting with Current configuration.
How different is this script for a Nexus device? I tried running the script, but it complains about most of the code. Mainly, it seems the namespaces are not valid and because the namespaces aren't valid, commands like cli_open and cli_exec fail. Do you know of the counterparts for these on Nexus?
- « Previous
-
- 1
- 2
- Next »