Discussion:
Help! "No Such Object available on this agent at this OID" about NET-SNMP
Goodshirly
2007-06-13 03:25:59 UTC
Permalink
Hi,all

I'm doing some job with the NET-SNMP upon Linux.But there is something strange arised.

I wanted to write a MIB module of my own,but i didn't know how to start with it.
So i followed the tutorial in the web site: http://net-snmp.sourceforge.net/wiki/index.php/TUT:Writing_a_MIB_Module. As this is an example of how to write a MIB module. Then I've done the job as follows:

Firstly,I've downloaded the MIB named "NET-SNMP-TUTORIAL-MIB" from the web site,then I put this .txt file into the directory:/usr/local/share/ snmp/mibs; 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.

Secondly,I entered the commands in the terminal as follows: # export MIBS=ALL # ./configure --with-mib-modules="nstAgentModuleObject" # make # make install

Then when i asked for a snmptranslate command,it gave me the right result: # snmptranslate -On NET-SNMP-TURORIAL-MIB::nstAgentModuleObject.0 .1.3.6.1.4.1.8072.2.4.1.1.1.0

but when i asked for a snmpget command,it gave me the result: # snmpget -v 2c -c xzpublic localhost NET-SNMP-TUTORIAL- MIB::nstAgentModuleObject.0 NET-SNMP-TUTORIAL-MIB::nstAgentModuleObject.0=No Such Object available on this agent at this OID

Why?Why it didn't return the correct value to me?Is there anything important I ignored?

But when i entered the command as follows,it gave me the correct value: # snmpget -v 2c -c xzpublic loalhost sysUpTime.0 SNMPv2-MIB::sysUpTime.0=Timeticks:(500804)1:23:28.40

Why?

The information in the /usr/local/share/snmp/snmpd.conf are as follows: rocommunity xzpublic rwcommunity private trapsink localhost trap2sink 192.168.1.100

The information in the /etc/snmp/snmpd.conf are as follows:
com2sec notConfigUser default public com2sec read default xzpublic com2sec write default private

group notConfigGroup v1 notConfigUser group notConfigGroup v2 notConfigUser group readgroup v1 read group readgroup v2 read group writegroup v1 write group writegroup v2 write
view systemview included .1.3.6.1.2.1.1 view systemview included .1.3.6.1.25.1.1 view allview included .1 80

access notConfigGroup "" any noauth exact systemview none none access readgroup "" any noauth 0 allview none allview access writegroup "" any noauth 0 none allview allview

What's wrong with the whole procedure? Oh,one more question,what's the difference between the /usr/local/ share/snmp/snmpd.conf file and the /ect/snmp/snmpd.conf file?

Could you help me?
Thanks a lot! Looking forward to your help!
_________________________________________________________________
ʹÓÃÏÂÒ»ŽúµÄ MSN Messenger¡£
http://imagine-msn.com/messenger/launch80/default.aspx?locale=zh-cn&source=wlmailtagline
Dave Shield
2007-06-13 11:32:37 UTC
Permalink
Post by Goodshirly
# export MIBS=ALL
# ./configure --with-mib-modules="nstAgentModuleObject"
# make
# make install
# snmpget -v 2c -c xzpublic localhost NET-SNMP-TUTORIAL-
MIB::nstAgentModuleObject.0
NET-SNMP-TUTORIAL-MIB::nstAgentModuleObject.0=No Such Object available
on this agent at this OID
Why?
Did you actually *run* the snmpd agent that you compiled?
"make install" just installs the software - it doesn't automatically
start the agent.
Post by Goodshirly
Oh,one more question,what's the difference between the /usr/local/
share/snmp/snmpd.conf file and the /ect/snmp/snmpd.conf file?
/etc/snmp/snmpd.conf will typically apply to the vendor-supplied agent.
/usr/local/share/snmp/snmpd.conf will apply to the version you compiled.

You need to make sure that you start the correct one, and that the other
version isn't already running.
It's safest to uninstall the vendor-supplied version altogether.

Dave
Goodshirly
2007-06-13 13:45:25 UTC
Permalink
Hi,Dave and Hi,all I really appreciate your reply.But there are still something I don't understand. > Did you actually *run* the snmpd agent that you compiled?> "make install" just installs the software - it doesn't automatically> start the agent.what's your exact meaning about "actually run the snmpd agent that you compiled"? I started the snmpd service by the command as follows: % /usr/local/sbin/snmpdthen no information returned. And I also entered the command:% /etc/rc.d/init.d/snmpd startit showed the result to me:start snmpd: [OK]so I thouht the snmpd service must be started,otherwise I couldn't get the correct value from sysUpTime.0; But in this case,I couldn't fetch the right feedback from nstAgentModuleObject.0. what should I do? > You need to make sure that you start the correct one, and that the other> version isn't already running.> It's safest to uninstall the vendor-supplied version altogether.I'm sorry,i don't know how to guarantee there is only one correct snmpd.conf file running.And how to uninstall the vendor-supplied version altogether? At last,I'd like to give some more information about my situation. when I sent a request on "nstAgentModuleObject.0 -d" via snmpget,it gave me the follow result: % snmpget -v 2c -c xzpublic localhost NET-SNMP-TURORIAL-MIB::nstAgentModuleObject.0 -d Sending 50 bytes to 127.0.0.10000: 30 30 02 01 01 04 08 78 7A 70 75 62 6C 69 63 A0 00.....xzpublic.0016: 21 02 04 44 0F 0B 88 02 01 00 02 01 00 30 13 30 !..D.........0.00032: 11 06 0D 2B 06 01 04 01 BF 08 02 04 01 01 01 00 ...+............0048: 05 00 .. Received 50 bytes from 127.0.0.1 0000: 30 30 02 01 01 04 08 78 7A 70 75 62 6C 69 63 A2 00.....xzpublic.0016: 21 02 04 44 0F 0B 88 02 01 00 02 01 00 30 13 30 !..D.........0.00032: 11 06 0D 2B 06 01 04 01 BF 08 02 04 01 01 01 00 ...+............0048: 80 00 NET-SNMP-TURORIAL-MIB::nstAgentModuleObject.0=No Such Object available on this agent at this OID. I've analyzed the two packets.There were only two difference between them. One case was the byte "0A" in Sending packet,and the "A2" in Received packet.I knew it meant the packet style,one was the GetRequest PDU,the other was the Response PUD. And the other difference was the second-to-last byte in each packet.I meant the byte "05" in Sending packet,and the "80" in Received packet.I knew the byte "05" is a NULL style value binded in the GetRequest PDU.But why there was nothing valuablereturn value binded in the Response PDU? Instead,to gave me a "80" value? What wrong with it? So,At last,I got a return value just said:No Such Object available on this agent at this OID. What can I do to fix this problem? Thanks a lot!
_________________________________________________________________
ʹÓÃÏÂÒ»ŽúµÄ MSN Messenger¡£
http://imagine-msn.com/messenger/launch80/default.aspx?locale=zh-cn&source=wlmailtagline
Goodshirly
2007-06-17 03:03:13 UTC
Permalink
Hi,Dave:

Thanks a million for your help.I've fixed the problem already.
Post by Dave Shield
Did you actually *run* the snmpd agent that you compiled?
/etc/snmp/snmpd.conf will typically apply to the vendor-supplied agent.>/usr/local/share/snmp/snmpd.conf will apply to the version you compiled.>You need to make sure that you start the correct one, and that the other>version isn't already running.> It's safest to uninstall the vendor-supplied version altogether.
yes,you are right.

Althogh I did run the snmpd that I compiled,I also run the
snmpd that the vendor supplied.
Maybe It's the real reason which led to tht problem.

When I stoped the snmpd which the vendor supplied and ran the correct one
that I cmpiled,the correct value returned to me.
Thank goodness!

I really appreciate your help!


_________________________________________________________________
ʹÓÃÏÂÒ»ŽúµÄ MSN Messenger¡£
http://imagine-msn.com/messenger/launch80/default.aspx?locale=zh-cn&source=wlmailtagline
Loading...