Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^4: how to print out windows service status

by ytjPerl (Scribe)
on Jul 31, 2017 at 15:11 UTC ( [id://1196367]=note: print w/replies, xml ) Need Help??


in reply to Re^3: how to print out windows service status
in thread how to print out windows service status

I checked hash %status, one of its key is 'CurrentState', so I am trying to do this
Win32::Service::GetStatus($hostname, $servicename, \%status); print MYFILE " ServiceStatus: ", $hostname, $servicename, $status{Curr +entState}, "\n";
, it is not working. I also tried to use this to map the number I defined for each status, it is still not working.
if ($status{CurrentState} eq 4 ) {print MYFILE " ServiceStatus: ", $hostname, " ", $servicename, + " ", "is running\n";} else {print MYFILE " ServiceStatus: ", $hostname, " ", $service +name, " ", "is not running\n";}
4 is map to 'Started' I have service is Started, but all my statements 'is not running'.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-25 13:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found