On 15 March 2011 02:17, David Taylor <david.tay...@ieee.org> wrote: > have created a table and am trying to get an object from this table.
Which object? In particular - which row of the table? > I need to obtain this object based on name within this object. I don't > want to traverse the table or use a table index to access this object. You're trying to access a value from within a table, but you don't want to tell the agent which row this is found in? Just think about that for a moment. Does that really sound sensible? > Is there a way to do this using net-snmp? No - what you are asking is logically impossible. If you are retrieving a value from within a table, then this inherently *MUST* include the table index. That's the whole point of having an index - this is the way to distinguish different rows of the table. > An example is the following: > The table has objects where each object has a town name and population. > I would like to do a get to access the object by town name. If the table is indexed by town name, then you could issue a query such as snmpget .... myTownPopulation.\"Liverpool\" If the table is indexed by an arbitrary integer (or some other index), then you would have to walk the myTownName column to identify the appropriate index, and then use this to retrieve the corresponding myTownPopulation value. Of course, having walked the myTownName column once, you could cache this information, and re-use it for subsequent queries. Or you could define a "reverse mapping" MIB table, indexed by name and listing the corresponding indexes. But there's no way of going straight to a given value within the table, other than using the index for that table. Remember, SNMP is the *Simple* Network Management Protocol. It has very basic data structures and protocol operations (to assist with implementing it on small, embedded systems). The design philosophy was always to move the responsibility for more complicated processing into the client-side applications. If you're trying to use the table in a slightly different way to the way it was originally designed, then the client application needs to handle this adjustment - not the agent. Dave ------------------------------------------------------------------------------ Colocation vs. Managed Hosting A question and answer guide to determining the best fit for your organization - today and in the future. http://p.sf.net/sfu/internap-sfd2d _______________________________________________ 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/listinfo/net-snmp-users