Use %hostname% of the remote host in a script

Advertisement

ALES
Guest

Use %hostname% of the remote host in a script

Hello,

I'm currently working on a script to save the startup configuration on my switch to our local server.

I would like to save my log with this format after the copy:
get startup.cfg "SaveConf_"name of the switch"_%TIMESTAMP#yyyy-mm-dd%"
where "name of the switch" is a variable pickup automatically like %hostname% for example.
%hostname% doesn't work here so is there any preconfigured variable that does this job?
If no, is there a way to create one?

Thanks for your help,
Best regards.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Re: Use %hostname% of the remote host in a script

So how do you provide the hostname to the connection settings? (the open command)
Provide the hostname to the get command the same way.
If you want more specific help, please post your complete script.

Reply with quote

Advertisement

You can post new topics in this forum