Dave Shield wrote:
On 18/02/2008, Joey Officer <[EMAIL PROTECTED]> wrote:
I know I need to if this is the best way to provide output, and whether or
   not I should include the individual field name within the result (ie cpu:
   0.0 or just 0.0 ).

That's up to you.

What are you going to do with the output?
If your client-side processing would be easier without the internal field names,
then omit them.  If you feel it would be easier to understand the output with
them included (and doing so woudn't impact on any automated processing)
then leave them in.

In my opinion, I could/should document the output enough ahead of time so that only the relevant data is returned. So I'm leaning towards removing the field names.
UCD-SNMP-MIB::ucdavis.55.3.1.3.8.115.104.111.119.115.116.97.116
= INTEGER: 30  -- I assume this means I have 30 lines to output.

Correct.
This is effectively the MIB object "NET-SNMP-EXTEND-MIB::nsExtendOutNumLines"
(relocated relative to the root OID you specified).


 Is there a way to provide either an index,

See the final block of results - which display the same information one line
at a time.
   You might find this easier to follow if you used the config directive:

extend  showstat /bin/sh /tmp/var-snmp.sh agetty

and then walked "NET-SNMP-EXTEND-MIB::nsExtendObjects"
This will then display meaningful names and indexes.

This does indeed clean things up a bit, thanks.

Once I get this part completed, what is the best way to build an MIB for
release so that others could use this.

The "extend" mechanism is intended to support the output of arbitrary
scripts, formatted in a fixed manner.  It's probably the easiest way to make
information available quickly.
  But if you want to implement a particular MIB (either pre-defined or one
you've written yourself), then this is not the best approach.   You might
need to look at implementing the MIB "properly" using either a C-based
MIB module, or the "pass" script.
   In both these latter cases, you're moving the complexity from the client
side (handling arbitrary data presented within a fixed structure), to the
agent/MIB side (presenting the same data in a more tailored format).

  We can't really advise as to which is the best approach for you to adopt.
You would need to consider the requirements/expectations/etc of your user base.


Dave
Thanks Dave. I do appreciate the detailed feedback. I think for the moment, I'll leave the work on the client side, and have the server side in the back of my head until I decide to implement it properly. If I were to take this script a step further (intentionally) I want to chart specific arguments... so for example:

agetty tty1
agetty tty2

I'd adjust my output so that 'showstat.1' returned tty1 and .2 returned cpu value for tty1 .3 returned mem value for .1 and .4 returned total mem of host . Taking this further, .5 would return tty2 and .6 returned cpu value for tty2 .7 returned mem value for .5 and .8 returned total mem of host ... and so on

I can walk this today and get the values I'm looking for, but is there a way (and how) to index them accordingly? Or would it be possible that showstat.1 is tty1 and showstat.2 is tty2 etc?

--
Joey Officer
Systems Administrator   
iStream Imaging
262-432-1536

CONFIDENTIALITY NOTICE
This electronic mail and the information contained herein are intended for the 
named recipient only.  It may contain confidential, proprietary and/or 
privileged information.  If you have received this electronic mail in error, 
please do not read any text other than the text of this notice and do not open 
any attachments. Also, please immediately notify the sender by replying to this 
electronic mail or by collect call to (262) 796-0925. After notifying the 
sender as described above, please delete this electronic mail message 
immediately and purge the item from the deleted items folder (or the 
equivalent) of your electronic mail system. Thank you.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
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

Reply via email to