[mrtg-developers] Re: PATCH: Custom table support

Phil Pennock mrtg-developers at spodhuis.demon.nl
Thu Aug 31 19:00:30 MEST 2006


On 2006-07-05 at 12:33 +0200, Phil Pennock wrote:
> Relative to MRTG 1.13.2, please find attached a patch to provide custom
> table support for MRTG.
> 
> In the same way that \Descr and #Name support IP interfaces, I needed to
> be able to extract a particular column from a table, where the column
> could vary.  In my case, NetApp Filer filesystem statistics.
> File-systems can be created and destroyed and I don't want to rely upon
> a fixed index number in the mrtg.cfg file.

In case anyone's using the custom patch, I'll post a small update here.

If the key into the database is not a simple integer, then the matching
logic would fail.  This happens if the key is an IP address.  The fix is
to allow multiple integers for the OID arc.

My test scenario is the per-client NFS stats provided by NetApp (TM,
etc) filers under the pclTable OID.

----------------------------8< cut here >8------------------------------
--- mrtg.old    Mon Mar 20 15:14:00 2006
+++ mrtg        Thu Aug 31 16:33:05 2006
@@ -1937,7 +1937,7 @@
                debug('snpo',"($i) Confcache Match $keyfield -> $ifnum[$i]");
            }
        }
-       if ($ifnum[$i] !~ /^$|^\.\d+$/) {
+       if ($ifnum[$i] !~ /^$|^(?:\.\d+)+$/) {
            warn "WARNING: Can not determine".
              " ifNumber for $$target{Community}\@$$target{Host}$$target{SnmpOpt} \tref: '$cross_ref' \tkey: '$$target{Key}[$i]'\n";
            return 'NOMATCH';
----------------------------8< cut here >8------------------------------

Regards,
-Phil

--
Unsubscribe mailto:mrtg-developers-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:mrtg-developers-request at list.ee.ethz.ch?subject=help
Archive     http://lists.ee.ethz.ch/mrtg-developers



More information about the mrtg-developers mailing list