On Mon, 2005-04-18 at 16:10, Mounir Mouawad wrote:
> BRIEFLY, my handler is never invoked unless the request is a GET request. 
> What can I do about it to make it work with SET requests too?

Robert's almost certainly correct - this sounds like an access control
problem.  See the FAQ entry:

    I cannot set any variables in the MIB.


A few other points that spring to mind:

> I am trying to extend the agent and add a new oid .1.3.6.1.2.1.12.1.

Please note that this is part of the standard OID tree, and has
already been assigned (ifExtensions, part of RFC 1229, updated by
RFC 1239).  It's probably obsolete by now, but it's not really
appropriate for general testing.

If you don't have an enterprise OID of your own to play with,
there's a subtree of the Net-SNMP enterprise that has been set
aside for exactly this sort of thing. Try using OIDs under
.1.3.6.1.4.1.8072.9999.9999 (NET-SNMP-MIB::netSnmpPlaypen)


> I am using netsnmp_create_handler_registration ... refers to an oid 
> handler (myIntMIB_handler) i wrote in this .c file. Then I am using 
> netsnmp_register_handler to register it.

If you're using the basic netsnmp_register_handler (rather than one
of the utility handlers built upon it), then you need to be concerned
with checking the incoming OID, updating it for GETNEXT requests,
instance handlign and suchlike.

If you'll be implementing a scalar object, then you'd be much
better off using either 'netsnmp_register_instance' or (better)
'netsnmp_register_scalar' which look after this for you.


    case MODE_SET_ACTION:
        /*
         * update current value 
         */
        myintmib = *(requests->requestvb->val.integer);


If you're making this assignment in the ACTION pass, then you
need to be ready to reverse it in the UNDO pass, and restore
the previous value.   Otherwise your agent will break when it
first encounters a failed assignment.


I realise that these are all later problems, and the immediate
problem is getting the SET handling called in the first place!
But you might as well be aware of them now.

Dave



-------------------------------------------------------
This SF.Net email is sponsored by: New Crystal Reports XI.
Version 11 adds new functionality designed to reduce time involved in
creating, integrating, and deploying reporting solutions. Free runtime info,
new features, or free trial, at: http://www.businessobjects.com/devxi/728
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to