- rrd_graph = [
- "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",
- "LINE1:errors_rx#228B22",
-
- # 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",
- "LINE1:errors_tx_inv#B22222",
-
- # 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",
- "LINE1:dropped_rx#228B22",
-
- # 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",
- "LINE1:dropped_tx#B22222",
-
- # Draw the collisions as a line.
- "LINE3:collisions#8B0000:%-15s" % _("Collisions") + "\\n",
- ]
+ @property
+ def rrd_graph(self):
+ 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",
+ "LINE1:errors_rx#228B22",
+
+ # 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",
+ "LINE1:errors_tx_inv#B22222",
+
+ # 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",
+ "LINE1:dropped_rx#228B22",
+
+ # 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",
+ "LINE1:dropped_tx#B22222",
+
+ # Draw the collisions as a line.
+ "LINE3:collisions#8B0000:%-15s" % _("Collisions") + "\\n",
+ ]