CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
WMI - trying to skip an unresponsive host.

 



grupy
Novice

Feb 5, 2004, 1:07 AM

Post #1 of 1 (660 views)
WMI - trying to skip an unresponsive host. Can't Post

Hi All,

I wrote a small script that retreives information from diffrent hosts in my domain. Everything works fine, except (there's always an exception like that...) when the host is not connected or down.

Since I'm using WMI, I fail on this line:

my $WMIServices = Win32::OLE->GetObject( "winmgmts:{impersonationLevel=impersonate,(security)}//$host/" )
|| die "error connecting to machine $host. It maybe switched off.";



The problem is when I try to getObject on hosts which are non-exisiting/ not connected to network/ down, The program fail (I think it doesn't die - I don'e get "error connecting to machine $host. It maybe switched off."). - Even if it did, I want to know where it failed and skip to my next host in line. Anyone knows how to do such a thing?



10x! - Grupy.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives