Otogi has asked for the wisdom of the Perl Monks concerning the following question:
when I involve more than one thread I only get information back from one thread as if all other sessions were stopped. Here is part of the code involved in addition to the snippet above.my $thr = threads->create(\&test,"host","string","2");
Using fork() has been recommended to me before, I really want to use threads, so any help in getting the required solution will be great! Thank you in advancesub test{ my ($SNMP_TARGET, $SNMP_COMMUNITY,$SNMP_VERSION) = @_; my $SESSION = new SNMP::Session (DestHost =>$SNMP_TARGET, Community =>$SNMP_COMMUNITY, Version => $SNMP_VERSION ); my $VLIST = new SNMP::VarList(['sysDescr',0], #0 ['sysObjectID',0], #1 ['sysUpTime',0], #2 ['sysContact',0], #3 ['sysName',0], #4 ['sysLocation',0], #5 ['sysServices',0]); #6 my @a = $SESSION->get($VLIST); print "$a[0]\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: threads and SNMP Session
by renodino (Curate) on Dec 19, 2005 at 22:56 UTC | |
by Otogi (Beadle) on Dec 19, 2005 at 23:11 UTC | |
by renodino (Curate) on Dec 20, 2005 at 01:02 UTC | |
|
Re: threads and SNMP Session
by zentara (Cardinal) on Dec 19, 2005 at 22:08 UTC | |
by Otogi (Beadle) on Dec 19, 2005 at 22:36 UTC | |
by Anonymous Monk on Dec 19, 2005 at 22:17 UTC | |
|
Re: threads and SNMP Session
by BrowserUk (Patriarch) on Dec 19, 2005 at 23:55 UTC | |
by Otogi (Beadle) on Dec 20, 2005 at 00:00 UTC | |
by BrowserUk (Patriarch) on Dec 20, 2005 at 00:14 UTC | |
|
Re: threads and SNMP Session
by leighsharpe (Monk) on Dec 20, 2005 at 03:11 UTC | |
by Otogi (Beadle) on Dec 20, 2005 at 18:11 UTC | |
by leighsharpe (Monk) on Dec 20, 2005 at 22:26 UTC |