Sorry to bump my own thread, but I still haven't gotten to the bottom of
this problem. Maybe this would be more appropriate for net-snmp-coders?
Originally I thought it was just for internal dev discussion, but I see
some API questions there.
On 3/1/12 3:57 PM, Steve McCoy wrote:
> Hello,
>
> I've run into a strange problem where a huge number of messages from
> snmplib are managing to fill up a 60GB hard drive within about three
> hours. The messages are all "Use snmp_sess_select_info2() for processing
> large file descriptors", sometimes repeated over a hundred times per
> line. I'm still working with the customer to figure out how to reproduce
> this, but I thought I'd ask here in case it was an old issue or, at
> least, seen by somebody else in some fashion.
>
> Here's the basic system info: 8.1-RELEASE-p2 FreeBSD i386. The NET-SNMP
> version is 5.5.
>
> Below is a simplified snippet of the key parts of my code. The code
> first makes a list of tasks with initialized, but not open, sessions.
> Elsewhere, each task, up to a small limit (64 in this case), is forked
> and the children open the SNMP session sockets with snmp_open(), and so
> on. I've scoured each of set(), get(), and getnext(), and am sure that
> they all call snmp_close() appropriately — there aren't any early
> returns or other jumps over those calls — so I don't think that I'm
> explicitly leaking any sockets, but descriptors must be hanging around
> for some reason. Does this ring any bells for anybody?
>
> for(…){
> …
> snmp_sess_init(&task->sess_info);
> addtask(taskList, task);
> …
> }
>
> …
>
> for(task = taskList; task&& nkids< maxkids; task = task->next){
> if(fork() == 0){
> set(task);
> get(task);
> getnext(task);
> …
> }
> nkids++;
> }
>
> void set(Task *task){
> …
> sess = snmp_open(&task->sess_info);
> …
> pdu = snmp_pdu_create(SNMP_MSG_SET);
> …
> status = snmp_synch_response(sess, pdu,&resp);
> // check return, retr
> snmp_close(sess);
> }
>
> void get(Task *task){
> …
> sess = snmp_open(sess_info);
> …
> pdu = snmp_pdu_create(SNMP_MSG_GET);
> …
> status = snmp_synch_response(sess, pdu,&resp);
> // check return, read variables
> snmp_close(sess);
> }
>
> void getnext(Task *task){
> …
> sess = snmp_open(sess_info);
> for(obj = task->objs; obj; obj = obj->next){
> …
> pdu = snmp_pdu_create(SNMP_MSG_GET);
> …
> status = snmp_synch_response(sess, pdu,&resp);
> // check return, read variables
> }
> snmp_close(sess);
> }
>
>
> ------------------------------------------------------------------------------
> Virtualization& Cloud Management Using Capacity Planning
> Cloud computing makes use of virtualization - but cloud computing
> also focuses on allowing computing to be delivered as a service.
> http://www.accelacomm.com/jaw/sfnl/114/51521223/
> _______________________________________________
> Net-snmp-users mailing list
> [email protected]
> Please see the following page to unsubscribe or change other options:
> https://lists.sourceforge.net/lists/listinfo/net-snmp-users
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users