Is there a way in cacti to force certain precision on numbers? I remember doing it with rrd, however I'm not sure how to go about it using the cacti interface. For example, with system load I it to read 0.06 instead of 60.00 m. Check the link below to see what I'm talking about.
http://www.meshier.com/cacti/graph.php? ... &rraid=all
Brent Meshier
Global Transport Logistics
http://www.shipgtl.com/
GPRINT options
Moderators: Developers, Moderators
-
- Posts: 35
- Joined: Sat Apr 13, 2002 5:16 pm
- Location: Santa Barbara, CA
I changed the following lines in includes/rrd_functions.php:
The removal of the "%s" is the key. From the man page for rrdgraph:
raX, this gets back to needing a modular way to pass any number of options to rrdtool, and a modular way to modify "$gprint_text".
See also this post on a way to do this now (hack in progress):
http://www.raxnet.net/board/viewtopic.p ... ght=gprint
Cheers,
-gwynnebaer
Code: Select all
--- /tmp/cacti-0.6.7/include/rrd_functions.php Mon Apr 1 10:34:19 2002
+++ rrd_functions.php Wed Apr 24 21:21:48 2002
@@ -413,0 +414 @@
+ "--units-exponent 0 --alt-y-grid \\\n" .
@@ -835,0 +837 @@
+ $gprint_text = "%8.0lf";
@@ -837,0 +840,4 @@
+ if (stristr($text_format[$i],"!")){
+ $text_format[$i] = ereg_replace ("!", "" ,$text_format[$i]); /* remove custom flag */
+ $gprint_text = "";
+ }
This gives me exacting precision, but be careful that on some of your graphs, you may get numbers that are "too accurate" (ie, not the way you want them).If an additional '%s' is found AFTER the marker, the
value will be scaled and an appropriate SI magnitude
unit will be printed in place of the '%s' marker. The
scaling will take the '--base' argument into
consideration!
If a '%S' is used instead of a '%s', then instead of
calculating the appropriate SI magnitude unit for
this value, the previously calculated SI magnitude
unit will be used. This is useful if you want all
the values in a PRINT statement to have the same SI
magnitude unit. If there was no previous SI
magnitude calculation made, then '%S' behaves like a
'%s', unless the value is 0, in which case it does
not remember a SI magnitude unit and a SI magnitude
unit will only be calculated when the next '%s' is
seen or the next '%S' for a non-zero value.
raX, this gets back to needing a modular way to pass any number of options to rrdtool, and a modular way to modify "$gprint_text".
See also this post on a way to do this now (hack in progress):
http://www.raxnet.net/board/viewtopic.p ... ght=gprint
Cheers,
-gwynnebaer
I added a GPRINT Options field to the next version so you can specify whatever you want. I also added the following rrdtool graph options:
-Ian
Code: Select all
--logarithmic
--unit
--units-exponents
entires to plot load averages from snmp
i'm using .68 version
to get my load adverages to plot correctly instead of having .07 turn into 50m
i did the following
i set the units to -2 under rrd graph configuation ( still have to see how this turns out when the load reaches above 1....)
edit the graph items (gprint), select last for consolidated function, exact number for gprint options and type in %8.2lf into the box, and current: in the text format box.
hope this helps
to get my load adverages to plot correctly instead of having .07 turn into 50m
i did the following
i set the units to -2 under rrd graph configuation ( still have to see how this turns out when the load reaches above 1....)
edit the graph items (gprint), select last for consolidated function, exact number for gprint options and type in %8.2lf into the box, and current: in the text format box.
hope this helps
Who is online
Users browsing this forum: No registered users and 2 guests