Re: 回复:Re: about the snmpagent example

This is a discussion on Re: 回复:Re: about the snmpagent example within the SNMP Users forums, part of the Networking and Network Related category; [ First - *please* don't mail me privately, without copying any responses to the mailing list. I don't have the ...


Go Back   Usenet Forums > Networking and Network Related > SNMP Users

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-10-2008
Dave Shield
 
Posts: n/a
Default Re: 回复:Re: about the snmpagent example

[ First - *please* don't mail me privately, without copying
any responses to the mailing list. I don't have the time
or inclination to offer private, unpaid, SNMP consultancy.
Keep discussions to the list, where others can both learn
and offer advice. Thanks. ]



2008/5/9 <javelin2008@sina.com>:
> Thanks for you reply.
>
>> ----- Original Message -----
>> From: Dave Shield <D.T.Shield@liverpool.ac.uk>
>> To: javelin2008@sina.com
>> Subject: Re: about the snmpagent example
>> Date: 08-05-09 16:38:29

>
>> 2008/5/9 <javelin2008@sina.com>:
>> > Then i've downloaded "example mib module"(nstAgentModuleObject.c)
>> > and "header file"(nstAgentModuleObject.h ) and put them into the
>> > directory:/usr/local/src/net-snmp-5.1.4/agent/mibgroup.

>
>> Is this where you unpacked the source tarball?
>> [Note that this is a very old version, and no longer being maintained.
>> But that shouldn't affect whether you can add a new MIB or not.]

>
> Yes$B!$(Bthe example mib module(nstAgentModuleObject.c) was downlaod from
> "https://sourceforge.net/search/?group_id=12694&type_of_search=mlists",
> the file .c and .h also;
>
>> > Secondly,I entered the commands in the terminal as follows:
>> > # export MIBS=ALL
>> > # ./configure --with-mib-modules="nstAgentModuleObject"
>> > # make
>> > # make install

>
>> This is from /usr/local/src/net-snmp-5.1.4/agent/mibgroup - yes?

>
> Yes,i put the .c and .h file in
> /usr/local/src/net-snmp-5.4.1/agent/mibgroup.I use net-snmp's version is
> 5-4-1.



OK - 5.4.1 is a much more sensible version to use.
That's the most recent release - 5.1.4 is obsolete.
[Please be careful when posting queries - such details can be important!]


>> Did you start the new agent?
>> How?

>
>> Is there a vendor-supplied version of the Net-SNMP agent already
>> installed?
>> Did you stop that first? (Or better, remove it completely before
>> starting with
>> the self-compiled version).

>
> First,i stop the snmpd,then recompiled the source.
>
> # ./configure --with-mib-modules="nstAgentModuleObject"
> # make
> # make install
> I use the default installation.
> Thanks very much,Dave Shield.



But *how* did you stop the (vendors supplied) agent?
What was the command you used?

How did you start the re-compiled agent?
What was the command you used?

What is the result of
ps -ef | grep snmpd
?



> I also generate a small program use mib2c,the code below:



> void
> init_sysid(void)
> {
> static oid sysid_oid[] = { 1, 3, 6, 1, 4, 1, 55555, 1, 1, 1, 1 };


> netsnmp_register_scalar(netsnmp_create_handler_reg istration
> ("sysid", handle_sysid, sysid_oid,
> OID_LENGTH(sysid_oid), HANDLER_CAN_RONLY)))


> }


OK ....


> I also put these two files copy to .../net-snmp-5.4.1/agent/mibgroup/,then
> run
> # export MIBS=ALL
> # snmptranslate -IR -On sysid
> .1.3.6.1.4.1.55555.1.1.1.1
> # ./configure --with-mib-modules="sysid"
> # make
> # make install


OK....

>
> #snmpd -f -Le -d -Ddump -Dsysid
> but when i asked for a snmpget command,it also gave me the result:
> # snmpget -v 2c -c readstring localhost .1.3.6.1.4.1.55555.1.1.1.1
> SNMPv2-SMI::enterprises.55555.1.1.1.1=No Such Object available on this agent
> at this OID


You've forgotten the instance subidentifier.
..1.3.6.1.4.1.55555.1.1.1.1 is the OID of the MIB *object*,
not the scalar instance.

Try
snmpget -v 2c -c readstring localhost .1.3.6.1.4.1.55555.1.1.1.1.0


Dave

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757...un.com/javaone
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/...net-snmp-users
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:07 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0