in reply to Re^3: how to print out windows service status
in thread how to print out windows service status
, it is not working. I also tried to use this to map the number I defined for each status, it is still not working.Win32::Service::GetStatus($hostname, $servicename, \%status); print MYFILE " ServiceStatus: ", $hostname, $servicename, $status{Curr +entState}, "\n";
4 is map to 'Started' I have service is Started, but all my statements 'is not running'.if ($status{CurrentState} eq 4 ) {print MYFILE " ServiceStatus: ", $hostname, " ", $servicename, + " ", "is running\n";} else {print MYFILE " ServiceStatus: ", $hostname, " ", $service +name, " ", "is not running\n";}
|
|---|