| Newsgroups |
gmane.network.net-snmp.user |
| Message-ID |
<[email protected]> |
> > Thanks for you reply.
>>
>> > ----- Original Message -----
>> > From: Dave Shield <[email protected]>
>> > To: [email protected]
>> > Subject: Re: about the snmpagent example
>> > Date: 08-05-09 16:38:29
>>
>>> 2008/5/9 <[email protected]>:
>>> > 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,the 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!]
Ok!
>>> 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?
Oh,the below is my operate.
#ps -aux|grep snmpd
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.3/FAQ
root 14960 0.0 0.5 79816 6056 ? S May09 0:01 snmpd -f -Le -C -c /etc/snmp/snmpd.conf -d -Ddump -Dsysid
root 2855 0.0 0.0 42312 696 pts/1 S+ 19:32 0:00 grep snmpd
#kill -9 14960
> How did you start the re-compiled agent?
> What was the command you used?
> What is the result of
> ps -ef | grep snmpd
> ?
I use the command is:
#make uninstall
#make clean
#./configure --with-mib-modules="sysid"
#make
#make install
> > 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_registration
>> ("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
Ooh,but i also run snmpget -v 2c -c readstring localhost .1.3.6.1.4.1.55555.1.1.1.1.0,
# snmpget -v 2c -c readstring localhost .1.3.6.1.4.1.55555.1.1.1.1.0
SNMPv2-SMI::enterprises.55555.1.1.1.1.0 = No Such Object available on this agent at this OID
The problem is that net-snmp version?
Thanks very much!
-------------------------------------------------------------------------
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;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
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
-------------------------------------------------------------------
想玩得精彩?快来惠普"我的电脑 我的舞台"( http://d1.sina.com.cn/sina/limeng3/mail_zhuiyu/2008/mail_zhuiyu_20080505.html )
-------------------------------------------------------------------
注册新浪2G免费邮箱(http://mail.sina.com.cn/)
-------------------------------------------------------------------------
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;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
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