Script hanging


26-05-2004 13:43:00

I have written a small script that outputs some information from a snmpget about qmails mailstats from a remote box. HOWEVER, this script and any like it seem to cause netmrg-gatherer to hang.

The Script


$ip = "";
$comm = "blah";

$result = `/usr/local/bin/snmpget -v 1 -c $comm $ip . 2>/dev/null`;

@temp = split(/=/, $result);

@out = split(/\n/, $temp[1]);

$out[0] =~ s/STRING://g;
$out[0] =~ s/\s+//g;

print "$out[0]\n";

And the last few lines of the hanging log
[Dev: 0013] Trimming device event log.
[Dev: 0013] Ending device thread.
Thread Ended.
[PASSIVE] Last: 2, Now: 1

This causes MANY netmrg-gatherers to be open at a given time, like one for everytime the cron runs.

Am I fubaring the code on the script (I used a working script as a template) or is the gatherer not getting something it wants?


26-05-2004 13:53:46

Its wierd I am only using 2 active script tests currently. But NO matter what the 3rd one is that I place in the Device configuration it hangs up.

Am I missing something?


26-05-2004 13:54:05

Double post!


26-05-2004 18:41:28

It seems like the script kills the thread that calls it, causing the main thread to wait forever for the last thread to finish. I'm not sure what would cause that, but we'll look into it.