Add some magic to collecty that makes the graph templates smaller
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 14 Dec 2015 21:54:47 +0000 (22:54 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 14 Dec 2015 21:54:47 +0000 (22:54 +0100)
This patch will automatically add DEFs for all DSes in a
RR database. For all DEFs and CDEFs will be VDEFs generated
with the current, minimum and maximum values.

That reduces the size of the RRD graph templates massively
and makes them better readable and editable.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
14 files changed:
src/collecty/plugins/base.py
src/collecty/plugins/conntrack.py
src/collecty/plugins/contextswitches.py
src/collecty/plugins/df.py
src/collecty/plugins/disk.py
src/collecty/plugins/entropy.py
src/collecty/plugins/interface.py
src/collecty/plugins/interrupts.py
src/collecty/plugins/ipfrag.py
src/collecty/plugins/latency.py
src/collecty/plugins/loadavg.py
src/collecty/plugins/memory.py
src/collecty/plugins/processor.py
src/collecty/plugins/sensors.py

index ec91599..b6eabd0 100644 (file)
@@ -23,6 +23,7 @@ import datetime
 import logging
 import math
 import os
+import re
 import rrdtool
 import tempfile
 import threading
@@ -33,6 +34,8 @@ from .. import locales
 from ..constants import *
 from ..i18n import _
 
+DEF_MATCH = re.compile(r"C?DEF:([A-Za-z0-9_]+)=")
+
 class Timer(object):
        def __init__(self, timeout, heartbeat=1):
                self.timeout = timeout
@@ -437,6 +440,23 @@ class Object(object):
 
                return schema
 
+       def make_rrd_defs(self, prefix=None):
+               defs = []
+
+               for line in self.rrd_schema:
+                       (def_type, name, type, lower_limit, upper_limit) = line.split(":")
+
+                       if prefix:
+                               p = "%s_%s" % (prefix, name)
+                       else:
+                               p = name
+
+                       defs += [
+                               "DEF:%s=%s:%s:AVERAGE" % (p, self.file, name),
+                       ]
+
+               return defs
+
        def execute(self):
                if self.collected:
                        raise RuntimeError("This object has already collected its data")
@@ -565,6 +585,27 @@ class GraphTemplate(object):
 
                return args
 
+       def _add_vdefs(self, args):
+               ret = []
+
+               for arg in args:
+                       ret.append(arg)
+
+                       # Search for all DEFs and CDEFs
+                       m = re.match(DEF_MATCH, "%s" % arg)
+                       if m:
+                               name = m.group(1)
+
+                               # Add the VDEFs for minimum, maximum, etc. values
+                               ret += [
+                                       "VDEF:%s_cur=%s,LAST" % (name, name),
+                                       "VDEF:%s_avg=%s,AVERAGE" % (name, name),
+                                       "VDEF:%s_max=%s,MAXIMUM" % (name, name),
+                                       "VDEF:%s_min=%s,MINIMUM" % (name, name),
+                               ]
+
+               return ret
+
        def get_object(self, *args, **kwargs):
                return self.plugin.get_object(*args, **kwargs)
 
@@ -597,21 +638,21 @@ class GraphTemplate(object):
                args = self._make_command_line(interval, **kwargs)
 
                self.log.info(_("Generating graph %s") % self)
-               self.log.debug("  args: %s" % args)
 
-               object_files = self.get_object_files()
+               #object_files = self.get_object_files()
 
-               for item in self.rrd_graph:
-                       try:
-                               args.append(item % object_files)
-                       except TypeError:
-                               args.append(item)
+               if self.object:
+                       args += self.object.make_rrd_defs()
 
-                       self.log.debug("  %s" % args[-1])
+               args += self.rrd_graph
+               args = self._add_vdefs(args)
 
                # Convert arguments to string
                args = [str(e) for e in args]
 
+               for arg in args:
+                       self.log.debug("  %s" % arg)
+
                with Environment(self.timezone, self.locale.lang):
                        graph = rrdtool.graphv("-", *args)
 
index 0cce990..731d5bf 100644 (file)
@@ -136,6 +136,9 @@ class ConntrackLayer3ProtocolsGraphTemplate(base.GraphTemplate):
                "ipv4"  : "#cccc33",
        }
 
+       def get_object(self, *args):
+               return self.plugin.get_object("layer3-protocols")
+
        @property
        def protocol_descriptions(self):
                _ = self.locale.translate
@@ -156,10 +159,9 @@ class ConntrackLayer3ProtocolsGraphTemplate(base.GraphTemplate):
                _ = self.locale.translate
                return _("Number of open connections")
 
-       def get_object_table(self):
-               return {
-                       "file" : self.plugin.get_object("layer3-protocols"),
-               }
+       @property
+       def rrd_defs(self):
+               return []
 
        @property
        def rrd_graph(self):
@@ -179,16 +181,11 @@ class ConntrackLayer3ProtocolsGraphTemplate(base.GraphTemplate):
                                "legend_cur"  : "%10s\: %%8.0lf" % _("Current"),
                        }
 
