RE: snmpwalk does not walk the table when using dynamic load.
Wei Zheng <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <4B18A8F75A6384449755BC7784073E93616F84290F@exch11.olympus.f5net.com> |
1) snmpwalk/GET lmPlTable,
~~~~~~~~~~~~~~~~~~~~~~~~~~~
# snmpwalk -c public localhost lmPlTable
LOCAL-MIB::lmPlTable = No Such Object available on this agent at this OID
# snmpget -c public localhost lmPlTable
LOCAL-MIB::lmPlTable = No Such Object available on this agent at this OID
# snmpgetnext -c public localhost lmPlTable
LOCAL-MIB::lmPlStatResetStats.0 = INTEGER: 0
(On subagent system, GETNEXT will output lmPlName,
# snmpgetnext -c public localhost lmPlTable
LOCAL-MIB::lmPlName."test1" = STRING: test1)
Snmpwalk/get/getnext individual entries,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# snmpwalk -c public localhost lmPlName
LOCAL-MIB::lmPlName."test1" = STRING: test1
LOCAL-MIB::lmPlName."test2" = STRING: test2
LOCAL-MIB::lmPlName."test3" = STRING: test3
# snmpgetnext -c public localhost lmPlName
LOCAL-MIB::lmPlName."test1" = STRING: test1
# snmpget -c public localhost lmPlName
LOCAL-MIB::lmPlName = No Such Instance currently exists at this OID
# snmpget -c public localhost lmPlName."test1"
lmPlName.test1: Unknown Object Identifier (Index out of range: test1 (lmPlName))
2) Registration code:
======================================================================
oid lmPl_variables_oid[] =
{ 1, 3, 6, 1, 4, 1, 3375, 2, 2, 5, 1 };
struct variable4 lmPl_variables[] = {
#define LMPLNUMBER 1
{LMPLNUMBER, ASN_INTEGER, RONLY, var_lmPl, 1, {1}},
#define LMPLNAME 2
{LMPLNAME, ASN_OCTET_STR, RONLY, var_lmPlTable, 3, {2, 1, 1}},
#define LMPLLBMODE 3
{LMPLLBMODE, ASN_INTEGER, RONLY, var_lmPlTable, 3, {2, 1, 2}},
#define LMPLACTIONONSERVICEDOWN 4
{LMPLACTIONONSERVICEDOWN, ASN_INTEGER, RONLY, var_lmPlTable, 3,
{2, 1, 3}},
};
/*
* init_lmPl():
* Initializes the lmPl module. This is called when the agent starts up.
* At a minimum, registration of your variables should take place here.
*/
void
init_lmPl(void)
{
REGISTER_MIB("lmPl", lmPl_variables, variable4,
lmPl_variables_oid);
}
======================================================================
3) Regarding "nsModuleName",
a) We do recompile net-snmp. I am not aware that we do anything special
when compiling net-snmp. Anything I should check to explain the "unexpected"?
b) Access Control is configured as (read from snmpd.conf):
##########################################################################
# Set Access Control
# View-Based Access Control Model (vacm) RFC 2265
#
rocommunity "public" default
rwcommunity "private"
# no rousers[6]/rwusers[6] were specified
c)
# snmpgetnext -c public localhost nsModuleName
NET-SNMP-EXTEND-MIB::nsExtendNumEntries.0 = INTEGER: 0
Dave, thank you for the help.
Wei
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Dave Shield
Sent: Thursday, March 18, 2010 2:34 AM
To: Wei Zheng
Cc: [email protected]
Subject: Re: snmpwalk does not walk the table when using dynamic load.
On 17 March 2010 23:24, Wei Zheng <[email protected]> wrote:
> Regarding your questions:
> 1) Cannot walk lmPlTable correctly either: it returns " No Such Object available on this agent at this OID".
What about GET requests on individual entries?
Please report the *exact* commands and responses that you get.
(Vague reports of "it doesn't work" aren't a lot of help)
> 2) I registered lmPl, very similar code as dlmod is registered in dlmod.c.
Grrr... If I ask to see what the code is, there's usually a reason for it.
Saying that it's "Very similar" to something else is not much help,
and is simply irritating. I don't have time to waste guessing what
you might or might not have done!
Please - what does the registration code actually look like?
> 3) When I snmpwalk ... nsModuleName, it returns " No Such Object available on this agent at this OID".
Hmmm... that's unfortunate. And unexpected.
It should be part of any Net-SNMP agent, unless it's been
compiled/configured in an unusual manner.
Did you compile the agent yourself, or is it a vendor-supplied one?
What do the access control settings look like?
What does "snmpgetnext ... nsModuleName" return?
> I am wondering, what is the difference on query mibs between agentX and dynamic load?
Dynamic loading makes your new MIB module part of the same running
process as the master agent.
Once it's been successfully loaded, then everything works the same as
if it had been compiled
into the agent binary in the first place.
AgentX is a protocol by which the master agent can talk to a separate
process (potentially
running on a different host) and retrieve management information from
there. Think of the
difference between shared libraries and RPC calls in conventional programming.
> Same code (mib structure, register and etc.) works for agentX, not dynamic load.
The Net-SNMP agent has been deliberately designed so that the same MIB handling
code should work for an AgentX subagent, a dynamically loaded module,
or a statically
compiled one.
Yes - you are experiencing a problem with dynamic loading, but the same code
*ought* to work regardless.
> More notes:
> 1) During "snmpwalk lmPl", when callback routine (used when the object is queried) is called,
> for dynamic load, the name passed to the function is the lmPl_oid;
> for agentX, the name passed to the function is lmPlNumber oid {lmPl_oid 1}. (1 is the sub-components for lmPlNumber.)
> Question: What makes the difference? Does this matter?
I have no idea.
Without seeing the registration code, I can only guess what might be happening,
> 2) In agentX, when snmpwalk lmPl, snmp_agent logged something like,
> ===============================================
> snmp_agent: varbind 1 is inclusive
> snmp_agent: inclusive range(s) in getNext
> ===============================================
> While dynamic load does not have these logs.
Of course not.
Because AgentX is an inter-process protocol, which uses a similar
protocol request structure (including a varbind payload) to SNMP.
A dynamically loaded module is part of the SNMP agent binary,
so doesn't need an inter-process protocol.
A more sensible comparison would be with the debugging messages logged
by a statically-compiled MIB module.
> Question: What is varbind for?
See above
> Does this "inclusive set" matter?
No - because you're not using AgentX.
Anything relating to that protocol is irrelevant.
> 3) I assume having "AgentX master support" tuned on does not affect
> dynamic load functionalities.
Correct.
Dave
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
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