Showing results for 
Search instead for 
Did you mean: 
Create Post
Level 7

Using variables in custom CLI Script

I am trying to use the Device.CLI.send.commands activity to initiate a TFTP backup from a custom device.

I would like to use the hostname to name the tftp upload file.  Can someone point me to how to do this.

The current script is:

netsave text-config %hostname%-%date%.cfg

but this is not doing the variable substitution. 


Labels (2)
0 Kudos
2 Replies
Level 8

A lot of this depends on how you setup the custom device. You need to check the info logs and determine where it is stopping in the process. If made a custom script for the device you are going to have to turn on the debugging log under File > Enable Capture Mode. This will create a log file in the debug folder that will help you to determine what's going on. Here is a link to the testing process with a custom device. If you still run into issues you are going to have to go into more depth on how you created your custom device.

Let me know if that helped at all. 

I am trying to send a command to tftp a config file to a management server but have the destination filename be something related to the device.

For exqample

netsave text-config %hostname%-%date%.cfg

However this is saving a file with the name "%hostname%.%date%.cfg" on the TFTP server. 

I am looking for the ability to pass the hostname and date as variables to the script so I can run this as a generic script for many devices.  Otherwise I will need to write a custom script for each device. 

0 Kudos