trunk: Updated the `collection.cgi' with the `ntpd' types.
authorocto <octo>
Sat, 10 Jun 2006 13:39:18 +0000 (13:39 +0000)
committerocto <octo>
Sat, 10 Jun 2006 13:39:18 +0000 (13:39 +0000)
Some ntpd-specific types have been added. The `apcups_*' types have been
removed, since the apcups-plugin uses pretty generic types that are also used
the `battery' plugin and possibly others..

contrib/collection.cgi

index 2af6e44..eb97d63 100755 (executable)
@@ -106,6 +106,18 @@ our $GraphDefs;
                        'GPRINT:max:MAX:%5.1lf%sAh Max,',
                        'GPRINT:avg:LAST:%5.1lf%sAh Last\l'
                ],
+               charge_percent => [
+                       'DEF:avg={file}:percent:AVERAGE',
+                       'DEF:min={file}:percent:MIN',
+                       'DEF:max={file}:percent:MAX',
+                       "AREA:max#$HalfBlue",
+                       "AREA:min#$Canvas",
+                       "LINE1:avg#$FullBlue:Charge",
+                       'GPRINT:min:MIN:%5.1lf%s%% Min,',
+                       'GPRINT:avg:AVERAGE:%5.1lf%s%% Avg,',
+                       'GPRINT:max:MAX:%5.1lf%s%% Max,',
+                       'GPRINT:avg:LAST:%5.1lf%s%% Last\l'
+               ],
                cpu => ['DEF:user_avg={file}:user:AVERAGE',
                        'DEF:user_min={file}:user:MIN',
                        'DEF:user_max={file}:user:MAX',
@@ -298,6 +310,18 @@ our $GraphDefs;
                        'GPRINT:l_max:MAX:%4.2lf Max,',
                        'GPRINT:l_avg:LAST:%4.2lf Last'
                ],
+               load_percent => [
+                       'DEF:avg={file}:percent:AVERAGE',
+                       'DEF:min={file}:percent:MIN',
+                       'DEF:max={file}:percent:MAX',
+                       "AREA:max#$HalfBlue",
+                       "AREA:min#$Canvas",
+                       "LINE1:avg#$FullBlue:Load",
+                       'GPRINT:min:MIN:%5.1lf%s%% Min,',
+                       'GPRINT:avg:AVERAGE:%5.1lf%s%% Avg,',
+                       'GPRINT:max:MAX:%5.1lf%s%% Max,',
+                       'GPRINT:avg:LAST:%5.1lf%s%% Last\l'
+               ],
                mails => ['DEF:rawgood={file}:good:AVERAGE',
                        'DEF:rawspam={file}:spam:AVERAGE',
                        'CDEF:good=rawgood,UN,0,rawgood,IF',
@@ -715,13 +739,22 @@ our $GraphDefs;
                        'GPRINT:temp_max:MAX:%4.1lf Max,',
                        'GPRINT:temp_avg:LAST:%4.1lf Last\l'
                ],
+               timeleft => [
+                       'DEF:avg={file}:timeleft:AVERAGE',
+                       'DEF:min={file}:timeleft:MIN',
+                       'DEF:max={file}:timeleft:MAX',
+                       "AREA:max#$HalfBlue",
+                       "AREA:min#$Canvas",
+                       "LINE1:avg#$FullBlue:Time left [min]",
+                       'GPRINT:min:MIN:%5.1lf%s Min,',
+                       'GPRINT:avg:AVERAGE:%5.1lf%s Avg,',
+                       'GPRINT:max:MAX:%5.1lf%s Max,',
+                       'GPRINT:avg:LAST:%5.1lf%s Last\l'
+               ],
                time_offset => [ # NTPd
-                       'DEF:ms_avg={file}:ms:AVERAGE',
-                       'DEF:ms_min={file}:ms:MIN',
-                       'DEF:ms_max={file}:ms:MAX',
-                       'CDEF:s_avg=ms_avg,1000,/',
-                       'CDEF:s_min=ms_min,1000,/',
-                       'CDEF:s_max=ms_max,1000,/',
+                       'DEF:s_avg={file}:seconds:AVERAGE',
+                       'DEF:s_min={file}:seconds:MIN',
+                       'DEF:s_max={file}:seconds:MAX',
                        "AREA:s_max#$HalfBlue",
                        "AREA:s_min#$Canvas",
                        "LINE1:s_avg#$FullBlue:{inst}",
@@ -801,93 +834,6 @@ our $GraphDefs;
                        'GPRINT:max:MAX:%5.1lf%sV Max,',
                        'GPRINT:avg:LAST:%5.1lf%sV Last\l'
                ],
