how to use env variable to creat a config file in CAT9k_IOSXE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2022 01:21 AM
Hi there,
I am working on a script to create config output which will be redirected to a remote tftp server. How can I ask the switch to create the config output by using its env variable such as
switch1#show running-config | redirect tftp://......//{{hostname}}.cfg?
Thanks
- Labels:
-
Catalyst 9000
-
LAN Switching
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2022 02:31 AM
what script you using - is this from inside switch or out of the box. then you need store variable of hostname and backup the config using that hostname, since you already know the device you logged in with hostname, so parse that information from script.
or you can use EEM Script to autobackup to TFTP.
https://www.balajibandi.com/?s=EEM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2022 12:43 PM
Thanks BB. EEM is what I will try.
Regards,
