[collectd] Need help for filter

Tom Throckmorton throck at gmail.com
Thu Jan 3 18:08:35 CET 2013


On Thu, Jan 3, 2013 at 10:33 AM, Bill Schwanitz <bilsch at gmail.com> wrote:

>
> On Jan 3, 2013, at 10:15 AM, AUVINET Andre <
> Andre.AUVINET at nantesmetropole.fr> wrote:
>
> > Yes,  I want "stop" target for interfaces I did not need.
> >
> >
> > Something like :
> >
> > LoadPlugin "SNMP"
> > <Chain "PreCache">
> >  <Rule "Ignore_interfaces">
> >    <Match "regex">
> >      Plugin "^snmp$"
> >      Type "if_octets"                >>>> I don't know
> >       TypeInstance ""                >>>> I don't know
> >    </Match>
> >     <Target "stop">
> >     </Target>
> >  </Rule>
> >  Target "write"
> >  /Target
> > </Chain>
>
> Type is probably going to be your IF-MIB::ifOctets.526846912
>
> Do you know how to find the interface index?
> $ snmpwalk -v2c -c foo_comm_string foo_host IF-MIB::ifName
> IF-MIB::ifName.526846656 = STRING: Ethernet104/1/44
> IF-MIB::ifName.526846720 = STRING: Ethernet104/1/45
> IF-MIB::ifName.526846784 = STRING: Ethernet104/1/46
> IF-MIB::ifName.526846848 = STRING: Ethernet104/1/47
> IF-MIB::ifName.526846912 = STRING: Ethernet104/1/48
> (…)
>
> I imagine you are going to need that. Its probably going to be dropped in
> to TypeInstance value whole like this
>
> TypeInstance "IF-MIB::ifName.526846912"
>
> again, just a guess - this is kinda new to me. I'm adding this back to the
> mailing list in case anyone else is more familiar.
>

I haven't tried filtering, but if you only need data for a single
interface, then it can be done without the filter; in the 'Data' definition
within the snmp plugin config, just specify the OID+index in the 'Values'
and set 'Table' to false, which will lead to only the data for that
interface being pulled rather than the plugin parsing the ifTable.
 Assuming the index of that interface is 12345 on both chassis, something
like:

  <Data "ifmib_if_octets32">
    Type "if_octets"
    Table false
    Instance "te-0-1"
    Values "IF-MIB::ifInOctets.12345" "IF-MIB::ifOutOctets.12345"
 </Data>

  <Host "Nexus_5548_1">
    Address "172.20.0.30"
    Version 2
    Community "public"
    Collect "ifmib_if_octets32.12345" "ifmib_if_errors32.12345"
    Interval 120
  </Host>
  <Host "Nexus_5548_2">
    Address "172.20.0.31"
    Version 2
    Community "public"
    Collect "ifmib_if_octets32.12345" "ifmib_if_errors32.12345"
    Interval 120
  </Host>

The instance will be appended to the value list, so in this example you'd
end up with rrd filenames like 'ifmib_if_octets32-te-0-1', though you may
also leave the instance blank.

Cheers,

-tt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.verplant.org/pipermail/collectd/attachments/20130103/f3e0efa4/attachment.html>


More information about the collectd mailing list