-                       args += [
-                               "DEF:%(proto)s=%%(file)s:%(proto)s:AVERAGE" % i,
+                       args += self.object.make_rrd_defs(proto) + [
                                "AREA:%(proto)s%(colour)s:%(description)-15s:STACK" % i,
-                               "VDEF:%(proto)s_cur=%(proto)s,LAST" % i,
                                "GPRINT:%(proto)s_cur:%(legend_cur)s" % i,
-                               "VDEF:%(proto)s_avg=%(proto)s,AVERAGE" % i,
                                "GPRINT:%(proto)s_avg:%(legend_avg)s" % i,
-                               "VDEF:%(proto)s_min=%(proto)s,MINIMUM" % i,
                                "GPRINT:%(proto)s_min:%(legend_min)s" % i,
-                               "VDEF:%(proto)s_max=%(proto)s,MAXIMUM" % i,
                                "GPRINT:%(proto)s_max:%(legend_max)s\\n" % i,
                        ]
 
@@ -239,6 +236,9 @@ class ConntrackLayer4ProtocolsGraphTemplate(ConntrackLayer3ProtocolsGraphTemplat
                "dccp"    : 7,
        }
 
+       def get_object(self, *args):
+               return self.plugin.get_object("layer4-protocols")
+
        @property
        def graph_title(self):
                _ = self.locale.translate
@@ -249,12 +249,6 @@ class ConntrackLayer4ProtocolsGraphTemplate(ConntrackLayer3ProtocolsGraphTemplat
                return sorted(ConntrackTable._layer4_protocols,
                        key=lambda x: self.protocol_sortorder.get(x, 99))
 
-       def get_object_table(self):
-               return {
-                       "file" : self.plugin.get_object("layer4-protocols"),
-               }
-
-
 
 class ConntrackProtocolWithStatesGraphTemplate(base.GraphTemplate):
        name = "conntrack-protocol-states"
@@ -378,16 +372,11 @@ class ConntrackProtocolWithStatesGraphTemplate(base.GraphTemplate):
                                "legend_cur"  : "%10s\: %%8.0lf" % _("Current"),
                        }
 
-                       args += [
-                               "DEF:%(state)s=%%(file)s:%(state)s:AVERAGE" % i,
+                       args += self.object.make_rrd_defs(state) + [
                                "AREA:%(state)s%(colour)s:%(description)-15s:STACK" % i,
-                               "VDEF:%(state)s_cur=%(state)s,LAST" % i,
                                "GPRINT:%(state)s_cur:%(legend_cur)s" % i,
-                               "VDEF:%(state)s_avg=%(state)s,AVERAGE" % i,
                                "GPRINT:%(state)s_avg:%(legend_avg)s" % i,
-                               "VDEF:%(state)s_min=%(state)s,MINIMUM" % i,
                                "GPRINT:%(state)s_min:%(legend_min)s" % i,
-                               "VDEF:%(state)s_max=%(state)s,MAXIMUM" % i,
                                "GPRINT:%(state)s_max:%(legend_max)s\\n" % i,
                        ]
 
index f9194a0..18fa4d8 100644 (file)
@@ -33,15 +33,10 @@ class GraphTemplateContextSwitches(base.GraphTemplate):
                _ = self.locale.translate
 
                return [
-                       "DEF:ctxt=%(file)s:ctxt:AVERAGE",
-
                        "AREA:ctxt#90EE90:%-15s" % _("Context Switches"),
-                       "VDEF:ctxtmax=ctxt,MAXIMUM",
-                       "VDEF:ctxtmin=ctxt,MINIMUM",
-                       "VDEF:ctxtavg=ctxt,AVERAGE",
-                       "GPRINT:ctxtmax:%12s\:" % _("Maximum") + " %6.2lf" ,
-                       "GPRINT:ctxtmin:%12s\:" % _("Minimum") + " %6.2lf" ,
-                       "GPRINT:ctxtavg:%12s\:" % _("Average") + " %6.2lf\\n",
+                       "GPRINT:ctxt_max:%12s\:" % _("Maximum") + " %6.2lf" ,
+                       "GPRINT:ctxt_min:%12s\:" % _("Minimum") + " %6.2lf" ,
+                       "GPRINT:ctxt_avg:%12s\:" % _("Average") + " %6.2lf\\n",
                ]
 
        lower_limit = 0
index aeac588..f376c57 100644 (file)
@@ -37,16 +37,6 @@ class GraphTemplateDiskUsage(base.GraphTemplate):
                _ = self.locale.translate
 
                return [
-                       "DEF:used=%(file)s:used:AVERAGE",
-                       "VDEF:used_cur=used,LAST",
-                       "VDEF:used_min=used,MINIMUM",
-                       "VDEF:used_max=used,MAXIMUM",
-
-                       "DEF:free=%(file)s:free:AVERAGE",
-                       "VDEF:free_cur=free,LAST",
-                       "VDEF:free_min=free,MINIMUM",
-                       "VDEF:free_max=free,MAXIMUM",
-
                        # Calculate the percentage of the currently used
                        # space since this is helps the user very much to
                        # judge
@@ -94,41 +84,29 @@ class GraphTemplateInodeUsage(base.GraphTemplate):
                _ = self.locale.translate
 
                rrd_graph = [
-                       "DEF:used=%(file)s:inodes_used:AVERAGE",
-                       "VDEF:used_cur=used,LAST",
-                       "VDEF:used_min=used,MINIMUM",
-                       "VDEF:used_max=used,MAXIMUM",
-
-                       "DEF:free=%(file)s:inodes_free:AVERAGE",
-                       "VDEF:free_cur=free,LAST",
-                       "VDEF:free_min=free,MINIMUM",
-                       "VDEF:free_max=free,MAXIMUM",
-
                        # Calculate the percentage of the currently used
                        # inodes since this is helps the user very much to
                        # judge
-                       "CDEF:percentage_used=100,used,*,used,free,+,/",
-                       "VDEF:percentage_used_now=percentage_used,LAST",
+                       "CDEF:percentage_used=100,inodes_used,*,inodes_used,inodes_free,+,/",
                        "CDEF:percentage_left=100,percentage_used,-",
-                       "VDEF:percentage_left_now=percentage_left,LAST",
 
                        # Area for the used inodes
-                       "AREA:used%s:%s" % (util.lighten(LIGHT_RED, .66), _("Used")),
+                       "AREA:inodes_used%s:%s" % (util.lighten(LIGHT_RED, .66), _("Used")),
                        "GPRINT:percentage_used_now: (%6.2lf%%)",
-                       "GPRINT:used_cur:%12s\:" % _("Current") + " %9.2lf%s",
-                       "GPRINT:used_min:%12s\:" % _("Minimum") + " %9.2lf%s",
-                       "GPRINT:used_max:%12s\:" % _("Maximum") + " %9.2lf%s\\n",
+                       "GPRINT:inodes_used_cur:%12s\:" % _("Current") + " %9.2lf%s",
+                       "GPRINT:inodes_used_min:%12s\:" % _("Minimum") + " %9.2lf%s",
+                       "GPRINT:inodes_used_max:%12s\:" % _("Maximum") + " %9.2lf%s\\n",
 
                        # Stacked area of unused inodes
-                       "AREA:free%s:%s:STACK" % (util.lighten(LIGHT_GREEN, .66), _("Free")),
+                       "AREA:inodes_free%s:%s:STACK" % (util.lighten(LIGHT_GREEN, .66), _("Free")),
                        "GPRINT:percentage_left_now: (%6.2lf%%)",
-                       "GPRINT:free_cur:%12s\:" % _("Current") + " %9.2lf%s",
-                       "GPRINT:free_min:%12s\:" % _("Minimum") + " %9.2lf%s",
-                       "GPRINT:free_max:%12s\:" % _("Maximum") + " %9.2lf%s\\n",
+                       "GPRINT:inodes_free_cur:%12s\:" % _("Current") + " %9.2lf%s",
+                       "GPRINT:inodes_free_min:%12s\:" % _("Minimum") + " %9.2lf%s",
+                       "GPRINT:inodes_free_max:%12s\:" % _("Maximum") + " %9.2lf%s\\n",
 
                        # Add contour lines for the areas
-                       "LINE:used%s" % LIGHT_RED,
-                       "LINE:free%s::STACK" % LIGHT_GREEN,
+                       "LINE:inodes_used%s" % LIGHT_RED,
+                       "LINE:inodes_free%s::STACK" % LIGHT_GREEN,
                ]
 
                return rrd_graph
index 508e7e4..3c220bf 100644 (file)
@@ -35,12 +35,7 @@ class GraphTemplateDiskBadSectors(base.GraphTemplate):
                _ = self.locale.translate
 
                return [
-                       "DEF:bad_sectors=%(file)s:bad_sectors:AVERAGE",
-
                        "AREA:bad_sectors#ff0000:%s" % _("Bad Sectors"),
-
-                       "VDEF:bad_sectors_cur=bad_sectors,LAST",
-                       "VDEF:bad_sectors_max=bad_sectors,MAXIMUM",
                        "GPRINT:bad_sectors_cur:%12s\:" % _("Current") + " %9.2lf",
                        "GPRINT:bad_sectors_max:%12s\:" % _("Maximum") + " %9.2lf\\n",
                ]
@@ -64,31 +59,20 @@ class GraphTemplateDiskBytes(base.GraphTemplate):
                _ = self.locale.translate
 
                rrd_graph = [
-                       "DEF:read_sectors=%(file)s:read_sectors:AVERAGE",
-                       "DEF:write_sectors=%(file)s:write_sectors:AVERAGE",
-
                        "CDEF:read_bytes=read_sectors,512,*",
                        "CDEF:write_bytes=write_sectors,512,*",
 
                        "LINE1:read_bytes#ff0000:%-15s" % _("Read"),
-                       "VDEF:read_cur=read_bytes,LAST",
-                       "VDEF:read_min=read_bytes,MINIMUM",
-                       "VDEF:read_max=read_bytes,MAXIMUM",
-                       "VDEF:read_avg=read_bytes,AVERAGE",
-                       "GPRINT:read_cur:%12s\:" % _("Current") + " %9.2lf",
-                       "GPRINT:read_max:%12s\:" % _("Maximum") + " %9.2lf",
-                       "GPRINT:read_min:%12s\:" % _("Minimum") + " %9.2lf",
-                       "GPRINT:read_avg:%12s\:" % _("Average") + " %9.2lf\\n",
+                       "GPRINT:read_bytes_cur:%12s\:" % _("Current") + " %9.2lf",
+                       "GPRINT:read_bytes_max:%12s\:" % _("Maximum") + " %9.2lf",
+                       "GPRINT:read_bytes_min:%12s\:" % _("Minimum") + " %9.2lf",
+                       "GPRINT:read_bytes_avg:%12s\:" % _("Average") + " %9.2lf\\n",
 
                        "LINE1:write_bytes#00ff00:%-15s" % _("Written"),
-                       "VDEF:write_cur=write_bytes,LAST",
-                       "VDEF:write_min=write_bytes,MINIMUM",
-                       "VDEF:write_max=write_bytes,MAXIMUM",
-                       "VDEF:write_avg=write_bytes,AVERAGE",
-                       "GPRINT:write_cur:%12s\:" % _("Current") + " %9.2lf",
-                       "GPRINT:write_max:%12s\:" % _("Maximum") + " %9.2lf",
-                       "GPRINT:write_min:%12s\:" % _("Minimum") + " %9.2lf",
-                       "GPRINT:write_avg:%12s\:" % _("Average") + " %9.2lf\\n",
+                       "GPRINT:write_bytes_cur:%12s\:" % _("Current") + " %9.2lf",
+                       "GPRINT:write_bytes_max:%12s\:" % _("Maximum") + " %9.2lf",
+                       "GPRINT:write_bytes_min:%12s\:" % _("Minimum") + " %9.2lf",
+                       "GPRINT:write_bytes_avg:%12s\:" % _("Average") + " %9.2lf\\n",
                ]
 
                return rrd_graph
@@ -114,28 +98,17 @@ class GraphTemplateDiskIoOps(base.GraphTemplate):
                _ = self.locale.translate
 
                rrd_graph = [
-                       "DEF:read_ios=%(file)s:read_ios:AVERAGE",
-                       "DEF:write_ios=%(file)s:write_ios:AVERAGE",
-
                        "LINE1:read_ios#ff0000:%-15s" % _("Read"),
-                       "VDEF:read_cur=read_ios,LAST",
-                       "VDEF:read_min=read_ios,MINIMUM",
-                       "VDEF:read_max=read_ios,MAXIMUM",
-                       "VDEF:read_avg=read_ios,AVERAGE",
-                       "GPRINT:read_cur:%12s\:" % _("Current") + " %6.2lf",
-                       "GPRINT:read_max:%12s\:" % _("Maximum") + " %6.2lf",
-                       "GPRINT:read_min:%12s\:" % _("Minimum") + " %6.2lf",
-                       "GPRINT:read_avg:%12s\:" % _("Average") + " %6.2lf\\n",
+                       "GPRINT:read_ios_cur:%12s\:" % _("Current") + " %6.2lf",
+                       "GPRINT:read_ios_max:%12s\:" % _("Maximum") + " %6.2lf",
+                       "GPRINT:read_ios_min:%12s\:" % _("Minimum") + " %6.2lf",
+                       "GPRINT:read_ios_avg:%12s\:" % _("Average") + " %6.2lf\\n",
 
                        "LINE1:write_ios#00ff00:%-15s" % _("Written"),
-                       "VDEF:write_cur=write_ios,LAST",
-                       "VDEF:write_min=write_ios,MINIMUM",
-                       "VDEF:write_max=write_ios,MAXIMUM",
-                       "VDEF:write_avg=write_ios,AVERAGE",
-                       "GPRINT:write_cur:%12s\:" % _("Current") + " %6.2lf",
-                       "GPRINT:write_max:%12s\:" % _("Maximum") + " %6.2lf",
-                       "GPRINT:write_min:%12s\:" % _("Minimum") + " %6.2lf",
-                       "GPRINT:write_avg:%12s\:" % _("Average") + " %6.2lf\\n",
+                       "GPRINT:write_ios_cur:%12s\:" % _("Current") + " %6.2lf",
+                       "GPRINT:write_ios_max:%12s\:" % _("Maximum") + " %6.2lf",
+                       "GPRINT:write_ios_min:%12s\:" % _("Minimum") + " %6.2lf",
+                       "GPRINT:write_ios_avg:%12s\:" % _("Average") + " %6.2lf\\n",
                ]
 
                return rrd_graph
@@ -161,14 +134,13 @@ class GraphTemplateDiskTemperature(base.GraphTemplate):
                _ = self.locale.translate
 
                rrd_graph = [
-                       "DEF:kelvin=%(file)s:temperature:AVERAGE",
-                       "CDEF:celsius=kelvin,273.15,-",
-
-                       "LINE2:celsius#ff0000:%s" % _("Temperature"),
+                       "CDEF:celsius=temperature,273.15,-",
                        "VDEF:temp_cur=celsius,LAST",
                        "VDEF:temp_min=celsius,MINIMUM",
                        "VDEF:temp_max=celsius,MAXIMUM",
                        "VDEF:temp_avg=celsius,AVERAGE",
+
+                       "LINE2:celsius#ff0000:%s" % _("Temperature"),
                        "GPRINT:temp_cur:%12s\:" % _("Current") + " %3.2lf",
                        "GPRINT:temp_max:%12s\:" % _("Maximum") + " %3.2lf",
                        "GPRINT:temp_min:%12s\:" % _("Minimum") + " %3.2lf",
index 0fae415..3c7e6c5 100644 (file)
@@ -35,15 +35,10 @@ class GraphTemplateEntropy(base.GraphTemplate):
                _ = self.locale.translate
 
                return [
-                       "DEF:entropy=%(file)s:entropy:AVERAGE",
-
                        "LINE3:entropy#ff0000:%-15s" % _("Available entropy"),
-                       "VDEF:entrmin=entropy,MINIMUM",
-                       "VDEF:entrmax=entropy,MAXIMUM",
-                       "VDEF:entravg=entropy,AVERAGE",
-                       "GPRINT:entrmax:%12s\:" % _("Maximum") + " %5.0lf",
-                       "GPRINT:entrmin:%12s\:" % _("Minimum") + " %5.0lf",
-                       "GPRINT:entravg:%12s\:" % _("Average") + " %5.0lf\\n",
+                       "GPRINT:entropy_max:%12s\:" % _("Maximum") + " %5.0lf",
+                       "GPRINT:entropy_min:%12s\:" % _("Minimum") + " %5.0lf",
+                       "GPRINT:entropy_avg:%12s\:" % _("Average") + " %5.0lf\\n",
                ]
 
        lower_limit = 0
index f0dcef5..8cdb221 100644 (file)
@@ -45,9 +45,6 @@ class GraphTemplateInterfaceBits(GraphTemplateInterfaceBase):
                _ = self.locale.translate
 
                return [
-                       "DEF:bytes_rx=%(file)s:bytes_rx:AVERAGE",
-                       "DEF:bytes_tx=%(file)s:bytes_tx:AVERAGE",
-
                        # Convert everything into bits.
                        "CDEF:bits_rx=bytes_rx,8,*",
                        "CDEF:bits_tx=bytes_tx,8,*",
@@ -58,18 +55,12 @@ class GraphTemplateInterfaceBits(GraphTemplateInterfaceBase):
 
                        # Draw the received area.
                        "AREA:bits_rx#%s:%-15s" % (COLOUR_RX_AREA, _("Received")),
-                       "VDEF:bits_rx_min=bits_rx,MINIMUM",
-                       "VDEF:bits_rx_max=bits_rx,MAXIMUM",
-                       "VDEF:bits_rx_avg=bits_rx,AVERAGE",
                        "GPRINT:bits_rx_max:%12s\: " % _("Maximum") + _("%8.2lf %sbps"),
                        "GPRINT:bits_rx_min:%12s\: " % _("Minimum") + _("%8.2lf %sbps"),
                        "GPRINT:bits_rx_avg:%12s\: " % _("Average") + _("%8.2lf %sbps") + "\\n",
 
                        # Draw the transmitted area.
                        "AREA:bits_tx#%s:%-15s" % (COLOUR_TX_AREA, _("Transmitted")),
-                       "VDEF:bits_tx_min=bits_tx,MINIMUM",
-                       "VDEF:bits_tx_max=bits_tx,MAXIMUM",
-                       "VDEF:bits_tx_avg=bits_tx,AVERAGE",
                        "GPRINT:bits_tx_max:%12s\: " % _("Maximum") + _("%8.2lf %sbps"),
                        "GPRINT:bits_tx_min:%12s\: " % _("Minimum") + _("%8.2lf %sbps"),
                        "GPRINT:bits_tx_avg:%12s\: " % _("Average") + _("%8.2lf %sbps") + "\\n",
@@ -105,23 +96,14 @@ class GraphTemplateInterfacePackets(GraphTemplateInterfaceBase):
                _ = self.locale.translate
 
                return [
-                       "DEF:packets_rx=%(file)s:packets_rx:AVERAGE",
-                       "DEF:packets_tx=%(file)s:packets_tx:AVERAGE",
-
                        # Draw the received area.
                        "AREA:packets_rx#%s:%-15s" % (COLOUR_RX_AREA, _("Received")),
-                       "VDEF:packets_rx_min=packets_rx,MINIMUM",
-                       "VDEF:packets_rx_max=packets_rx,MAXIMUM",
-                       "VDEF:packets_rx_avg=packets_rx,AVERAGE",
                        "GPRINT:packets_rx_max:%12s\: " % _("Maximum") + _("%8.0lf %spps"),
                        "GPRINT:packets_rx_min:%12s\: " % _("Minimum") + _("%8.0lf %spps"),
                        "GPRINT:packets_rx_avg:%12s\: " % _("Average") + _("%8.2lf %spps") + "\\n",
 
                        # Draw the transmitted area.
                        "AREA:packets_tx#%s:%-15s" % (COLOUR_TX_AREA, _("Transmitted")),
-                       "VDEF:packets_tx_min=packets_tx,MINIMUM",
-                       "VDEF:packets_tx_max=packets_tx,MAXIMUM",
-                       "VDEF:packets_tx_avg=packets_tx,AVERAGE",
                        "GPRINT:packets_tx_max:%12s\: " % _("Maximum") + _("%8.0lf %spps"),
                        "GPRINT:packets_tx_min:%12s\: " % _("Minimum") + _("%8.0lf %spps"),
                        "GPRINT:packets_tx_avg:%12s\: " % _("Average") + _("%8.2lf %spps") + "\\n",
@@ -150,21 +132,12 @@ class GraphTemplateInterfaceErrors(GraphTemplateInterfaceBase):
                _ = self.locale.translate
 
                return [
-                       "DEF:errors_rx=%(file)s:errors_rx:AVERAGE",
-                       "DEF:errors_tx=%(file)s:errors_tx:AVERAGE",
-                       "DEF:dropped_rx=%(file)s:dropped_rx:AVERAGE",
-                       "DEF:dropped_tx=%(file)s:dropped_tx:AVERAGE",
-                       "DEF:collisions=%(file)s:collisions:AVERAGE",
-
                        # Invert the transmitted packets to create upside down graph.
                        "CDEF:errors_tx_inv=errors_tx,-1,*",
                        "CDEF:dropped_tx_inv=dropped_tx,-1,*",
 
                        # Draw the receive errors.
                        "AREA:errors_rx#228B2277:%-15s" % _("Receive errors"),
-                       "VDEF:errors_rx_min=errors_rx,MINIMUM",
-                       "VDEF:errors_rx_max=errors_rx,MAXIMUM",
-                       "VDEF:errors_rx_avg=errors_rx,AVERAGE",
                        "GPRINT:errors_rx_max:%12s\: " % _("Maximum") + _("%8.0lf %spps"),
                        "GPRINT:errors_rx_min:%12s\: " % _("Minimum") + _("%8.0lf %spps"),
                        "GPRINT:errors_rx_avg:%12s\: " % _("Average") + _("%8.2lf %spps") + "\\n",
@@ -172,9 +145,6 @@ class GraphTemplateInterfaceErrors(GraphTemplateInterfaceBase):
 
                        # Draw the transmit errors.
                        "AREA:errors_tx_inv#B2222277:%-15s" % _("Transmit errors"),
-                       "VDEF:errors_tx_min=errors_tx,MINIMUM",
-                       "VDEF:errors_tx_max=errors_tx,MAXIMUM",
-                       "VDEF:errors_tx_avg=errors_tx,AVERAGE",
                        "GPRINT:errors_tx_max:%12s\: " % _("Maximum") + _("%8.0lf %spps"),
                        "GPRINT:errors_tx_min:%12s\: " % _("Minimum") + _("%8.0lf %spps"),
                        "GPRINT:errors_tx_avg:%12s\: " % _("Average") + _("%8.2lf %spps") + "\\n",
@@ -182,9 +152,6 @@ class GraphTemplateInterfaceErrors(GraphTemplateInterfaceBase):
 
                        # Draw the receive drops.
                        "LINE2:dropped_rx#228B22:%-15s" % _("Receive drops"),
-                       "VDEF:dropped_rx_min=dropped_rx,MINIMUM",
-                       "VDEF:dropped_rx_max=dropped_rx,MAXIMUM",
-                       "VDEF:dropped_rx_avg=dropped_rx,AVERAGE",
                        "GPRINT:dropped_rx_max:%12s\: " % _("Maximum") + _("%8.0lf %spps"),
                        "GPRINT:dropped_rx_min:%12s\: " % _("Minimum") + _("%8.0lf %spps"),
                        "GPRINT:dropped_rx_avg:%12s\: " % _("Average") + _("%8.2lf %spps") + "\\n",
@@ -192,9 +159,6 @@ class GraphTemplateInterfaceErrors(GraphTemplateInterfaceBase):
 
                        # Draw the transmit drops.
                        "LINE2:dropped_tx#B22222:%-15s" % _("Transmit drops"),
-                       "VDEF:dropped_tx_min=dropped_tx,MINIMUM",
-                       "VDEF:dropped_tx_max=dropped_tx,MAXIMUM",
-                       "VDEF:dropped_tx_avg=dropped_tx,AVERAGE",
                        "GPRINT:dropped_tx_max:%12s\: " % _("Maximum") + _("%8.0lf %spps"),
                        "GPRINT:dropped_tx_min:%12s\: " % _("Minimum") + _("%8.0lf %spps"),
                        "GPRINT:dropped_tx_avg:%12s\: " % _("Average") + _("%8.2lf %spps") + "\\n",
index 20ff038..c43a9bc 100644 (file)
@@ -33,15 +33,10 @@ class GraphTemplateSystemInterrupts(base.GraphTemplate):
                _ = self.locale.translate
 
                return [
-                       "DEF:intr=%(file)s:intr:AVERAGE",
-
                        "AREA:intr#90EE90:%-15s" % _("System Interrupts"),
-                       "VDEF:intrmax=intr,MAXIMUM",
-                       "VDEF:intrmin=intr,MINIMUM",
-                       "VDEF:intravg=intr,AVERAGE",
-                       "GPRINT:intrmax:%12s\:" % _("Maximum") + " %6.2lf" ,
-                       "GPRINT:intrmin:%12s\:" % _("Minimum") + " %6.2lf" ,
-                       "GPRINT:intravg:%12s\:" % _("Average") + " %6.2lf\\n",
+                       "GPRINT:intr_max:%12s\:" % _("Maximum") + " %6.2lf" ,
+                       "GPRINT:intr_min:%12s\:" % _("Minimum") + " %6.2lf" ,
+                       "GPRINT:intr_avg:%12s\:" % _("Average") + " %6.2lf\\n",
                ]
 
        lower_limit = 0
index 767276a..23c2ef8 100644 (file)
@@ -35,74 +35,43 @@ class GraphTemplateIPv6Fragmentation(base.GraphTemplate):
                _ = self.locale.translate
 
                return [
-                       "DEF:frags_oks=%(file)s:ip6_frags_oks:AVERAGE",
-                       "DEF:frags_fails=%(file)s:ip6_frags_fails:AVERAGE",
-                       "DEF:reasm_timeout=%(file)s:ip6_reasm_timeout:AVERAGE",
-                       "DEF:reasm_oks=%(file)s:ip6_reasm_oks:AVERAGE",
-                       "DEF:reasm_fails=%(file)s:ip6_reasm_fails:AVERAGE",
-
-                       "CDEF:reasm_real_fails=reasm_fails,reasm_timeout,-",
-
-                       "VDEF:frags_oks_cur=frags_oks,LAST",
-                       "VDEF:frags_oks_avg=frags_oks,AVERAGE",
-                       "VDEF:frags_oks_max=frags_oks,MAXIMUM",
-                       "VDEF:frags_oks_min=frags_oks,MINIMUM",
-
-                       "VDEF:frags_fails_cur=frags_fails,LAST",
-                       "VDEF:frags_fails_avg=frags_fails,AVERAGE",
-                       "VDEF:frags_fails_max=frags_fails,MAXIMUM",
-                       "VDEF:frags_fails_min=frags_fails,MINIMUM",
-
-                       "VDEF:reasm_oks_cur=reasm_oks,LAST",
-                       "VDEF:reasm_oks_avg=reasm_oks,AVERAGE",
-                       "VDEF:reasm_oks_max=reasm_oks,MAXIMUM",
-                       "VDEF:reasm_oks_min=reasm_oks,MINIMUM",
-
-                       "VDEF:reasm_fails_cur=reasm_real_fails,LAST",
-                       "VDEF:reasm_fails_avg=reasm_real_fails,AVERAGE",
-                       "VDEF:reasm_fails_max=reasm_real_fails,MAXIMUM",
-                       "VDEF:reasm_fails_min=reasm_real_fails,MINIMUM",
-
-                       "VDEF:reasm_timeout_cur=reasm_timeout,LAST",
-                       "VDEF:reasm_timeout_avg=reasm_timeout,AVERAGE",
-                       "VDEF:reasm_timeout_max=reasm_timeout,MAXIMUM",
-                       "VDEF:reasm_timeout_min=reasm_timeout,MINIMUM",
+                       "CDEF:ip6_reasm_real_fails=ip6_reasm_fails,ip6_reasm_timeout,-",
 
                        # Reassembly
-                       "AREA:reasm_real_fails%s:%-24s" % \
+                       "AREA:ip6_reasm_real_fails%s:%-24s" % \
                                (util.lighten(COLOUR_ERROR), _("Failed Reassemblies")),
-                       "GPRINT:reasm_fails_cur:%s %%5.0lf%%s" % _("Now"),
-                       "GPRINT:reasm_fails_avg:%s %%5.0lf%%s" % _("Avg"),
-                       "GPRINT:reasm_fails_max:%s %%5.0lf%%s" % _("Max"),
-                       "GPRINT:reasm_fails_min:%s %%5.0lf%%s\\j" % _("Min"),
+                       "GPRINT:ip6_reasm_fails_cur:%s %%5.0lf%%s" % _("Now"),
+                       "GPRINT:ip6_reasm_fails_avg:%s %%5.0lf%%s" % _("Avg"),
+                       "GPRINT:ip6_reasm_fails_max:%s %%5.0lf%%s" % _("Max"),
+                       "GPRINT:ip6_reasm_fails_min:%s %%5.0lf%%s\\j" % _("Min"),
 
-                       "AREA:reasm_timeout%s:%-24s:STACK" % \
+                       "AREA:ip6_reasm_timeout%s:%-24s:STACK" % \
                                (util.lighten(COLOUR_WARN), _("Reassembly Timeouts")),
-                       "GPRINT:reasm_timeout_cur:%s %%5.0lf%%s" % _("Now"),
-                       "GPRINT:reasm_timeout_avg:%s %%5.0lf%%s" % _("Avg"),
-                       "GPRINT:reasm_timeout_max:%s %%5.0lf%%s" % _("Max"),
-                       "GPRINT:reasm_timeout_min:%s %%5.0lf%%s\\j" % _("Min"),
+                       "GPRINT:ip6_reasm_timeout_cur:%s %%5.0lf%%s" % _("Now"),
+                       "GPRINT:ip6_reasm_timeout_avg:%s %%5.0lf%%s" % _("Avg"),
+                       "GPRINT:ip6_reasm_timeout_max:%s %%5.0lf%%s" % _("Max"),
+                       "GPRINT:ip6_reasm_timeout_min:%s %%5.0lf%%s\\j" % _("Min"),
 
-                       "LINE2:reasm_oks%s:%-24s" % (BLACK, _("Successful Reassemblies")),
-                       "GPRINT:reasm_oks_cur:%s %%5.0lf%%s" % _("Now"),
-                       "GPRINT:reasm_oks_avg:%s %%5.0lf%%s" % _("Avg"),
-                       "GPRINT:reasm_oks_max:%s %%5.0lf%%s" % _("Max"),
-                       "GPRINT:reasm_oks_min:%s %%5.0lf%%s\\j" % _("Min"),
+                       "LINE2:ip6_reasm_oks%s:%-24s" % (BLACK, _("Successful Reassemblies")),
+                       "GPRINT:ip6_reasm_oks_cur:%s %%5.0lf%%s" % _("Now"),
+                       "GPRINT:ip6_reasm_oks_avg:%s %%5.0lf%%s" % _("Avg"),
+                       "GPRINT:ip6_reasm_oks_max:%s %%5.0lf%%s" % _("Max"),
+                       "GPRINT:ip6_reasm_oks_min:%s %%5.0lf%%s\\j" % _("Min"),
 
                        "COMMENT: \\n", # empty line
 
                        # Fragmentation
-                       "LINE2:frags_fails%s:%-24s" % (COLOUR_ERROR, _("Failed Fragmentations")),
-                       "GPRINT:frags_fails_cur:%s %%5.0lf%%s" % _("Now"),
-                       "GPRINT:frags_fails_avg:%s %%5.0lf%%s" % _("Avg"),
-                       "GPRINT:frags_fails_max:%s %%5.0lf%%s" % _("Max"),
-                       "GPRINT:frags_fails_min:%s %%5.0lf%%s\\j" % _("Min"),
-
-                       "LINE2:frags_oks%s:%-24s" % (COLOUR_OK, _("Fragmented Packets")),
-                       "GPRINT:frags_oks_cur:%s %%5.0lf%%s" % _("Now"),
-                       "GPRINT:frags_oks_avg:%s %%5.0lf%%s" % _("Avg"),
-                       "GPRINT:frags_oks_max:%s %%5.0lf%%s" % _("Max"),
-                       "GPRINT:frags_oks_min:%s %%5.0lf%%s\\j" % _("Min"),
+                       "LINE2:ip6_frags_fails%s:%-24s" % (COLOUR_ERROR, _("Failed Fragmentations")),
+                       "GPRINT:ip6_frags_fails_cur:%s %%5.0lf%%s" % _("Now"),
+                       "GPRINT:ip6_frags_fails_avg:%s %%5.0lf%%s" % _("Avg"),
+                       "GPRINT:ip6_frags_fails_max:%s %%5.0lf%%s" % _("Max"),
+                       "GPRINT:ip6_frags_fails_min:%s %%5.0lf%%s\\j" % _("Min"),
+
+                       "LINE2:ip6_frags_oks%s:%-24s" % (COLOUR_OK, _("Fragmented Packets")),
+                       "GPRINT:ip6_frags_oks_cur:%s %%5.0lf%%s" % _("Now"),
+                       "GPRINT:ip6_frags_oks_avg:%s %%5.0lf%%s" % _("Avg"),
+                       "GPRINT:ip6_frags_oks_max:%s %%5.0lf%%s" % _("Max"),
+                       "GPRINT:ip6_frags_oks_min:%s %%5.0lf%%s\\j" % _("Min"),
                ]
 
        @property
@@ -135,74 +104,43 @@ class GraphTemplateIPv4Fragmentation(base.GraphTemplate):
                _ = self.locale.translate
 
                return [
-                       "DEF:frags_oks=%(file)s:ip4_frags_oks:AVERAGE",
-                       "DEF:frags_fails=%(file)s:ip4_frags_fails:AVERAGE",
-                       "DEF:reasm_timeout=%(file)s:ip4_reasm_timeout:AVERAGE",
-                       "DEF:reasm_oks=%(file)s:ip4_reasm_oks:AVERAGE",
-                       "DEF:reasm_fails=%(file)s:ip4_reasm_fails:AVERAGE",
-
-                       "CDEF:reasm_real_fails=reasm_fails,reasm_timeout,-",
-
-                       "VDEF:frags_oks_cur=frags_oks,LAST",
-                       "VDEF:frags_oks_avg=frags_oks,AVERAGE",
-                       "VDEF:frags_oks_max=frags_oks,MAXIMUM",
-                       "VDEF:frags_oks_min=frags_oks,MINIMUM",
-
-                       "VDEF:frags_fails_cur=frags_fails,LAST",
-                       "VDEF:frags_fails_avg=frags_fails,AVERAGE",
-                       "VDEF:frags_fails_max=frags_fails,MAXIMUM",
-                       "VDEF:frags_fails_min=frags_fails,MINIMUM",
-
-                       "VDEF:reasm_oks_cur=reasm_oks,LAST",
-                       "VDEF:reasm_oks_avg=reasm_oks,AVERAGE",
-                       "VDEF:reasm_oks_max=reasm_oks,MAXIMUM",
-                       "VDEF:reasm_oks_min=reasm_oks,MINIMUM",
-
-                       "VDEF:reasm_fails_cur=reasm_real_fails,LAST",
-                       "VDEF:reasm_fails_avg=reasm_real_fails,AVERAGE",
-                       "VDEF:reasm_fails_max=reasm_real_fails,MAXIMUM",
-                       "VDEF:reasm_fails_min=reasm_real_fails,MINIMUM",
-
-                       "VDEF:reasm_timeout_cur=reasm_timeout,LAST",
-                       "VDEF:reasm_timeout_avg=reasm_timeout,AVERAGE",
-                       "VDEF:reasm_timeout_max=reasm_timeout,MAXIMUM",
-                       "VDEF:reasm_timeout_min=reasm_timeout,MINIMUM",
+                       "CDEF:ip4_reasm_real_fails=ip4_reasm_fails,ip4_reasm_timeout,-",
 
                        # Reassembly
-                       "AREA:reasm_real_fails%s:%-24s" % \
+                       "AREA:ip4_reasm_real_fails%s:%-24s" % \
                                (util.lighten(COLOUR_ERROR), _("Failed Reassemblies")),
-                       "GPRINT:reasm_fails_cur:%s %%5.0lf%%s" % _("Now"),
-                       "GPRINT:reasm_fails_avg:%s %%5.0lf%%s" % _("Avg"),
-                       "GPRINT:reasm_fails_max:%s %%5.0lf%%s" % _("Max"),
-                       "GPRINT:reasm_fails_min:%s %%5.0lf%%s\\j" % _("Min"),
+                       "GPRINT:ip4_reasm_fails_cur:%s %%5.0lf%%s" % _("Now"),
+                       "GPRINT:ip4_reasm_fails_avg:%s %%5.0lf%%s" % _("Avg"),
+                       "GPRINT:ip4_reasm_fails_max:%s %%5.0lf%%s" % _("Max"),
+                       "GPRINT:ip4_reasm_fails_min:%s %%5.0lf%%s\\j" % _("Min"),
 
-                       "AREA:reasm_timeout%s:%-24s:STACK" % \
+                       "AREA:ip4_reasm_timeout%s:%-24s:STACK" % \
                                (util.lighten(COLOUR_WARN), _("Reassembly Timeouts")),
-                       "GPRINT:reasm_timeout_cur:%s %%5.0lf%%s" % _("Now"),
-                       "GPRINT:reasm_timeout_avg:%s %%5.0lf%%s" % _("Avg"),
-                       "GPRINT:reasm_timeout_max:%s %%5.0lf%%s" % _("Max"),
-                       "GPRINT:reasm_timeout_min:%s %%5.0lf%%s\\j" % _("Min"),
+                       "GPRINT:ip4_reasm_timeout_cur:%s %%5.0lf%%s" % _("Now"),
+                       "GPRINT:ip4_reasm_timeout_avg:%s %%5.0lf%%s" % _("Avg"),
+                       "GPRINT:ip4_reasm_timeout_max:%s %%5.0lf%%s" % _("Max"),
+                       "GPRINT:ip4_reasm_timeout_min:%s %%5.0lf%%s\\j" % _("Min"),
 
-                       "LINE2:reasm_oks%s:%-24s" % (BLACK, _("Successful Reassemblies")),
-                       "GPRINT:reasm_oks_cur:%s %%5.0lf%%s" % _("Now"),
-                       "GPRINT:reasm_oks_avg:%s %%5.0lf%%s" % _("Avg"),
-                       "GPRINT:reasm_oks_max:%s %%5.0lf%%s" % _("Max"),
-                       "GPRINT:reasm_oks_min:%s %%5.0lf%%s\\j" % _("Min"),
+                       "LINE2:ip4_reasm_oks%s:%-24s" % (BLACK, _("Successful Reassemblies")),
+                       "GPRINT:ip4_reasm_oks_cur:%s %%5.0lf%%s" % _("Now"),
+                       "GPRINT:ip4_reasm_oks_avg:%s %%5.0lf%%s" % _("Avg"),
+                       "GPRINT:ip4_reasm_oks_max:%s %%5.0lf%%s" % _("Max"),
+                       "GPRINT:ip4_reasm_oks_min:%s %%5.0lf%%s\\j" % _("Min"),
 
                        "COMMENT: \\n", # empty line
 
                        # Fragmentation
-                       "LINE2:frags_fails%s:%-24s" % (COLOUR_ERROR, _("Failed Fragmentations")),
-                       "GPRINT:frags_fails_cur:%s %%5.0lf%%s" % _("Now"),
-                       "GPRINT:frags_fails_avg:%s %%5.0lf%%s" % _("Avg"),
-                       "GPRINT:frags_fails_max:%s %%5.0lf%%s" % _("Max"),
-                       "GPRINT:frags_fails_min:%s %%5.0lf%%s\\j" % _("Min"),
-
-                       "LINE2:frags_oks%s:%-24s" % (COLOUR_OK, _("Fragmented Packets")),
-                       "GPRINT:frags_oks_cur:%s %%5.0lf%%s" % _("Now"),
-                       "GPRINT:frags_oks_avg:%s %%5.0lf%%s" % _("Avg"),
-                       "GPRINT:frags_oks_max:%s %%5.0lf%%s" % _("Max"),
-                       "GPRINT:frags_oks_min:%s %%5.0lf%%s\\j" % _("Min"),
+                       "LINE2:ip4_frags_fails%s:%-24s" % (COLOUR_ERROR, _("Failed Fragmentations")),
+                       "GPRINT:ip4_frags_fails_cur:%s %%5.0lf%%s" % _("Now"),
+                       "GPRINT:ip4_frags_fails_avg:%s %%5.0lf%%s" % _("Avg"),
+                       "GPRINT:ip4_frags_fails_max:%s %%5.0lf%%s" % _("Max"),
+                       "GPRINT:ip4_frags_fails_min:%s %%5.0lf%%s\\j" % _("Min"),
+
+                       "LINE2:ip4_frags_oks%s:%-24s" % (COLOUR_OK, _("Fragmented Packets")),
+                       "GPRINT:ip4_frags_oks_cur:%s %%5.0lf%%s" % _("Now"),
+                       "GPRINT:ip4_frags_oks_avg:%s %%5.0lf%%s" % _("Avg"),
+                       "GPRINT:ip4_frags_oks_max:%s %%5.0lf%%s" % _("Max"),
+                       "GPRINT:ip4_frags_oks_min:%s %%5.0lf%%s\\j" % _("Min"),
                ]
 
        @property
index c6cc547..c7ffc9c 100644 (file)
@@ -40,14 +40,6 @@ class GraphTemplateLatency(base.GraphTemplate):
                _ = self.locale.translate
 
                return [
-                       "DEF:latency6=%(file)s:latency6:AVERAGE",
-                       "DEF:loss6=%(file)s:loss6:AVERAGE",
-                       "DEF:stddev6=%(file)s:stddev6:AVERAGE",
-
-                       "DEF:latency4=%(file)s:latency4:AVERAGE",
-                       "DEF:loss4=%(file)s:loss4:AVERAGE",
-                       "DEF:stddev4=%(file)s:stddev4:AVERAGE",
-
                        # Compute the biggest loss and convert into percentage
                        "CDEF:ploss=loss6,loss4,MAX,100,*",
 
@@ -63,15 +55,8 @@ class GraphTemplateLatency(base.GraphTemplate):
                        "CDEF:l050=ploss,25,50,LIMIT,UN,UNKN,INF,IF",
                        "CDEF:l099=ploss,50,99,LIMIT,UN,UNKN,INF,IF",
 
-                       "VDEF:latency6min=latency6,MINIMUM",
-                       "VDEF:latency6max=latency6,MAXIMUM",
-                       "VDEF:latency6avg=latency6,AVERAGE",
-                       "VDEF:latency4min=latency4,MINIMUM",
-                       "VDEF:latency4max=latency4,MAXIMUM",
-                       "VDEF:latency4avg=latency4,AVERAGE",
-
-                       "LINE1:latency6avg#00ff0066:%s" % _("Average latency (IPv6)"),
-                       "LINE1:latency4avg#ff000066:%s\\r" % _("Average latency (IPv4)"),
+                       "LINE1:latency6_avg#00ff0066:%s" % _("Average latency (IPv6)"),
+                       "LINE1:latency4_avg#ff000066:%s\\r" % _("Average latency (IPv4)"),
 
                        "COMMENT:%s" % _("Packet Loss"),
                        "AREA:l005#ffffff:%s" % _("0-5%%"),
@@ -85,16 +70,16 @@ class GraphTemplateLatency(base.GraphTemplate):
                        "AREA:spacer4",
                        "AREA:stddevarea4#ff000033:STACK",
                        "LINE2:latency4#ff0000:%s" % _("Latency (IPv4)"),
-                       "GPRINT:latency4max:%12s\:" % _("Maximum") + " %6.2lf",
-                       "GPRINT:latency4min:%12s\:" % _("Minimum") + " %6.2lf",
-                       "GPRINT:latency4avg:%12s\:" % _("Average") + " %6.2lf\\n",
+                       "GPRINT:latency4_max:%12s\:" % _("Maximum") + " %6.2lf",
+                       "GPRINT:latency4_min:%12s\:" % _("Minimum") + " %6.2lf",
+                       "GPRINT:latency4_avg:%12s\:" % _("Average") + " %6.2lf\\n",
 
                        "AREA:spacer6",
                        "AREA:stddevarea6#00ff0033:STACK",
                        "LINE2:latency6#00ff00:%s" % _("Latency (IPv6)"),
-                       "GPRINT:latency6max:%12s\:" % _("Maximum") + " %6.2lf",
-                       "GPRINT:latency6min:%12s\:" % _("Minimum") + " %6.2lf",
-                       "GPRINT:latency6avg:%12s\:" % _("Average") + " %6.2lf\\n",
+                       "GPRINT:latency6_max:%12s\:" % _("Maximum") + " %6.2lf",
+                       "GPRINT:latency6_min:%12s\:" % _("Minimum") + " %6.2lf",
+                       "GPRINT:latency6_avg:%12s\:" % _("Average") + " %6.2lf\\n",
                ]
 
        @property
index 4125c8e..8ac398a 100644 (file)
@@ -33,33 +33,20 @@ class GraphTemplateLoadAvg(base.GraphTemplate):
                _ = self.locale.translate
 
                return [
-                       "DEF:load1=%(file)s:load1:AVERAGE",
-                       "DEF:load5=%(file)s:load5:AVERAGE",
-                       "DEF:load15=%(file)s:load15:AVERAGE",
-
                        "AREA:load1#ff0000:%s" % _("Load average  1m"),
-                       "VDEF:load1min=load1,MINIMUM",
-                       "VDEF:load1max=load1,MAXIMUM",
-                       "VDEF:load1avg=load1,AVERAGE",
-                       "GPRINT:load1max:%12s\:" % _("Maximum") + " %6.2lf",
-                       "GPRINT:load1min:%12s\:" % _("Minimum") + " %6.2lf",
-                       "GPRINT:load1avg:%12s\:" % _("Average") + " %6.2lf\\n",
+                       "GPRINT:load1_max:%12s\:" % _("Maximum") + " %6.2lf",
+                       "GPRINT:load1_min:%12s\:" % _("Minimum") + " %6.2lf",
+                       "GPRINT:load1_avg:%12s\:" % _("Average") + " %6.2lf\\n",
 
                        "AREA:load5#ff9900:%s" % _("Load average  5m"),
-                       "VDEF:load5min=load5,MINIMUM",
-                       "VDEF:load5max=load5,MAXIMUM",
-                       "VDEF:load5avg=load5,AVERAGE",
-                       "GPRINT:load5max:%12s\:" % _("Maximum") + " %6.2lf",
-                       "GPRINT:load5min:%12s\:" % _("Minimum") + " %6.2lf",
-                       "GPRINT:load5avg:%12s\:" % _("Average") + " %6.2lf\\n",
+                       "GPRINT:load5_max:%12s\:" % _("Maximum") + " %6.2lf",
+                       "GPRINT:load5_min:%12s\:" % _("Minimum") + " %6.2lf",
+                       "GPRINT:load5_avg:%12s\:" % _("Average") + " %6.2lf\\n",
 
                        "AREA:load15#ffff00:%s" % _("Load average 15m"),
-                       "VDEF:load15min=load15,MINIMUM",
-                       "VDEF:load15max=load15,MAXIMUM",
-                       "VDEF:load15avg=load15,AVERAGE",
-                       "GPRINT:load15max:%12s\:" % _("Maximum") + " %6.2lf",
-                       "GPRINT:load15min:%12s\:" % _("Minimum") + " %6.2lf",
-                       "GPRINT:load15avg:%12s\:" % _("Average") + " %6.2lf\\n",
+                       "GPRINT:load15_max:%12s\:" % _("Maximum") + " %6.2lf",
+                       "GPRINT:load15_min:%12s\:" % _("Minimum") + " %6.2lf",
+                       "GPRINT:load15_avg:%12s\:" % _("Average") + " %6.2lf\\n",
 
                        "LINE:load5#dd8800",
                        "LINE:load1#dd0000",
index 4db09f1..6569a80 100644 (file)
@@ -34,51 +34,30 @@ class GraphTemplateMemory(base.GraphTemplate):
                _ = self.locale.translate
 
                return [
-                       "DEF:used=%(file)s:used:AVERAGE",
-                       "DEF:cached=%(file)s:cached:AVERAGE",
-                       "DEF:buffered=%(file)s:buffered:AVERAGE",
-                       "DEF:free=%(file)s:free:AVERAGE",
-                       "DEF:swap=%(file)s:swap:AVERAGE",
-
                        "AREA:used#90EE90:%-15s" % _("Used memory"),
-                       "VDEF:usedmin=used,MINIMUM",
-                       "VDEF:usedmax=used,MAXIMUM",
-                       "VDEF:usedavg=used,AVERAGE",
-                       "GPRINT:usedmax:%12s\:" % _("Maximum") + " %6.2lf" ,
-                       "GPRINT:usedmin:%12s\:" % _("Minimum") + " %6.2lf",
-                       "GPRINT:usedavg:%12s\:" % _("Average") + " %6.2lf\\n",
+                       "GPRINT:used_max:%12s\:" % _("Maximum") + " %6.2lf" ,
+                       "GPRINT:used_min:%12s\:" % _("Minimum") + " %6.2lf",
+                       "GPRINT:used_avg:%12s\:" % _("Average") + " %6.2lf\\n",
 
                        "STACK:buffered#4169E1:%-15s" % _("Buffered data"),
-                       "VDEF:bufferedmin=buffered,MINIMUM",
-                       "VDEF:bufferedmax=buffered,MAXIMUM",
-                       "VDEF:bufferedavg=buffered,AVERAGE",
-                       "GPRINT:bufferedmax:%12s\:" % _("Maximum") + " %6.2lf" ,
-                       "GPRINT:bufferedmin:%12s\:" % _("Minimum") + " %6.2lf",
-                       "GPRINT:bufferedavg:%12s\:" % _("Average") + " %6.2lf\\n",
+                       "GPRINT:buffered_max:%12s\:" % _("Maximum") + " %6.2lf" ,
+                       "GPRINT:buffered_min:%12s\:" % _("Minimum") + " %6.2lf",
+                       "GPRINT:buffered_avg:%12s\:" % _("Average") + " %6.2lf\\n",
 
                        "STACK:cached#FFD700:%-15s" % _("Cached data"),
-                       "VDEF:cachedmin=cached,MINIMUM",
-                       "VDEF:cachedmax=cached,MAXIMUM",
-                       "VDEF:cachedavg=cached,AVERAGE",
-                       "GPRINT:cachedmax:%12s\:" % _("Maximum") + " %6.2lf" ,
-                       "GPRINT:cachedmin:%12s\:" % _("Minimum") + " %6.2lf",
-                       "GPRINT:cachedavg:%12s\:" % _("Average") + " %6.2lf\\n",
+                       "GPRINT:cached_max:%12s\:" % _("Maximum") + " %6.2lf" ,
+                       "GPRINT:cached_min:%12s\:" % _("Minimum") + " %6.2lf",
+                       "GPRINT:cached_avg:%12s\:" % _("Average") + " %6.2lf\\n",
 
 #                      "STACK:free#7799ff:%-15s" % _("Free memory"),
-#                      "VDEF:freemin=free,MINIMUM",
-#                      "VDEF:freemax=free,MAXIMUM",
-#                      "VDEF:freeavg=free,AVERAGE",
-#                      "GPRINT:freemax:%12s\:" % _("Maximum") + " %6.2lf" ,
-#                      "GPRINT:freemin:%12s\:" % _("Minimum") + " %6.2lf",
-#                      "GPRINT:freeavg:%12s\:" % _("Average") + " %6.2lf\\n",
+#                      "GPRINT:free_max:%12s\:" % _("Maximum") + " %6.2lf" ,
+#                      "GPRINT:free_min:%12s\:" % _("Minimum") + " %6.2lf",
+#                      "GPRINT:free_avg:%12s\:" % _("Average") + " %6.2lf\\n",
 
                        "LINE3:swap#ff0000:%-15s" % _("Used Swap space"),
-                       "VDEF:swapmin=swap,MINIMUM",
-                       "VDEF:swapmax=swap,MAXIMUM",
-                       "VDEF:swapavg=swap,AVERAGE",
-                       "GPRINT:swapmax:%12s\:" % _("Maximum") + " %6.2lf" ,
-                       "GPRINT:swapmin:%12s\:" % _("Minimum") + " %6.2lf",
-                       "GPRINT:swapavg:%12s\:" % _("Average") + " %6.2lf\\n",
+                       "GPRINT:swap_max:%12s\:" % _("Maximum") + " %6.2lf" ,
+                       "GPRINT:swap_min:%12s\:" % _("Minimum") + " %6.2lf",
+                       "GPRINT:swap_avg:%12s\:" % _("Average") + " %6.2lf\\n",
                ]
 
        @property
index d22558e..8768df2 100644 (file)
@@ -33,69 +33,40 @@ class GraphTemplateProcessor(base.GraphTemplate):
                _ = self.locale.translate
 
                return [
-                       "DEF:user=%(file)s:user:AVERAGE",
-                       "DEF:nice=%(file)s:nice:AVERAGE",
-                       "DEF:sys=%(file)s:sys:AVERAGE",
-                       "DEF:idle=%(file)s:idle:AVERAGE",
-                       "DEF:wait=%(file)s:wait:AVERAGE",
-                       "DEF:irq=%(file)s:irq:AVERAGE",
-                       "DEF:sirq=%(file)s:sirq:AVERAGE",
-
                        "AREA:user#90EE90:%-15s" % _("User"),
-                       "VDEF:usermin=user,MINIMUM",
-                       "VDEF:usermax=user,MAXIMUM",
-                       "VDEF:useravg=user,AVERAGE",
-                       "GPRINT:usermax:%12s\:" % _("Maximum") + " %6.2lf" ,
-                       "GPRINT:usermin:%12s\:" % _("Minimum") + " %6.2lf",
-                       "GPRINT:useravg:%12s\:" % _("Average") + " %6.2lf\\n",
+                       "GPRINT:user_max:%12s\:" % _("Maximum") + " %6.2lf" ,
+                       "GPRINT:user_min:%12s\:" % _("Minimum") + " %6.2lf",
+                       "GPRINT:user_avg:%12s\:" % _("Average") + " %6.2lf\\n",
 
                        "STACK:nice#4169E1:%-15s" % _("Nice"),
-                       "VDEF:nicemin=nice,MINIMUM",
-                       "VDEF:nicemax=nice,MAXIMUM",
-                       "VDEF:niceavg=nice,AVERAGE",
-                       "GPRINT:nicemax:%12s\:" % _("Maximum") + " %6.2lf" ,
-                       "GPRINT:nicemin:%12s\:" % _("Minimum") + " %6.2lf",
-                       "GPRINT:niceavg:%12s\:" % _("Average") + " %6.2lf\\n",
+                       "GPRINT:nice_max:%12s\:" % _("Maximum") + " %6.2lf" ,
+                       "GPRINT:nice_min:%12s\:" % _("Minimum") + " %6.2lf",
+                       "GPRINT:nice_avg:%12s\:" % _("Average") + " %6.2lf\\n",
 
                        "STACK:sys#DC143C:%-15s" % _("System"),
-                       "VDEF:sysmin=sys,MINIMUM",
-                       "VDEF:sysmax=sys,MAXIMUM",
-                       "VDEF:sysavg=sys,AVERAGE",
-                       "GPRINT:sysmax:%12s\:" % _("Maximum") + " %6.2lf" ,
-                       "GPRINT:sysmin:%12s\:" % _("Minimum") + " %6.2lf",
-                       "GPRINT:sysavg:%12s\:" % _("Average") + " %6.2lf\\n",
+                       "GPRINT:sys_max:%12s\:" % _("Maximum") + " %6.2lf" ,
+                       "GPRINT:sys_min:%12s\:" % _("Minimum") + " %6.2lf",
+                       "GPRINT:sys_avg:%12s\:" % _("Average") + " %6.2lf\\n",
 
                        "STACK:wait#483D8B:%-15s" % _("Wait"),
-                       "VDEF:waitmin=wait,MINIMUM",
-                       "VDEF:waitmax=wait,MAXIMUM",
-                       "VDEF:waitavg=wait,AVERAGE",
-                       "GPRINT:waitmax:%12s\:" % _("Maximum") + " %6.2lf" ,
-                       "GPRINT:waitmin:%12s\:" % _("Minimum") + " %6.2lf",
-                       "GPRINT:waitavg:%12s\:" % _("Average") + " %6.2lf\\n",
+                       "GPRINT:wait_max:%12s\:" % _("Maximum") + " %6.2lf" ,
+                       "GPRINT:wait_min:%12s\:" % _("Minimum") + " %6.2lf",
+                       "GPRINT:wait_avg:%12s\:" % _("Average") + " %6.2lf\\n",
 
                        "STACK:irq#DAA520:%-15s" % _("Interrupt"),
-                       "VDEF:irqmin=irq,MINIMUM",
-                       "VDEF:irqmax=irq,MAXIMUM",
-                       "VDEF:irqavg=irq,AVERAGE",
-                       "GPRINT:irqmax:%12s\:" % _("Maximum") + " %6.2lf" ,
-                       "GPRINT:irqmin:%12s\:" % _("Minimum") + " %6.2lf",
-                       "GPRINT:irqavg:%12s\:" % _("Average") + " %6.2lf\\n",
+                       "GPRINT:irq_max:%12s\:" % _("Maximum") + " %6.2lf" ,
+                       "GPRINT:irq_min:%12s\:" % _("Minimum") + " %6.2lf",
+                       "GPRINT:irq_avg:%12s\:" % _("Average") + " %6.2lf\\n",
 
                        "STACK:sirq#FFD700:%-15s" % _("Soft interrupt"),
-                       "VDEF:sirqmin=sirq,MINIMUM",
-                       "VDEF:sirqmax=sirq,MAXIMUM",
-                       "VDEF:sirqavg=sirq,AVERAGE",
-                       "GPRINT:sirqmax:%12s\:" % _("Maximum") + " %6.2lf" ,
-                       "GPRINT:sirqmin:%12s\:" % _("Minimum") + " %6.2lf",
-                       "GPRINT:sirqavg:%12s\:" % _("Average") + " %6.2lf\\n",
+                       "GPRINT:sirq_max:%12s\:" % _("Maximum") + " %6.2lf" ,
+                       "GPRINT:sirq_min:%12s\:" % _("Minimum") + " %6.2lf",
+                       "GPRINT:sirq_avg:%12s\:" % _("Average") + " %6.2lf\\n",
 
                        "STACK:idle#EFEFEF:%-15s" % _("Idle"),
-                       "VDEF:idlemin=idle,MINIMUM",
-                       "VDEF:idlemax=idle,MAXIMUM",
-                       "VDEF:idleavg=idle,AVERAGE",
-                       "GPRINT:idlemax:%12s\:" % _("Maximum") + " %6.2lf" ,
-                       "GPRINT:idlemin:%12s\:" % _("Minimum") + " %6.2lf",
-                       "GPRINT:idleavg:%12s\:" % _("Average") + " %6.2lf\\n",
+                       "GPRINT:idle_max:%12s\:" % _("Maximum") + " %6.2lf" ,
+                       "GPRINT:idle_min:%12s\:" % _("Minimum") + " %6.2lf",
+                       "GPRINT:idle_avg:%12s\:" % _("Average") + " %6.2lf\\n",
                ]
 
        lower_limit = 0
index f81f7de..efdbe9b 100644 (file)
@@ -51,11 +51,6 @@ class GraphTemplateSensorsTemperature(base.GraphTemplate):
                        "CDEF:value_high=value,high,GT,value,UNKN,IF",
                        "CDEF:value_normal=value,high,GT,UNKN,value,IF",
 
-                       "VDEF:value_cur=value,LAST",
-                       "VDEF:value_avg=value,AVERAGE",
-                       "VDEF:value_max=value,MAXIMUM",
-                       "VDEF:value_min=value,MINIMUM",
-
                        # Get data points for the threshold lines
                        "VDEF:critical_line=critical,MINIMUM",
                        "VDEF:low_line=low,MAXIMUM",
@@ -153,10 +148,6 @@ class GraphTemplateSensorsProcessorTemperature(base.GraphTemplate):
                        "CDEF:value_high=value,high,GT,value,UNKN,IF",
                        "CDEF:value_normal=value,high,GT,UNKN,value,IF",
 
-                       "VDEF:value_avg=value,AVERAGE",
-                       "VDEF:value_max=value,MAXIMUM",
-                       "VDEF:value_min=value,MINIMUM",
-
                        "LINE3:value_high#FF0000",
                        "LINE3:value_normal#000000:%-15s\l" % _("Temperature"),