Patch: custom summation label

Addons for Cacti and discussion about those addons

Moderators: Developers, Moderators

Post Reply
Hip
Posts: 18
Joined: Wed Sep 01, 2004 5:21 am
Location: Switzerland

Patch: custom summation label

Post by Hip »

Hello all,

I've been using Cacti for a few months now and it's really a great tool !

I find the "bandwidth summation" special variable very useful, but in fact it would be better to have the possibility to sum up different kind of metrics, not only traffic. Actually, the only limitation to that is the label after the sum number ("bytes", "KB", "MB", etc.). Correct me if I'm wrong :)

I hacked a quick patch to Cacti (attached to this post), allowing to fully customize the summation label, without interfering with existing graphs that are using the "official" syntax. This patch has been written on a already patched version of Cacti with bonsai, so the rrd.php patch will probably fail if you don't have bonsai installed. If there's interest in this patch, I'd release another one for the vanilla 0.8.5a Cacti.

With this patch, the first parameter of the special "sum" variable is interpreted as following:
- [0-9]: the power of 10 divisor to apply (no change)
- 'auto': automatic scaling (no change)
- other: the string is appended to the total

Example: to sum up your incoming spams, you'd use "Total: |sum:spams:current:0:auto|", that would result in "Total: 482 spams".

Patching instructions (Linux/Unix):
- Decompress the patch:
# gunzip /path/to/summation_label.patch.gz
- From the Cacti directory, apply the patch:
# patch -p0 < /path/to/summation_label.patch

I'm waiting for your comments & feedback !

Hip
Attachments
summation_label.patch.gz
Customize summation label
(504 Bytes) Downloaded 450 times
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests