On Mon, 23 Apr 2007, Dave Shield wrote: > On 20/04/07, Charles Sprickman <[EMAIL PROTECTED]> wrote: >> If I really want to have certain lines in a script that returns multiple >> lines be reported as integers, is there *anything* I can do to force that? >> >> Is there something beyond exec and extend that would make more sense? > > Let's take a step back. > Fundamentally, there are two possible approaches to reporting information > via SNMP. Either the data must be munged into a form that matches the > MIB, or a MIB must be written that matches the format of the data.
Got it. > The "simple script" extension mechanisms ("exec" and "extend") use the > first approach. We've defined a MIB structure that is flexible enough to > handle arbitrary script output. Which means that it can't make assumptions > about the format of this output, hence treating everything as text strings. > (That doesn't handle binary output very well, but never mind). Also understood. > If you're needing to report multiple integer values, then you probably need > to take the second approach, and define and implement a suitable MIB for > your data. The simplest way to implement this would probably be using > the "pass" directive, which also invokes a shell-script - though this would > need to be tailored suitably. This sounds very interesting, as I'm sure this won't be the last thing where I need to cook up something special. I had a look at the manpage and the brief wiki entry, but I'm wondering if anyone has a nice, simple example of implementing "pass" that I could stare at, hack up and hopefully learn something. > The other possibility it to hack the code of the 'extend' module, and > have it report integer values rather than strings. That's not something > we can do globally, since it wouldn't be appropriate for many > situations. But if this is a private setup, then you can tweak things > to your heart's content. (That's the beauty of Open Source, after all!) While tempting, I'd rather stick with a standard, unhacked install so that anyone following me won't get lost. :) Thanks again, Charles > Dave > ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ 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