On Tue, 26 Jun 2007 10:09:36 +0300 Juuso wrote:
JA> On Monday 25 June 2007 19:22:45 Juuso Alasuutari wrote:
JA> > Next up in my small monitor app project is to learn how to get snmp data
JA> > from devices at constant intervals. [...]
JA> > init_snmp( "foo" )
JA> >
JA> > while {
JA> >   for each device, do {
JA> >     ss[device] <- snmp_open( session[device] )
JA> >     [...]
JA> >   }
JA> >
JA> >   for each device, do {
JA> >     status = snmp_synch_response ( ss[device], pdu[device], response )
JA> >     [...]
JA> >   }
JA> >
JA> >   for each device, do {
JA> >     snmp_close ( ss[device] )
JA> >   }
JA> >  [...]
JA> > It seems to work OK, but then again when I left it running on a server it
JA> > had quietly exited after maybe 20 minutes. [...]
JA> 
JA> I solved this problem by moving some parts of the code outside the loop. I 
JA> noticed that the client always exited when it had looped exactly 1021 
JA> requests. I don't know where that number is from.

Hmm.. odd.. how many devices did you have? What platform are you on? This
looks suspiciously like a file descriptor limit, but if you have less than
1021 devices and are opening and closing the session each time, it should work.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to