Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

programmatic way for SSH

 
Arjun Shastry
Ranch Hand
Posts: 1898
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
We use Putty(SSH) to connect to one intermediate UNIX server.From this server we use Telnet to connect to production UNIX server to see the logs.Is there any better programmatic way to pass these credentials ? Basically checking the logs in browser is better than seeing unformatted logs on black UNIX screen!!
 
Travis Hein
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yea, a simple servlet to do a tail operation on a log file, such that refreshing the page would re-run the tail.
but that would mean deploying a servlet container, or other script engine, on the machine where the logs are, and woud require the URL to this log viewer probably be secure, and assume the machine with the logs is even on the network in a way that http requests on some off beaten path port to view logs on is possible. and another problem if the log file (e.g. apache) is used for the application and this log viewer applet, then requests to view the logs will show up in the logs (what I call the 'fridge light problem').

but basically , in theory a general fie tailer might look like


and this could even be invoked from a JSP page, or a servlet


it would be really cool to extend this into an ajax driven auto refresh mechanism.
 
Arjun Shastry
Ranch Hand
Posts: 1898
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the help.
 
Arjun Shastry
Ranch Hand
Posts: 1898
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any API to pass SSH/Telnet parameters programmatically?So that servlet can connect to production server?
In Putty, i don't see any java api.
 
Travis Hein
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here are a couple projects I know of that might help for this.

for ssh, the "jsch" project
http://sourceforge.net/projects/jsch/

and for telnet the commons-net project
http://commons.apache.org/net/
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic