I'm sorry that this is relative to MRTG 1.13.2, but I thought that I'd
sent it on 2006-03-20 and I've only just seen that I fubared. :^(
Take two ...
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.
So given dfTable, and these columns:
dfFileSys.1 = "aggr0"
dfFileSys.2 = "aggr0/.snapshot"
dfFileSys.3 = "/vol/vol0/"
dfFileSys.4 = "/vol/vol0/.snapshot"
dfFileSys.5 = "/vol/web/"
dfFileSys.6 = "/vol/web/.snapshot"
I needed to be able to get stats for "/vol/web/" reliably. The attached
patch handles this and *cough* has been in successful production use for
three months.
The syntax is somewhat ugly, but works:
%{TableName}{Header=Value}{RetrieveField}
Eg:
%{dfTable}{dfFileSys=/vol/vol0/}{dfPerCentInodeCapacity}&%{dfTable}{dfFileSys=/vol/web/}{dfPerCentKBytesCapacity}:[EMAIL
PROTECTED]
A bit longer than I'd like, but given what it's achieving, I don't see a
way to make it shorter.
The patch aims to limit the scope of interference rather than
restructuring function calls and major logic.
The field in mrtg.ok corresponding to the lookup key (eg, 'Descr') will
have a value for a custom table corresponding to TableName.Header;
eg: dfTable.dfFileSys
Comments very much appreciated.
Regards,
-Phil
--
"Everything has three factors: politics, money, and the right way to do it.
In that order." -- Gary Donahue
-- Attached file removed by Ecartis and put at URL below --
-- Type: text/plain
-- Size: 10k (10571 bytes)
-- URL : http://lists.ee.ethz.ch/p/mrtg-customtable.patch
--
Unsubscribe mailto:[EMAIL PROTECTED]
Help mailto:[EMAIL PROTECTED]
Archive http://lists.ee.ethz.ch/mrtg-developers