Quantcast
Channel: THWACK: Message List
Viewing all articles
Browse latest Browse all 20396

Re: Re: Re: Variables in Scripts

$
0
0

There is a way around the /t issue by using an NCM macro.

 

I don't have a UCS to test but sending the commands to a switch gives me the following output (I excluded the 'quit' command):

tmsh

save /sys ucs /var/tmp/mydevicesysname.ucs

y

scp /var/tmp/mydevicesysname.ucs scpuser@xxx.xxx.xxx.xxx:/Config-Backups/F5/mydevicesysname.ucs

scppassword

 

Try the following:

 

In NCM Settings - Manage Macros, create a new Macro called UCSPath with a value of /var/tmp/

 

 

Then edit your script to reference the macro.

 

script runUCSScript(

                    NCM.Nodes @ContextNode

    )

{

  string @FileName=@ContextNode.SysName+'.ucs'

  string @UCSFileName='${UCSPath}'+@FileName

  string @SCPPath='scpuser@xxx.xxx.xxx.xxx:/Config-Backups/F5/' + @FileName

 

  CLI

  {

    tmsh

    save /sys ucs @UCSFileName

    y

    quit

    scp @UCSFileName @SCPPath

    scppassword

 

  }

 

}


Viewing all articles
Browse latest Browse all 20396

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>