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.
$ip = "10.0.0.10";
$comm = "blah";
$result = `/usr/local/bin/snmpget -v 1 -c $comm $ip .184.108.40.206.4.1.2021.8.1.101.1 2>/dev/null`;
@temp = split(/=/, $result);
@out = split(/\n/, $temp);
$out =~ s/STRING://g;
$out =~ s/\s+//g;
And the last few lines of the hanging log
[Dev: 0013] Trimming device event log.
[Dev: 0013] Ending device thread.
[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?
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?
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.