-               apcups_volt => [
-                       'DEF:line_avg={file}:linev:AVERAGE',
-                       'DEF:line_min={file}:linev:MIN',
-                       'DEF:line_max={file}:linev:MAX',
-                       'DEF:out_avg={file}:outputv:AVERAGE',
-                       'DEF:out_min={file}:outputv:MIN',
-                       'DEF:out_max={file}:outputv:MAX',
-                       #"AREA:line_max#$HalfBlue",
-                       #"AREA:line_min#$Canvas",
-                       #"AREA:out_avg#$HalfGreen",
-                       "LINE1:line_avg#$FullBlue:Line Volt",
-                       'GPRINT:line_min:MIN:%5.1lf%sV Min,',
-                       'GPRINT:line_avg:AVERAGE:%5.1lf%sV Avg,',
-                       'GPRINT:line_max:MAX:%5.1lf%sV Max,',
-                       'GPRINT:line_avg:LAST:%5.1lf%sV Last\l',
-                       "LINE2:out_avg#$FullGreen:Out  Volt",
-                       'GPRINT:out_min:MIN:%5.1lf%sV Min,',
-                       'GPRINT:out_avg:AVERAGE:%5.1lf%sV Avg,',
-                       'GPRINT:out_max:MAX:%5.1lf%sV Max,',
-                       'GPRINT:out_avg:LAST:%5.1lf%sV Last\l'
-               ],
-               apcups_bvolt => [
-                       'DEF:bvolt_avg={file}:battv:AVERAGE',
-                       'DEF:bvolt_min={file}:battv:MIN',
-                       'DEF:bvolt_max={file}:battv:MAX',
-                       "AREA:bvolt_max#$HalfBlue",
-                       "LINE1:bvolt_avg#$FullBlue:Batt Volt",
-                       'GPRINT:bvolt_min:MIN:%5.1lf%sV Min,',
-                       'GPRINT:bvolt_avg:AVERAGE:%5.1lf%sV Avg,',
-                       'GPRINT:bvolt_max:MAX:%5.1lf%sV Max,',
-                       'GPRINT:bvolt_avg:LAST:%5.1lf%sV Last\l',
-               ],
-               apcups_load => [
-                       'DEF:load_avg={file}:loadpct:AVERAGE',
-                       'DEF:load_min={file}:loadpct:MIN',
-                       'DEF:load_max={file}:loadpct:MAX',
-                       "AREA:load_max#$HalfBlue",
-                       "LINE1:load_avg#$FullBlue:Batt load",
-                       'GPRINT:load_min:MIN:%5.1lf%s%% Min,',
-                       'GPRINT:load_avg:AVERAGE:%5.1lf%s%% Avg,',
-                       'GPRINT:load_max:MAX:%5.1lf%s%% Max,',
-                       'GPRINT:load_avg:LAST:%5.1lf%s%% Last\l',
-               ],
-               apcups_charge => [
-                       'DEF:charge_avg={file}:bcharge:AVERAGE',
-                       'DEF:charge_min={file}:bcharge:MIN',
-                       'DEF:charge_max={file}:bcharge:MAX',
-                       "AREA:charge_max#$HalfBlue",
-                       "LINE1:charge_avg#$FullBlue:Batt Charge",
-                       'GPRINT:charge_min:MIN:%5.1lf%s%% Min,',
-                       'GPRINT:charge_avg:AVERAGE:%5.1lf%s%% Avg,',
-                       'GPRINT:charge_max:MAX:%5.1lf%s%% Max,',
-                       'GPRINT:charge_avg:LAST:%5.1lf%s%% Last\l',
-               ],
-               apcups_time => [
-                       'DEF:time_avg={file}:timeleft:AVERAGE',
-                       'DEF:time_min={file}:timeleft:MIN',
-                       'DEF:time_max={file}:timeleft:MAX',
-                       "AREA:time_max#$HalfBlue",
-                       "LINE1:time_avg#$FullBlue:Time Avail",
-                       'GPRINT:time_min:MIN:%5.1lf%smin Min,',
-                       'GPRINT:time_avg:AVERAGE:%5.1lf%smin Avg,',
-                       'GPRINT:time_max:MAX:%5.1lf%smin Max,',
-                       'GPRINT:time_avg:LAST:%5.1lf%smin Last\l',
-               ],
-               apcups_temp => [
-                       'DEF:temp_avg={file}:itemp:AVERAGE',
-                       'DEF:temp_min={file}:itemp:MIN',
-                       'DEF:temp_max={file}:itemp:MAX',
-                       "AREA:temp_max#$HalfBlue",
-                       "LINE1:temp_avg#$FullBlue:Temp Avail",
-                       'GPRINT:temp_min:MIN:%5.1lf%s° Min,',
-                       'GPRINT:temp_avg:AVERAGE:%5.1lf%s° Avg,',
-                       'GPRINT:temp_max:MAX:%5.1lf%s° Max,',
-                       'GPRINT:temp_avg:LAST:%5.1lf%s° Last\l',
-               ],
-               apcups_freq => [
-                       'DEF:freq_avg={file}:linefreq:AVERAGE',
-                       'DEF:freq_min={file}:linefreq:MIN',
-                       'DEF:freq_max={file}:linefreq:MAX',
-                       "AREA:freq_max#$HalfBlue",
-                       "LINE1:freq_avg#$FullBlue:Line Freq",
-                       'GPRINT:freq_min:MIN:%5.1lf%sHz Min,',
-                       'GPRINT:freq_avg:AVERAGE:%5.1lf%sHz Avg,',
-                       'GPRINT:freq_max:MAX:%5.1lf%sHz Max,',
-                       'GPRINT:freq_avg:LAST:%5.1lf%sHz Last\l',
-               ],
                vs_threads => [
                        "DEF:total_avg={file}:total:AVERAGE",
                        "DEF:total_min={file}:total:MIN",
@@ -983,6 +929,7 @@ our $GraphArgs =
        apache_requests => ['-t', 'apache requests', '-v', 'Requests/s'],
        apache_scoreboard => ['-t', 'apache scoreboard {inst}', '-v', 'Processes'],
        charge => ['-t', '{host} charge', '-v', 'Ampere hours'],
+       charge_percent => ['-t', '{host} charge', '-v', 'Percent'],
        cpu => ['-t', '{host} cpu{inst} usage', '-v', 'Percent', '-l', '0'],
        cpufreq => ['-t', '{host} cpu{inst} usage', '-v', 'Mhz'],
        current => ['-t', '{host} current', '-v', 'Ampere'],
@@ -994,6 +941,7 @@ our $GraphArgs =
        frequency_offset => ['-t', 'NTPd frequency offset ({inst})', '-v', 'Parts per million'],
        hddtemp => ['-t', '{host} hdd temperature {inst}', '-v', '°Celsius'],
        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'],
        memory => ['-t', '{host} memory usage', '-v', 'Bytes', '-b', '1024', '-l', '0'],
        mysql_commands => ['-t', 'mysql command {inst}', '-v', 'Issues/s' ],
@@ -1007,18 +955,12 @@ our $GraphArgs =
        sensors => ['-t', '{host} sensor {inst}', '-v', '°Celsius'],
        swap => ['-t', '{host} swap usage', '-v', 'Bytes', '-b', '1024', '-l', '0'],
        temperature => ['-t', '{host} temperature {inst}', '-v', '°Celsius'],
+       timeleft => ['-t', '{host} UPS time left', '-v', 'Time [min]'],
        time_offset => ['-t', 'NTPd time offset ({inst})', '-v', 'Seconds'],
        time_dispersion => ['-t', 'NTPd time dispersion ({inst})', '-v', 'Seconds'],
        traffic => ['-t', '{host} {inst} traffic', '-v', 'Bit/s'],
        users => ['-t', '{host} users', '-v', 'Users'],
        voltage => ['-t', '{host} voltage', '-v', 'Volts'],
-       apcups_volt => ['-t', '{host} APC voltage {inst}', '-v', 'Volts AC'],
-       apcups_bvolt => ['-t', '{host} APC Batt voltage {inst}', '-v', 'Volts DC'],
-       apcups_load => ['-t', '{host} APC Load {inst}', '-v', 'Percent'],
-       apcups_charge => ['-t', '{host} APC Batt Charge {inst}', '-v', 'Percent'],
-       apcups_time => ['-t', '{host} APC Time Left {inst}', '-v', 'Minutes'],
-       apcups_temp => ['-t', '{host} APC Internal Temp {inst}', '-v', '°Celsius'],
-       apcups_freq => ['-t', '{host} APC Line Freq {inst}', '-v', 'Hz'],
        vs_threads => ['-t', '{host} threads', '-v', 'Threads'],
        vs_memory => ['-t', '{host} memory usage', '-v', 'Bytes'],
        vs_processes => ['-t', '{host} processes', '-v', 'Processes'],
@@ -1030,13 +972,6 @@ our $GraphMulti =
        cpu     => \&output_graph_cpu,
        cpufreq => 1,
        disk    => 1,
-       apcups_volt => 1,
-       apcups_bvolt => 1,
-       apcups_load => 1,
-       apcups_charge => 1,
-       apcups_time => 1,
-       apcups_temp => 1,
-       apcups_freq => 1,
        load    => 0,
        mails   => 0,
        memory  => 0,