Script hanging

validan

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

[code12856c500f0]
#!/usr/bin/perl

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


$result = `/usr/local/bin/snmpget -v 1 -c $comm $ip .1.3.6.1.4.1.2021.8.1.101.1 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";
[/code12856c500f0]

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

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?

validan

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?

validan

26-05-2004 13:54:05

Double post!

balleman

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.