<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="MSHTML 8.00.7601.17998">
</head>
<body>
<div dir="ltr" align="left"><font color="#0000ff" size="2" face="Arial"><span class="360371907-04012013">Hi,
</span></font></div>
<div dir="ltr" align="left"><font color="#0000ff" size="2" face="Arial"><span class="360371907-04012013"></span></font> </div>
<div dir="ltr" align="left"><font color="#0000ff" size="2" face="Arial"><span class="360371907-04012013">Thank you for your answer.</span></font></div>
<div dir="ltr" align="left"><font color="#0000ff" size="2" face="Arial"><span class="360371907-04012013">No, I would like to filter more interfaces.</span></font></div>
<div dir="ltr" align="left"><font color="#0000ff" size="2" face="Arial"><span class="360371907-04012013"></span></font> </div>
<div><font color="#0000ff" size="2" face="Arial"><span class="360371907-04012013">The idea is to examine a table an to filter the result.</span></font></div>
<div><font color="#0000ff" size="2" face="Arial"><span class="360371907-04012013"></span></font> </div>
<div><font color="#0000ff" size="2" face="Arial"><span class="360371907-04012013">For example , filter the inteface mgmt but leave other.</span></font></div>
<div><font color="#0000ff" size="2" face="Arial"><span class="360371907-04012013"></span></font> </div>
<div><font color="#0000ff" size="2" face="Arial"><span class="360371907-04012013">Cordially,</span></font></div>
<div><font color="#0000ff" size="2" face="Arial"><span class="360371907-04012013"></span></font> </div>
<div><font color="#0000ff" size="2" face="Arial"><span class="360371907-04012013"></span></font> </div>
<div><font color="#0000ff" size="2" face="Arial"><span class="360371907-04012013"></span></font> </div>
<div><font color="#0000ff" size="2" face="Arial"><span class="360371907-04012013"></span></font> </div>
<div><font color="#0000ff" size="2" face="Arial"></font> </div>
<div><font color="#0000ff" size="2" face="Arial"></font> </div>
<div align="left"><strong><font face="Arial">André Auvinet</font></strong></div>
<div align="left"><font color="#808080" size="2" face="Arial">Technicien réseaux & télécoms</font></div>
<div align="left"><font color="#808080" size="2" face="Arial">Département général des ressources numériques</font></div>
<div align="left"><font color="#808080" size="2" face="Arial">Nantes Métropole et Ville de Nantes</font></div>
<div align="left"><font size="1" face="Arial">Tour Bretagne</font></div>
<div align="left"><font size="1" face="Arial">44923 Nantes cedex 9</font></div>
<div align="left"><font size="1" face="Arial">Tél. 02 40 99 93 59</font></div>
<div align="left"><font size="1" face="Arial">Fax. 02 40 20 38 48</font></div>
<div align="left"><font size="1" face="Arial"></font> </div>
<div align="left"><font color="#808080" size="2" face="Arial"></font> </div>
<div align="left"><font color="#808080" size="2" face="Arial"></font> </div>
<div> </div>
<br>
<div dir="ltr" lang="fr" class="OutlookMessageHeader" align="left">
<hr tabindex="-1">
<font size="2" face="Tahoma"><b>De :</b> Tom Throckmorton [mailto:throck@gmail.com]
<br>
<b>Envoyé :</b> jeudi 3 janvier 2013 18:09<br>
<b>À :</b> Bill Schwanitz; AUVINET Andre<br>
<b>Cc :</b> collectd@verplant.org<br>
<b>Objet :</b> Re: [collectd] Need help for filter<br>
</font><br>
</div>
<div></div>
On Thu, Jan 3, 2013 at 10:33 AM, Bill Schwanitz <span dir="ltr"><<a href="mailto:bilsch@gmail.com" target="_blank">bilsch@gmail.com</a>></span> wrote:<br>
<div class="gmail_quote">
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<br>
On Jan 3, 2013, at 10:15 AM, AUVINET Andre <<a href="mailto:Andre.AUVINET@nantesmetropole.fr">Andre.AUVINET@nantesmetropole.fr</a>> wrote:<br>
<br>
> Yes,  I want "stop" target for interfaces I did not need.<br>
><br>
><br>
> Something like :<br>
><br>
> LoadPlugin "SNMP"<br>
> <Chain "PreCache"><br>
>  <Rule "Ignore_interfaces"><br>
>    <Match "regex"><br>
>      Plugin "^snmp$"<br>
>      Type "if_octets"                >>>> I don't know<br>
>       TypeInstance ""                >>>> I don't know<br>
>    </Match><br>
>     <Target "stop"><br>
>     </Target><br>
>  </Rule><br>
>  Target "write"<br>
>  /Target<br>
> </Chain><br>
<br>
Type is probably going to be your IF-MIB::ifOctets.526846912<br>
<br>
Do you know how to find the interface index?<br>
$ snmpwalk -v2c -c foo_comm_string foo_host IF-MIB::ifName<br>
IF-MIB::ifName.526846656 = STRING: Ethernet104/1/44<br>
IF-MIB::ifName.526846720 = STRING: Ethernet104/1/45<br>
IF-MIB::ifName.526846784 = STRING: Ethernet104/1/46<br>
IF-MIB::ifName.526846848 = STRING: Ethernet104/1/47<br>
<div class="im">IF-MIB::ifName.526846912 = STRING: Ethernet104/1/48<br>
</div>
(…)<br>
<br>
I imagine you are going to need that. Its probably going to be dropped in to TypeInstance value whole like this<br>
<br>
TypeInstance "IF-MIB::ifName.526846912"<br>
<br>
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.<br>
</blockquote>
<div><br>
</div>
<div>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:</div>
<div><br>
</div>
<div><span style="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: Arial; COLOR: rgb(34,34,34)">  <Data "ifmib_if_octets32"></span><br style="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: Arial; COLOR: rgb(34,34,34)">
<span style="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: Arial; COLOR: rgb(34,34,34)">    Type "if_octets"</span><br style="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: Arial; COLOR: rgb(34,34,34)">
<span style="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: Arial; COLOR: rgb(34,34,34)">    Table false</span><br style="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: Arial; COLOR: rgb(34,34,34)">
<span style="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: Arial; COLOR: rgb(34,34,34)">    Instance "te-0-1"</span><br style="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: Arial; COLOR: rgb(34,34,34)">
<span style="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: Arial; COLOR: rgb(34,34,34)">    Values "IF-MIB::ifInOctets.12345" "IF-MIB::ifOutOctets.</span><span style="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: Arial; COLOR: rgb(34,34,34)">12345</span><span style="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: Arial; COLOR: rgb(34,34,34)">"</span></div>
<div><span style="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: Arial; COLOR: rgb(34,34,34)"> </Data></span></div>
<div><span style="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: Arial; COLOR: rgb(34,34,34)"><br>
</span></div>
<div><span style="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: Arial; COLOR: rgb(34,34,34)">  <Host "Nexus_5548_1"></span><br style="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: Arial; COLOR: rgb(34,34,34)">
<span style="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: Arial; COLOR: rgb(34,34,34)">    Address "172.20.0.30"</span><br style="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: Arial; COLOR: rgb(34,34,34)">
<span style="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: Arial; COLOR: rgb(34,34,34)">    Version 2</span><br style="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: Arial; COLOR: rgb(34,34,34)">
<span style="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: Arial; COLOR: rgb(34,34,34)">    Community "public"</span><br style="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: Arial; COLOR: rgb(34,34,34)">
<span style="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: Arial; COLOR: rgb(34,34,34)">    Collect "ifmib_if_octets32.</span><span style="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: Arial; COLOR: rgb(34,34,34)">12345</span><span style="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: Arial; COLOR: rgb(34,34,34)">"
 "ifmib_if_errors32</span><span style="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: Arial; COLOR: rgb(34,34,34)">.</span><span style="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: Arial; COLOR: rgb(34,34,34)">12345</span><span style="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: Arial; COLOR: rgb(34,34,34)">"</span></div>
