Re: SSH from NNMi URL Actions (496 Views)
Reply
Occasional Contributor
Scott K MacPherson
Posts: 5
Registered: ‎08-07-2009
Message 1 of 3 (545 Views)
Accepted Solution

SSH from NNMi URL Actions

We have a need to allow our NOC operators to use SSH, not just telnet, to get to many of our devices. I have looked into the customized URL actions, but having a url capable of executing an action local to the client's browser (i.e. calling PuTTY/SSH against the selected node) is proving problematic, as most browsers and Windows settings are meticulous about blocking remote executions from web pages.

Anyone have any suggestions/examples for how they have added SSH options to NNMi's console?
Please use plain text.
Honored Contributor
ITC_Call_a_Smile
Posts: 402
Registered: ‎12-05-2000
Message 2 of 3 (545 Views)

Re: SSH from NNMi URL Actions

Hello Scott,

here the procedure for ssh (example):

1. Create batch file C:\windows\system32\startPuttySshfromUrl.bat with:

@ECHO OFF
set parameter=%1%
set host=%parameter:ssh:=%
set host=%host://=%
set host=%host:/=%
cd "C:\WINDOWS\system32\"
start putty.exe -ssh %host%
REM pause

Place putty.exe in C:\Windows\system32.

2. Add registry entry (file puttySsh.reg):

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\ssh]
@="URL:ssh Protocol"
"URL Protocol"=""

[HKEY_CLASSES_ROOT\ssh\shell]

[HKEY_CLASSES_ROOT\ssh\shell\open]

[HKEY_CLASSES_ROOT\ssh\shell\open\command]
@="\"C:\\WINDOWS\\system32\\startPuttySshfromUrl.bat\" \"%1\""

3. Define Action in NNMi with:

ssh://${hostname}

The registry key must installed on all workstations from which NNMi is accessed. The batch script can be placed on a network share where all NNMi users can call it (this makes it easier as only the reg file must be sent to the users).

HTH

Allessandro

PS: If ssh or telnet are already used you can define other "protocols" like prospero. But you must use one which NNMi url action can use.
Please use plain text.
Regular Advisor
4Adam12
Posts: 160
Registered: ‎06-08-2005
Message 3 of 3 (496 Views)

Re: SSH from NNMi URL Actions

Thankfully putty is open source and someone was kind enough to create an ssh:// (launch via url) enabled version of putty.

http://schipka.com/archives/34

 

This allows you to skip the .bat .js .whatever intermediary script.

 

The issue I'm now having is that after upgrade to 9.1 they have added "browserless:" to the begining of the URL action (browserless:ssh://${hostname}" so that it doesn't leave an empty browser window in the background.Unfortunatly this seems to be breaking it for both telnet and ssh. If I remove "browserless:" it works again but then leaves the empty windows in the background. Anyone got a way to fix that?

Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation