Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: determining if a service is alive on a win32 system

by barndoor (Pilgrim)
on Jun 29, 2000 at 21:10 UTC ( [id://20433]=note: print w/replies, xml ) Need Help??


in reply to determining if a service is alive on a win32 system

Below is an example of it's use and how to interpret the results:
use Win32::Service; my %statusHash; Win32::Service::GetStatus("", "EventLog", \%statusHash); print $statusHash{"CurrentState"} . "\n"; # CurrentState can be: # 1 = stopped. # 2 = start pending. # 3 = stop pending. # 4 = running. # 5 = continue pending. # 6 = pause pending. # 7 = paused.
No error check done, Sorry. As you can see GetStatus uses a hash reference to return the results. This contains other stuff like 'Service Type' and other wierd bits. I tried this code on NT4 SP3 and it works fine.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://20433]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (2)
As of 2024-04-19 20:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found