All pastes #980968 Raw Edit

Untitled

public text v1 · immutable
·published 2008-04-11 13:06 UTC
rendered paste body
Okay, so I've got a Perl script feeding me data from a non-SNMP-enabled command-line utility, and it understands queries like "x.y.z" to mean  "provide only the zth element of the yth element of the xth element of your output".  "Pass" appears to be what I'd use to SNMP-enable that, but it's not-very-clearly documented as to exactly what I'm supposed to do when passed "-g" and "-n".  Is there a good example script out there from which I can base my understanding, or someone who has worked with this sort of custom functionality extension before?

Perhaps I can ask it a different way... if I get "-g" (GET), I'm pretty sure I know what to do when that's at the level of a terminal data node.

But I don't know what to do in either of the following situations:
"-g" when the data's located deeper in the tree, or
"-n" in any circumstance, but especially where the last datum outputted was the final datum in that branch, but not the final datum in the tree which I handle (i.e., if you were working with CPU's, and each CPU had manufacturer as .0 and  model number as .1, what do I do in a two-CPU system when I'm called with -n and the requested datum is the model number of CPU #0?).

And in the interest of giving examples for both, in the first example of my confusion ("'-g' when the data's located deeper in the tree"), an example would be the a -g on the OID for one of the CPU's, which intrinsically contains no data; only the .0 and .1 object IDs *within it* contain data.