Re: Repeated SET requests failing

"Dave Shield" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
On 07/06/07, Ward Witt <[email protected]> wrote:
>  // SNMP-SET 1.3.6.1.4.1.6827.10.74.3.9.1.1.2 Int 2
>
>  Sending 30 bytes to UDP: [10.0.0.126]:161
>  0000: 30 1C 02 01  01 04 07 70  72 69 76 61  74 65 A3 0E
>  0016: 02 04 62 17  B9 1C 02 01  00 02 01 00  30 00
>
>  Received 30 bytes from UDP: [10.0.0.126]:161
>  0000: 30 1C 02 01  01 04 07 70  72 69 76 61  74 65 A2 0E
>  0016: 02 04 62 17  B9 1C 02 01  00 02 01 00  30 00

OK - that particular dump corresponds to a SET request
with no assignments included.   So it's not too suprising
that the update doesn't get applied.

That would tend to point the finger at the client-side code,
rather than the agent,

I've no experience with using Objective-C, so wouldn't
like to speculate as to how well the Net-SNMP library
integrates with such an environment.

But the thing that springs out immediately from your sample
code is:

        read_objid([objectIdString UTF8String], objectid, &length);
        struct snmp_pdu *pdu = snmp_pdu_create(SNMP_MSG_SET);
        char value = intVal + 0x30;
        snmp_add_var(pdu, objectid, length, 'i', &intVal);

you're not checking return codes.
Does the 'snmp_add_var' call succeed or not?
Does the 'read_objid' call succeed or not?

It's certainly worth checking these two - because if there are
any problems here, you will indeed end up with an empty
SET request.

Dave

-------------------------------------------------------------------------
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-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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.