lists.netmrg.net lists.netmrg.net
NetMRG discussion and support
 
FAQ :: Search :: Memberlist :: Usergroups :: Register
Profile :: Log in to check your private messages :: Log in

Script hanging

 
Post new topic   Reply to topic    lists.netmrg.net Forum Index -> Support
Author Message
validan
Contributor


Joined: 12 May 2004
Posts: 37

PostPosted: Wed May 26, 2004 5:43 pm    Post subject: Script hanging Reply with quote

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:

Code:

#!/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";


And the last few lines of the hanging log:
Code:

[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?
Back to top
validan
Contributor


Joined: 12 May 2004
Posts: 37

PostPosted: Wed May 26, 2004 5:53 pm    Post subject: Reply with quote

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?


Last edited by validan on Wed May 26, 2004 5:55 pm; edited 1 time in total
Back to top
validan
Contributor


Joined: 12 May 2004
Posts: 37

PostPosted: Wed May 26, 2004 5:54 pm    Post subject: Reply with quote

Double post!
Back to top
balleman
Site Admin


Joined: 20 Jan 2003
Posts: 282

PostPosted: Wed May 26, 2004 10:41 pm    Post subject: Reply with quote

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.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    lists.netmrg.net Forum Index -> Support All times are GMT
Page 1 of 1

 



smartBlue Style © 2002 Smartor
Powered by phpBB © 2001, 2002 phpBB Group