[prev in list] [next in list] [prev in thread] [next in thread] 

List:       net-snmp-coders
Subject:    Re: netsnmp agent error for snmpget()
From:       Ravi Depa <ravireddi5 () gmail ! com>
Date:       2011-05-16 4:07:41
Message-ID: BANLkTikpso1rZpJVF5=7vXF_Tzi4kQQ-pQ () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi,

Thanks Dave. Your response solved my problem. I have one more question
relating to capturing IP address and MAC address for ethernet interfaces
exist on the system. In my SNMP agent, I have to figure out how many system
ethernet interfaces are exist and update their IP and MAC address in a
table. I have looked at pre installed mibs and found that IP-MIB contains a
table for system ethernet IP addresses but I couldn't find the source to
check how it is implemented. Could you please suggest me how can I implement
this functionality or where I can find some further infromation?

On Fri, May 13, 2011 at 3:15 AM, Dave Shield <D.T.Shield@liverpool.ac.uk>wrote:

> On 12 May 2011 19:07, Ravi Depa <ravireddi5@gmail.com> wrote:
> >        The problem what I have is when I
> > send a snmpget request to agent, snmp agent is not responding for one
> > specific OID which is related to TIMETICKS
>
>
> >     char return_val[256];
>
>
> >         case MODE_GET:
> >             snmp_set_var_typed_value(requests->requestvb, ASN_TIMETICKS,
> >                                      (u_char *)& return_val,
> >                                      strnlen (return_val,256));
>
>
> TimeTicks is a based on the INTEGER type, so you need to return an integer
> value (i.e. a 'long' value, not a 256-character string)
>
> Have a look at agent/mibgroup/mibII/system_mib.c:handle_sysUpTime()
> for an example of how to implement such an object.
>
> Dave
>



-- 
Thank you,
Ravi Depa

[Attachment #5 (text/html)]

<div>Hi,</div>
<div> </div>
<div>Thanks Dave. Your response solved my problem. I have one more question relating \
to capturing IP address and MAC address for ethernet interfaces exist on the system. \
In my SNMP agent, I have to figure out how many system ethernet interfaces are exist \
and update their IP and MAC address in a table. I have looked at pre installed mibs \
and found that IP-MIB contains a table for system ethernet IP addresses but I \
couldn&#39;t find the source to check how it is implemented. Could you please suggest \
me how can I implement this functionality or where I can find some further \
infromation?<br> <br></div>
<div class="gmail_quote">On Fri, May 13, 2011 at 3:15 AM, Dave Shield <span \
dir="ltr">&lt;<a href="mailto:D.T.Shield@liverpool.ac.uk">D.T.Shield@liverpool.ac.uk</a>&gt;</span> \
wrote:<br> <blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px \
0px 0.8ex; BORDER-LEFT: #ccc 1px solid"> <div class="im">On 12 May 2011 19:07, Ravi \
Depa &lt;<a href="mailto:ravireddi5@gmail.com">ravireddi5@gmail.com</a>&gt; \
wrote:<br>&gt;        The problem what I have is when I<br>&gt; send a snmpget \
request to agent, snmp agent is not responding for one<br> &gt; specific OID which is \
related to TIMETICKS<br><br><br></div>&gt;     char return_val[256];<br> <div \
class="im"><br><br>&gt;         case MODE_GET:<br>&gt;             \
snmp_set_var_typed_value(requests-&gt;requestvb, ASN_TIMETICKS,<br>&gt;               \
(u_char *)&amp; return_val,<br>&gt;                                      strnlen \
(return_val,256));<br> <br><br></div>TimeTicks is a based on the INTEGER type, so you \
need to return an integer<br>value (i.e. a &#39;long&#39; value, not a 256-character \
string)<br><br>Have a look at \
agent/mibgroup/mibII/system_mib.c:handle_sysUpTime()<br> for an example of how to \
implement such an object.<br><font \
color="#888888"><br>Dave<br></font></blockquote></div><br><br clear="all"><br>-- \
<br>Thank you,<br>Ravi Depa<br>



------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay

_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic