collection.cgi: Add the new network RRD-files `if_errors.rrd' and `if_packets.rrd'.
authorFlorian Forster <octo@leeloo.lan.home.verplant.org>
Sun, 9 Jul 2006 10:34:55 +0000 (12:34 +0200)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Sun, 9 Jul 2006 10:34:55 +0000 (12:34 +0200)
contrib/collection.cgi

index eb97d63..098c702 100755 (executable)
@@ -283,6 +283,35 @@ our $GraphDefs;
                        'GPRINT:temp_max:MAX:%4.1lf Max,',
                        'GPRINT:temp_avg:LAST:%4.1lf Last\l'
                ],
+               if_packets => ['DEF:tx_min={file}:tx:MIN',
+                       'DEF:tx_avg={file}:tx:AVERAGE',
+                       'DEF:tx_max={file}:tx:MAX',
+                       'DEF:rx_min={file}:rx:MIN',
+                       'DEF:rx_avg={file}:rx:AVERAGE',
+                       'DEF:rx_max={file}:rx:MAX',
+                       'CDEF:overlap=tx_avg,rx_avg,GT,rx_avg,tx_avg,IF',
+                       'CDEF:mytime=tx_avg,TIME,TIME,IF',
+                       'CDEF:sample_len_raw=mytime,PREV(mytime),-',
+                       'CDEF:sample_len=sample_len_raw,UN,0,sample_len_raw,IF',
+                       'CDEF:tx_avg_sample=tx_avg,UN,0,tx_avg,IF,sample_len,*',
+                       'CDEF:tx_avg_sum=PREV,UN,0,PREV,IF,tx_avg_sample,+',
+                       'CDEF:rx_avg_sample=rx_avg,UN,0,rx_avg,IF,sample_len,*',
+                       'CDEF:rx_avg_sum=PREV,UN,0,PREV,IF,rx_avg_sample,+',
+                       "AREA:tx_avg#$HalfGreen",
+                       "AREA:rx_avg#$HalfBlue",
+                       "AREA:overlap#$HalfBlueGreen",
+                       "LINE1:tx_avg#$FullGreen:TX",
+                       'GPRINT:tx_avg:AVERAGE:%5.1lf%s Avg,',
+                       'GPRINT:tx_max:MAX:%5.1lf%s Max,',
+                       'GPRINT:tx_avg:LAST:%5.1lf%s Last',
+                       'GPRINT:tx_avg_sum:LAST:(ca. %.0lf Total)\l',
+                       "LINE1:rx_avg#$FullBlue:RX",
+                       #'GPRINT:rx_min:MIN:%5.1lf %s Min,',
+                       'GPRINT:rx_avg:AVERAGE:%5.1lf%s Avg,',
+                       'GPRINT:rx_max:MAX:%5.1lf%s Max,',
+                       'GPRINT:rx_avg:LAST:%5.1lf%s Last',
+                       'GPRINT:rx_avg_sum:LAST:(ca. %.0lf Total)\l'
+               ],
                load => ['DEF:s_avg={file}:shortterm:AVERAGE',
                        'DEF:s_min={file}:shortterm:MIN',
                        'DEF:s_max={file}:shortterm:MAX',
@@ -916,6 +945,7 @@ our $GraphDefs;
                ],
        };
        $GraphDefs->{'disk'} = $GraphDefs->{'partition'};
+       $GraphDefs->{'if_errors'} = $GraphDefs->{'if_packets'};
        $GraphDefs->{'meminfo'} = $GraphDefs->{'memory'};
        $GraphDefs->{'sensors'} = $GraphDefs->{'temperature'};
 
@@ -940,6 +970,8 @@ our $GraphArgs =
        fanspeed => ['-t', '{host} fanspeed {inst}', '-v', 'rpm'],
        frequency_offset => ['-t', 'NTPd frequency offset ({inst})', '-v', 'Parts per million'],
        hddtemp => ['-t', '{host} hdd temperature {inst}', '-v', '°Celsius'],
+       if_errors => ['-t', '{host} {inst} errors', '-v', 'Errors/s'],
+       if_packets => ['-t', '{host} {inst} packets', '-v', 'Packets/s'],
        load => ['-t', '{host} load average', '-v', 'System load', '-X', '0'],
        load_percent => ['-t', '{host} load', '-v', 'Percent'],
        mails   => ['-t', '{host} mail count', '-v', 'Amount', '-X', '0'],