IMC
cancel
Showing results for 
Search instead for 
Did you mean: 

CLI Script with hostname variable

SOLVED
Go to solution
BjKo
Advisor

CLI Script with hostname variable

Hi everyone,

is there a way to run f.e. the following command:

 

copy command-output "sh tech all" tftp 192.168.10.10 tech_all_${hostname}_20180129.txt 

Where ${hostname} is the hostname of the device the script is running on?
I can configure variables per device, but then I could as well just type the script in every device per hand. 

 

The tooltip states I could enter MIB variables, but I can't find a way to use that.

2.Input MIB parameter, according with $(mibName|mibVariable|index).
For example: $(H3C-SYS-MAN-MIB|h3cSysImageSize|65537) or $(H3C-SYS-MAN-MIB|h3cSysImageSize|@(H3C-SYS-MAN-MIB|h3cSysReloadImage|65536)).

Thanks

2 REPLIES
LindsayHill
Honored Contributor
Solution

Re: CLI Script with hostname variable

You could try using the sysName MIB.

Something like this I think: 

$(SNMPv2-MIB|sysName|0)
BjKo
Advisor

Re: CLI Script with hostname variable

Hi,

it works, thanks a lot ^^