Raju,
Try something like this:
#####
Win32::Service::GetStatus ( $s_server, $servicename, \%status );
if ( $status{"CurrentState"} == 4 ) {
print "$s_server \tis running $servicename";
} elsif ( $status{"CurrentState"} == 1 ) {
print "$s_server \tis not running $servicename";
} else {
print "$s_server \t does not have $servicename installed";
}
#####
Of course there is a way to print out the entire hash and see
all the elements that have been set, but I only needed the one.
Michael Jones / Cincinnati, Ohio, US
--- Veeraraju_Mareddi <[EMAIL PROTECTED]> wrote:
> Dear Team
>
> I am trying to check a service on a remote machine using
> Win32::Service. But
> it is telling "No such file or directorySuccess".
>
> The script is given below Please look in to it..
>
> Service.pl
> use Win32::Service;
>
> if (Win32::Service::GetStatus("hotnt006", "Server", \%status)
> ==0)
> { print "Failed :$!";
> }
> print "Success";
>
> foreach $key( %status)
> {
> print "$key is $status{$key} \n";
>
> }
>
>
> Thanx And Regards
> Raju
> _______________________________________________
> Perl-Win32-Admin mailing list
> [EMAIL PROTECTED]
>
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin
__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
http://im.yahoo.com
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]