• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • Frits Walraven
  • Himai Minh

executing system command remotely

Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm trying to execute the unix command 'uptime' on a remote production server. This is for an intranet I'm developing. I know I can use:
Runtime runtime = Runtime.getRuntime();
Process process = null;
process = runtime.exec(command);
BufferedReader in = new BufferedReader(new InputStreamReader(process.getInputStream()));
String line = null;
while((line = in.readLine()) != null)
catch(Exception e)
this works fine on the local machine, but how would I get a connection to the production server(hosted on a different machine) and run a system specific command from my WebLogic server thorugh an ejb or servlet?
Is the above method I'm suggesting suitable?
can someone give me some advice on how to do this?
[ May 17, 2002: Message edited by: Rowan Chattaway ]
Listen. That's my theme music. That's how I know I'm a super hero. That, and this tiny ad told me:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic