Re: Re: Re: sourceforge tutorial sample code problem

"xiao ren" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
Many thanks for your kindly help!

And yes, I do install net-snmp lib from source, so I guess I have installed the MIB files already.

And read_objid function doesn't report error after I changed the oids structure according to your advice. Maybe I should always explicitly write the MIB name from which the oid originated?

oids[] = {
 { "SNMPv2-MIB::sysDescr.0" },
 { "IF-MIB::ifNumber.1" },
 { "IF-MIB::ifNumber.0" },
 { NULL }
};


------------------				 
xiao ren
2008-06-24

-------------------------------------------------------------
发件人:Dave Shield
发送日期:2008-06-24 16:22:49
收件人:xiao ren
抄送:Net-snmp-users
主题:Re: Re: sourceforge tutorial sample code problem

2008/6/23 xiao ren <[email protected]>:
> I don't install the MIB files

The MIB files are what defines the conversion between MIB object names
('system')
and numeric OIDs.   If the MIB files aren't available, then the
library won't understand
object names.

> According to the tutorial, it seems to me that this 'asyncapp.c' sample don't need
>any further installation, just 'make and run'.

The application doesn't need anything special.
But it does assume that you've got the Net-SNMP library and accompanying
stuff installed.


> Could you please show me where and how to install this MIB files?

The MIB files would normally be handled as part of installing the basic
Net-SNMP software - either from source ("make install") or as part of
a binary package.



> I replaced the function read_objid() to snmp_parse_oid() and the sample
> application works fine. Is read_objid() updated or something?

Strange - snmp_parse_oid is effectively a wrapper round read_objid.
Both of them rely on having the MIB files available.

Still, if that works for you, then fair enough.

It might be worth trying read_objid with
oids[] = {
 { "SNMPv2-MIB::sysDescr.0" },
 { "IF-MIB::ifNumber.1" },
 { "IF-MIBifNumber.0" },
 { NULL }
};


That's all I can think of offhand.

Dave

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php

_______________________________________________
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.