Using a variable as ssh gateway address

Using a variable as ssh gateway address

avatar
thou
Disabled

I have an environment that is built in a Vnet, that has a single ssh host as a ssh gateway. This environment is often torn down, recreated, and every time I need to change the ssh host IP address.

Is it possible to use a variable for this value? I tried using variables set in the containing folder but couldn't get any to work!

Any hints would be appreciated - thanks

All Comments (9)

avatar

If your Folder stays you can use the $COMPUTER_IP$ Variable in your entries.

$COMPUTER_IP$ Variable you define in Settings of your Folder - Information - General - IP

Kind Regards
Markus

======================

avatar

ok, I might be doing something stupid here! I'll explain what I did...

Created a new folder, in the left hand pane, selected information, then under general, I put the IP of my gateway box in the IP field. Leaving everything else blank.

Under that folder, I created a new ssh shell connection, just putting $COMPUTER_IP$ into the host field under general, clicking ok to that, and trying to connect makes RDM crash.

If I instead put the IP of a VM that is inside the vnet, and put $COMPUTER_IP$ into the SSH Gateway (jump host) tab, after selecting the Connect through SSH gateway (jump host) checkbox. When I try to connect it attempts to connect and then closes

avatar

Hello,

I've just tested your scenario and it seems to work fine.

What version of RDM are you using?

Could you please show us some screenshots of the settings of the entries? You can send them to support@devolutions.net if you prefer not to attach them here.

Best regards,

Mark Beausejour

avatar

Apologies for the delay, the weekend :)


So here are some screen shots -













Hopefully, this helps!

avatar

Hello,

The $COMPUTER_IP$ variable refers to the HOST IP address of a computer folder type like the following sample.



Could you please use the $PARENT_INFORMATION_IP$ variable instead to see if this will work?



Best regards,

Érica Poirier

avatar

Erica, that has pointed me in the right direction!

It seems that the secret is to set the computer / hardware folder type, but then to put the address in the information property, not the computer IP




This can then be accessed using $INFORMATION_IP$ as follows -



This connects and works as expected, however, this does not -





The whole logic around using variables does seem very non-intuitive so far. Changing the folder type should not hide the generic information for that folder (i.e. the $INFORMATION_IP$ is only available when the Server type is selected) And there should be some way to see what variables are set at the point of use. So within the variables screen, maybe there could something that gives additional information about what data is ther

avatar

Hello,

To be sure that you use the correct variable according to the folder type, please consult the following online documentation about Variables.

So, the variable of the IP address located in the Information tab of the Server parent folder type will be $COMPUTER_INFORMATION_IP$.



Using the $INFORMATION_IP$ variable refers to the current entry, not the parent folder. This is the reason why it doesn't work with that variable.

Best regards,

Érica Poirier

avatar

Erica,

Just to be clear from the screenshots above, using $INFORMATION_IP$ worked as expected when it was used as the address that is being connected to (General -> Host) putting a valid backend host IP in that place, and using the same variable - without changing anything else - in the SSH Gateway Host box didn't work.

This suggests that $INFORMATION_IP$ is obtaining that information from the containing folder, but the SSH Gateway field isn't resolving it.


I have just tried using the $COMPUTER_INFORMATION_IP$ in both the host and Gateway field. Using it in the Gateway field times out. Using it in the Host field crashes & closes RDM. This is with the IP being defined in the place that you suggest.

avatar

Hello,

Sorry that I didn't explain this situation clearly. I understand that this could be a bit confusing. I have again read the entire thread to be sure that I didn't miss any details.

Do you have an IP address in the Information tab of the SSH entry?
If so, the variable $INFORMATION_IP$ will refer to that value, not the IP saved in the containing folder.




I think it would be preferable to do a remote session to help you with that configuration. Could you please send an email at support@devolutions.net and we will send you our online calendar to schedule an appointment.

Best regards,

Érica Poirier