10-17-2014 01:54 PM
Hi all,
Every month I have to issue these commands for backup at my network devices
#show run
#show version
# show diag
now I have around more than 200 network device form routers and switches so I go to automatic backup from cisco by using kron command
I use
# kron policy-list backup
#cli show run | redirect tftp://192.168.10.1/R1-run
#cli show ver | redirect tftp://192.168.10.1/R1-ver
#cli show diag | redirect tftp://192.168.10.1/R1-ver
but every command ''must'' have its own file for output ,can I find any solution to make all outputs of these three commands combined in one file automatically by the router
BR
Mahmoud
Solved! Go to Solution.
10-17-2014 03:13 PM
Well, there's a short answer and a long answer.
The short answer is to use "cli show tech-support | redirect tftp://192.168.10.1/R1-tech-support" instead. The output of this command includes all three of the items you're looking for and quite a bit more.
The long answer is to use an EEM script to combine things before sending.
event manager applet EEM_Status event timer cron cron-entry "* * 1 * *" action 1.0 cli command "enable" action 2.0 cli command "delete /force flash:/status" action 3.0 cli command "show running-config | redirect flash:/status" action 4.0 cli command "show version | append flash:/status" action 5.0 cli command "show diag | append flash:/status" action 6.0 cli command "copy flash:/status tftp://192.168.10.1/R1-status" action 6.0 exit
This script will combine all three commands into a file on the flash called "status" at midnight on the first of each month and then TFTP that file to your server.
10-17-2014 03:13 PM
Well, there's a short answer and a long answer.
The short answer is to use "cli show tech-support | redirect tftp://192.168.10.1/R1-tech-support" instead. The output of this command includes all three of the items you're looking for and quite a bit more.
The long answer is to use an EEM script to combine things before sending.
event manager applet EEM_Status event timer cron cron-entry "* * 1 * *" action 1.0 cli command "enable" action 2.0 cli command "delete /force flash:/status" action 3.0 cli command "show running-config | redirect flash:/status" action 4.0 cli command "show version | append flash:/status" action 5.0 cli command "show diag | append flash:/status" action 6.0 cli command "copy flash:/status tftp://192.168.10.1/R1-status" action 6.0 exit
This script will combine all three commands into a file on the flash called "status" at midnight on the first of each month and then TFTP that file to your server.
10-18-2014 04:09 AM
Thanks Jody for your reply
can I customize the output of this command
#cli show tech-support
10-18-2014 07:27 AM
The "show tech-support" command doesn't have any options, so no. If you want granular control of the output, I would go with the EEM approach.
10-19-2014 05:06 AM
I made these commands and it worked great
event manager applet backup
event timer cron cron-entry "45 13 19 10 *"
action 1.0 cli command "enable"
action 2.0 cli command "delete /force flash:/status"
action 3.0 cli command "show running-config | redirect flash:/status"
action 4.0 cli command "show version | append flash:/status"
action 5.0 cli command "show diag | append flash:/status"
action 6.0 cli command "copy flash:/status tftp:" pattern "Address or name of remote host.*"
action 7.0 cli command "192.168.10.1" pattern "Destination filename.*"
action 8.0 cli command "R1-status"
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