<div><span style="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: Arial; COLOR: rgb(34,34,34)">    Interval 120</span><br style="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: Arial; COLOR: rgb(34,34,34)">
<span style="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: Arial; COLOR: rgb(34,34,34)">  </Host></span><br style="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: Arial; COLOR: rgb(34,34,34)">
<span style="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: Arial; COLOR: rgb(34,34,34)">  <Host "Nexus_5548_2"></span><br style="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: Arial; COLOR: rgb(34,34,34)">
<span style="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: Arial; COLOR: rgb(34,34,34)">    Address "172.20.0.31"</span><br style="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: Arial; COLOR: rgb(34,34,34)">
<span style="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: Arial; COLOR: rgb(34,34,34)">    Version 2</span><br style="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: Arial; COLOR: rgb(34,34,34)">
<span style="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: Arial; COLOR: rgb(34,34,34)">    Community "public"</span><br style="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: Arial; COLOR: rgb(34,34,34)">
<span style="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: Arial; COLOR: rgb(34,34,34)">    Collect "ifmib_if_octets32</span><span style="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: Arial; COLOR: rgb(34,34,34)">.</span><span style="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: Arial; COLOR: rgb(34,34,34)">12345</span><span style="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: Arial; COLOR: rgb(34,34,34)">"
 "ifmib_if_errors32</span><span style="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: Arial; COLOR: rgb(34,34,34)">.</span><span style="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: Arial; COLOR: rgb(34,34,34)">12345</span><span style="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: Arial; COLOR: rgb(34,34,34)">"</span></div>
<div><span style="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: Arial; COLOR: rgb(34,34,34)">    Interval 120</span><br style="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: Arial; COLOR: rgb(34,34,34)">
<span style="BACKGROUND-COLOR: rgb(255,255,255); FONT-FAMILY: Arial; COLOR: rgb(34,34,34)">  </Host></span></div>
<div><br>
</div>
<div>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.</div>
<div> </div>
<div></div>
</div>
<div>Cheers,</div>
<div><br>
</div>
<div>-tt</div>
</body>
</html>