File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Windows and Unix Services status through java code

 
rohi mat
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.. can anybody help me with creating a program that could give me the status of some services running on Remote Windows and Unix servers..?
Thanks a lot !
 
Rob Spoor
Sheriff
Pie
Posts: 20372
44
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The right way for Windows services is to a) use JNI to query the remote services, or b) use the "sc" command with Runtime.exec / ProcessBuilder. For Unix I don't think there's a uniform way, as I don't think there's a uniform way to do this on local machines themselves. Often you can use the service script in combination with "status" (e.g. /etc/init.d/sshd status) but the "status" argument may not be supported. Either way, you'd also need to connect to the machine using SSH if available.
 
Campbell Ritchie
Sheriff
Pie
Posts: 47253
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And welcome to the Ranch
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic