in reply to Re: simple timeout
in thread simple timeout
It's hard to provide more detail than I already have...
The program I'm struggling in is rather big, here it is again but with the WMI server probing line included and sql queries changed for @array values to simplify.
The script goes to each server in turn, tries to initiate a WMI connection and fails on one server at the my $object line, due to some issue with the server. Instead of timing out the script just hangs there... forever. Hence the need for a script to somehow prevent this happening.use strict; use Win32::OLE qw (in); my @servers=('servera','serverb','serverc'); foreach(@servers) { my $server=$_; $server=~s/^\s+|\s+$//g; my $namespace="\\root\\cimv2"; my $object=Win32::OLE->GetObject( "winmgmts:{impersonationLevel=impe +rsonate,(security)}//".$server.$namespace );} or die "could not get o +bject"; # NOW GET DRIVE INFO THROUGH WMI }
I am not asking for a solution including alarm, I've already explored using alarm to some depth, however I'm very willing to explore it further when suggestions pop up, i.e. the Time::HiRes one. I did try Win32::Process with the idea that the child could signal its parent after a set amount of time (as a substitue to alarm) but I couldn;t get the parent to seccussfully recieve a signal from it's child process.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: simple timeout
by BrowserUk (Patriarch) on Nov 08, 2004 at 18:56 UTC | |
|
Re^3: simple timeout
by dwilson@d7net (Initiate) on Nov 08, 2004 at 17:59 UTC |