Help for this page

Select Code to Download


  1. or download this
    Win32::Service::GetStatus($hostname, $servicename, \%status);
    print MYFILE " ServiceStatus: ", $hostname, $servicename, $status{Curr
    +entState}, "\n";
    
  2. or download this
     if ($status{CurrentState} eq 4 )
           {print MYFILE " ServiceStatus: ", $hostname, " ", $servicename,
    + " ", "is running\n";}
           else {print MYFILE " ServiceStatus: ", $hostname, " ", $service
    +name, " ", "is not running\n";}