Telnet After login Commands + variables

Telnet After login Commands + variables

avatar

Hello,

I'm currently on RDP version 7.5.
I'm trying "After login Commands" on a Telnet session.

The goal is to send a command with the host ip adresse. For exemple : "copy running-config tftp $COMPUTER_IP$ Backup.cfg"



The first command is ok, but the second one does not replace $COMPUTER IP$ by my ip address on the telnet session.

is there any solution ?

Thanks !
edited by Goher on 8/10/2012

All Comments (11)

avatar

Hi,
Have you tried $SESSION_HOST$ instead?

David Hervieux

avatar

Hi,

I've just tried but it don't works. :/

avatar

What happen exactly? Does the variable is replaced by something else?

David Hervieux

avatar

The application send "$COMPUTER_IP$" or "$SESSION_HOST$". The variable is not replaced.

Here a screen capture for "$SESSION_HOST$" :


And for "$COMPUTER_IP$"

edited by Goher on 8/17/2012

avatar

Could you export me the the session to an RDM file and I will test that? You can change the host name and the password

David Hervieux

avatar

Here is the export RDM of the session :

<?xml version="1.0"?>
<ArrayOfConnection>
<Connection>
<ConnectionType>Putty</ConnectionType>
<Events />
<Group>Lan</Group>
<ID>e344efbc-5c04-4951-afcd-0136127bc8e4</ID>
<MetaInformation />
<Name>BKP_LU-C1-BKB-SWI-01</Name>
<Putty>
<Host>181.1.10.11</Host>
<LoginName>administrator</LoginName>
<Port>23</Port>
<PortFowardingArray />
<ProtocolType>Telnet</ProtocolType>
<Scripting>
<string>write mem</string>
<string>copy running-config tftp $SESSION_HOST$ backup.cfg</string>
</Scripting>
<SessionName>Default Settings</SessionName>
<TelnetEncoding>IBM437</TelnetEncoding>
<UseSession>false</UseSession>
</Putty>
<Stamp>29abda97-8cc4-4560-8b31-a39b80cfbd43</Stamp>
</Connection>
</ArrayOfConnection>

BKP_LU-C1-BKB-SWI-01.rdm

avatar

Hi,
It's my fault, the variable is $HOST$

David Hervieux

avatar

Hi,

$HOST$ is working but he gives me the remote device IP.But I need the IP adress of the computer who "Open Session".

Let me explain with an exemple :



In this example, the command that I want to send must be :

copy running-config tftp 181.1.10.150 backup.cfg

Because the TFTP server is on my Computer.

So if I use the command "$HOST$" the result will be:

copy running-config tftp 181.1.10.11 backup.cfg

avatar

You can save the IP in a custom field and use the variable. I know it's not perfect if your IP changes. I will have to add a variable to get the current ip. RDM is able to read the environment variables but I don't think it exists.

David Hervieux

avatar

ok, i have already looked on that direction.

Do you think it's possible to ask this feature on a future release ?

(i mean add a new variable corresponding to the computer IP adress)

I think that can useful to have this variable for scripting or something else.

Especially if we use dynamic addressing ;)

avatar

Of course it's a good idea. Let me know if you see other variables

David Hervieux