Forum Discussion
- MoshProfessor
A workaround using the !groovy command:
def sout = new StringBuilder();
def serr = new StringBuilder();// Shell command for your OS
def proc = 'cmd.exe /c tracert www.google.com'.execute();proc.consumeProcessOutput(sout, serr);
// Adjust timeout as needed
proc.waitForOrKill(20 * 1000);println "out> $sout err> $serr"
- Joe_WilliamsProfessor
To tag on !traceroute or !tracert would be a nice addition as well.
- Joe_TranAdvisor
Since we're posting !groovy workarounds---here is one I'm using for telnet:
hostname = 'internal.server.local' port = 22 try { s = new Socket(hostname, port) println "Connected to $hostname on port $port" s.close() return(0) } catch (ConnectException ce) { println ce.toString() return(1) } catch (BindException be) { println be.toString() return(4) } catch (NoRouteToHostException re) { println re.toString() return(2) } catch (PortUnreachableException pe) { println pe.toString() return(3) } catch (Exception e) { println e.toString() return(5) }
- Antony_HawkinsEmployeeOn 22/08/2018 at 9:31 PM, Joe Williams said:
To tag on !traceroute or !tracert would be a nice addition as well.
@Joe Williams there is a traceroute ConfigSource, if you have LM Config:
/topic/1508-traceroute-configsources/It's not a debug command (obviously!) but you can lift the groovy out of it and use it via the debug window and the !groovy command as a workaround in the meantime.
- MoshProfessor
I don't see the trace route ConfigSource in my LM Config sources, nor in the 108 repo?
- Antony_HawkinsEmployee
@Mosh it's not a core ConfigSource, just something I threw together on the side. Follow the link above to the thread and you'll find the locator ID which you can use to get the ConfigSource from the Exchange.
- MoshProfessor
@Antony Hawkins Thanks. LOL - I thought that was a screen cap, didn't realise it was a thread
- Antony_HawkinsEmployee
No worries - it's this forum being "clever" with internal links!
Related Content
- 3 months ago