Re: SNMP Set is getting Failed

Dave Shield <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
On 19 January 2011 06:57, Kumar Sanjay-XJD784
<[email protected]> wrote:
> Observation:
> 1. In MODE_GET , Only last inserted user is available
> 2. And snmpwalk return the same "user"
> 3. But in function _get_next_data_point ALL the USER name are available
>
> Question:
> Data is available but snmpwalk return only last object.


I've spotted a couple of problems in your code:

   a)  When you create the initial contents of the table,
         you specify the wrong length of the username
         "sanjay" is of length 6, not 7
                   (line 106)

(You should also set the rowStatus value to "Active", not "createAndGo"
 but that's a minor problem)

   b)  When you set the index values in the 'get_next' loop,
         you specify the size of the username buffer (255),
         not the length of the actual string value
                You should use 'strlen', not 'sizeof'
                          (line 201)

That second error does seem to make a significant difference.


There may be other problems, but you'll have to rely on other
to help find them (or fix them yourself).   I'm off for the rest of
the week now!

Dave

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
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.