[collectd] Using SNMP plugin with collectd

Florian Forster octo at collectd.org
Wed Oct 6 13:32:13 CEST 2010


Hi Kakoli,

On Sun, Oct 03, 2010 at 04:16:21PM +0000, Sen, Kakoli wrote:
> host.hrDevice.hrProcessorTable.hrProcessorEntry.hrProcessorLoad.15
> host.hrDevice.hrProcessorTable.hrProcessorEntry.hrProcessorLoad.16
> 
> I have put the following block in Collectd.conf for capturing this data:
> 
> <Data "hr_cpuLoad">
>        Type "cpustats_percent"
>        Table true
>        Instance "HOST-RESOURCES-MIB::hrProcessorEntry"
>        Values "HOST-RESOURCES-MIB::hrProcessorLoad"
> </Data>

with this configuration, the SNMP plugin will do two "SNMP walks", one
over "hrProcessorEntry" and one over "hrProcessorLoad", using successive
"GETNEXT" requests.

With GETNEXT, either OID will be used as the root of the respective
sub-tree. The first GETNEXT request will return the first leaf in the
tree, then the second leaf and so forth until the returned OID is
outside the scope of the sub-tree.

When all is done, you'll have two lists of values, one for "Instance"
and one for "Values". Ideally that's something like:

  Values:  23, 42, 4711
  Instance "foo", "bar", "qux"

The list of values returned from the "Instance" and the "Values" OIDs
will be matched together by their order. In our example:

  "foo":   23
  "bar":   42
  "qux": 4711

As you can see, ideally both lists have the same number of items. With
your configuration, the "hrProcessorLoad" sub-tree is contained within
the "hrProcessorEntry" subtree, which is a very strong indicator that
something is wrong. In your case, the "Instance" list will probably
contain garbage, because your root is too wide up in the OID-tree. And
this is likely the source of your problems.

> We need the configuration to be generic, applicable to any windows
> node.

If you didn't set the "Instance" option, the plugin would use the last
part of the value OID as instance. For example, "hrProcessorLoad.42"
translates to ".1.3.6.1.2.1.25.3.3.1.2.42", the last part would be "42".
I guess this is your best shot at getting unique identifiers. I admit
that calling the CPUs "15" and "16" when there are only two CPUs total
is confusing, but I don't know any elegant and generic way to cope with
that.
 
If that solution doesn't satisfy your needs, I recommend to take a look
at SSC Serv [0]. It reports CPU usage broken up into IRQ, System and
User code and – of course – uses the usual zero-based numbering.

Regards,
—octo

[0] <http://ssc-serv.com/>
-- 
Florian octo Forster
Hacker in training
GnuPG: 0x0C705A15
http://octo.it/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: Digital signature
URL: <http://mailman.verplant.org/pipermail/collectd/attachments/20101006/ff60e334/attachment.pgp>


More information about the collectd mailing list