2 Replies Latest reply on Aug 1, 2016 5:58 PM by stephenrmuir

    Using variables in custom CLI Script

    stephenrmuir

      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 192.168.24.64 %hostname%-%date%.cfg

       

      but this is not doing the variable substitution. 

       

      thanks

        • Re: Using variables in custom CLI Script
          moyerj2a

          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. 

          1 of 1 people found this helpful
            • Re: Using variables in custom CLI Script
              stephenrmuir

              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 192.168.1.1 %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.