• Post Reply Bookmark Topic Watch Topic
  • New Topic

Checking windows service status  RSS feed

 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As you know there are various services running on windows. Is it possible to check if any particular service is up and running on a remote machine?

I tried googling but couldn't find anything.

Anything to get me started in the right direction will be most appreciated.
Thanks.
 
Peter Chase
Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pure Java will not provide any such method. You'll need to use Windows API or run a Windows command as a separate process (ProcessBuilder etc.).

Really, this is not a Java question at all. Might be better in General Computing forum?
 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the service opens a port you could try connecting to that port.
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Rob Prime:
If the service opens a port you could try connecting to that port.


Fortunately for me, it does. I got it working with InetSocketAddress.
Thanks for your tips. I really appreciate it.
 
michael yue
Ranch Hand
Posts: 204
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Just curious. How did you managed to determine and check the different windows services using InetSocketAddress. Did you associate port number to the windows service?

Thanks
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by michael yue:
Hi,

Just curious. How did you managed to determine and check the different windows services using InetSocketAddress. Did you associate port number to the windows service?

Thanks


Actually, my application has a list of all ports which need to be monitored on a particular server. I just pass the port number in the constructor.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!