Różnice pomiędzy wersjami 1 i 3 (Spinanie 2 wersji)
⇤ ← Wersja 1 z 2016-03-01 09:36:44 →
Rozmiar: 7354
Edytor: wtps0n
Komentarz: *** KREACJA ***
← Wersja 3 z 2017-11-28 23:49:36 → ⇥
Rozmiar: 8244
Edytor: wtps0n
Komentarz: * aktualizacja łatki: po aktualizacjach samego collectd
Usunięcia zostały oznaczone w ten sposób. Dodatki zostały oznaczone w ten sposób.
Linia 4: Linia 4:
=== Łatka dla coolection.modified.cgi === === Łatanie collection.modified.cgi ===
Linia 8: Linia 8:
+++ collection.modified.cgi 2016-03-01 10:26:15.949841521 +0100 +++ collection.modified.cgi 2017-11-29 00:19:34.770758000 +0100
@@ -1,4 +1,4 @@
-#!/usr/bin/env perl
+#!/usr/local/bin/perl
 # Collectd-web - collection.modified.cgi
 # Copyright (C) 2006-2010 Florian "octo" Forster
 # Copyright (C) 2009-2010 Kenneth Belitzky
Linia 103: Linia 109:
@@ -3215,13 +3261,28 @@ sub load_graph_definitions { @@ -1356,6 +1402,34 @@ sub load_graph_definitions {
             'GPRINT:inc_max:MAX:%6.2lf Max,',
             'GPRINT:inc_avg:LAST:%6.2lf Last\l'
         ],
+ disk_io_time => [
+ '-v',
+ 'Seconds/s',
+ 'DEF:out_min_raw={file}:io_time:MIN',
+ 'DEF:out_avg_raw={file}:io_time:AVERAGE',
+ 'DEF:out_max_raw={file}:io_time:MAX',
+ 'DEF:inc_min_raw={file}:weighted_io_time:MIN',
+ 'DEF:inc_avg_raw={file}:weighted_io_time:AVERAGE',
+ 'DEF:inc_max_raw={file}:weighted_io_time:MAX',
+ 'CDEF:out_min=out_min_raw,1000,/',
+ 'CDEF:out_avg=out_avg_raw,1000,/',
+ 'CDEF:out_max=out_max_raw,1000,/',
+ 'CDEF:inc_min=inc_min_raw,1000,/',
+ 'CDEF:inc_avg=inc_avg_raw,1000,/',
+ 'CDEF:inc_max=inc_max_raw,1000,/',
+ 'CDEF:overlap=out_avg,inc_avg,GT,inc_avg,out_avg,IF',
+ "AREA:out_avg#$HalfGreen",
+ "AREA:inc_avg#$HalfBlue",
+ "AREA:overlap#$HalfBlueGreen",
+ "LINE1:out_avg#$FullGreen:IO time",
+ 'GPRINT:out_avg:AVERAGE:%5.1lf%ss Avg,',
+ 'GPRINT:out_max:MAX:%5.1lf%ss Max,',
+ 'GPRINT:out_avg:LAST:%5.1lf%ss Last\l',
+ "LINE1:inc_avg#$FullBlue:Weighted IO time ",
+ 'GPRINT:inc_avg:AVERAGE:%5.1lf%ss Avg,',
+ 'GPRINT:inc_max:MAX:%5.1lf%ss Max,',
+ 'GPRINT:inc_avg:LAST:%5.1lf%ss Last\l'
+ ],
         disk_time => [
             '-v',
             'Seconds/s',
@@ -3215,9 +3289,23 @@ sub load_graph_definitions {
Linia 129: Linia 170:
     $GraphDefs->{'dns_rcode'} = $GraphDefs->{'dns_opcode'};
+ $GraphDefs->{'full_join'} = $GraphDefs->{'mysql_qcache'};
 # jaf-18aug11 additional Varnish graphs
     $GraphDefs->{'memcached_command'} = $GraphDefs->{'total_operations'};
     $GraphDefs->{'memcached_connections'} = $GraphDefs->{'apache_connections'};
@@ -3234,6 +3295,14 @@ sub load_graph_definitions {
@@ -3234,6 +3322,15 @@ sub load_graph_definitions {
Linia 142: Linia 178:
+ $GraphDefs->{'memory_throttle_count'} = $GraphDefs->{'cache_result'};
Linia 149: Linia 186:
@@ -3246,6 +3315,8 @@ sub load_graph_definitions {
     $MetaGraphDefs->{'swap'} = \&meta_graph_swap;
     $MetaGraphDefs->{'mysql_commands'} = \&meta_graph_mysql_commands;
     $MetaGraphDefs->{'mysql_handler'} = \&meta_graph_mysql_commands;
+ $MetaGraphDefs->{'mysql_select'} = \&meta_graph_mysql_commands;
+ $MetaGraphDefs->{'mysql_sort'} = \&meta_graph_mysql_commands;
     $MetaGraphDefs->{'tcp_connections'} = \&meta_graph_tcp_connections;
     $MetaGraphDefs->{'vmpage_number'} = \&meta_graph_vmpage_number;
     $MetaGraphDefs->{'vmpage_action'} = \&meta_graph_vmpage_action;
@@ -3468,7 +3539,7 @@ sub meta_graph_dns
@@ -3468,7 +3565,7 @@ sub meta_graph_dns

Łatanie collection.modified.cgi

--- collection.modified.cgi.orig        2012-12-31 01:51:09.000000000 +0100
+++ collection.modified.cgi     2017-11-29 00:19:34.770758000 +0100
@@ -1,4 +1,4 @@
-#!/usr/bin/env perl
+#!/usr/local/bin/perl
 # Collectd-web - collection.modified.cgi
 # Copyright (C) 2006-2010  Florian "octo" Forster
 # Copyright (C) 2009-2010  Kenneth Belitzky
@@ -27,7 +27,7 @@ use URI::Escape    ('uri_escape');
 use RRDs           ();
 use Data::Dumper   ();
 use JSON ('to_json');
-our $Config   = "/etc/collectd/collection.conf";
+our $Config   = "/usr/local/etc/collectd-web.conf";
 our @DataDirs = ();
 our $LibDir;
 our $make_transparent = 1;
@@ -39,6 +39,9 @@ our $ValidTimespan    = {
     year  => 366 * 86400
 };

+# --- wy/l/aczenie logowania b/l/ed/ow w logacha serwera www. U/zywa/c z rozs/adkiem - s/lu/zy do poprawek
+#
+##$CGI::LIST_CONTEXT_WARN = 0;

 our @RRDDefaultArgs = (
 '--rigid', '-w', '500', '-h', '160', '--alt-autoscale-max', '--alt-y-grid',
@@ -191,7 +194,9 @@ sub _get_menu_buttons {
 sub _get_param_host {
     my %all_hosts = map { $_ => 1 } ( _find_hosts() );
     my @selected_hosts = ();
-    for ( param('host') ) {
+    my @loc_hosts = ();
+    push @loc_hosts, scalar param('host');
+    for ( @loc_hosts ) {
         if ( defined( $all_hosts{$_} ) ) {
             push( @selected_hosts, "$_" );
         }
@@ -619,7 +624,7 @@ sub action_show_plugin_json {
         $plugins_per_host->{ $hosts[$i] } = _find_files_for_host( $hosts[$i] );
         _files_union( $all_plugins, $plugins_per_host->{ $hosts[$i] } );
     }
-    for ( param('plugin') ) {
+    for ( scalar param('plugin') ) {
         if ( defined( $all_plugins->{$_} ) ) {
             $selected_plugins->{$_} = 1;
         }
@@ -1059,6 +1064,35 @@ sub load_graph_definitions {
             'GPRINT:max:MAX:%6.2lf Max,',
             'GPRINT:avg:LAST:%6.2lf Last'
         ],
+        io_octets => [
+        'DEF:out_min={file}:tx:MIN',
+        'DEF:out_avg={file}:tx:AVERAGE',
+        'DEF:out_max={file}:tx:MAX',
+        'DEF:inc_min={file}:rx:MIN',
+        'DEF:inc_avg={file}:rx:AVERAGE',
+        'DEF:inc_max={file}:rx:MAX',
+        'CDEF:overlap=out_avg,inc_avg,GT,inc_avg,out_avg,IF',
+        'CDEF:mytime=out_avg,TIME,TIME,IF',
+        'CDEF:sample_len_raw=mytime,PREV(mytime),-',
+        'CDEF:sample_len=sample_len_raw,UN,0,sample_len_raw,IF',
+        'CDEF:out_avg_sample=out_avg,UN,0,out_avg,IF,sample_len,*',
+        'CDEF:out_avg_sum=PREV,UN,0,PREV,IF,out_avg_sample,+',
+        'CDEF:inc_avg_sample=inc_avg,UN,0,inc_avg,IF,sample_len,*',
+        'CDEF:inc_avg_sum=PREV,UN,0,PREV,IF,inc_avg_sample,+',
+        "AREA:out_avg#$HalfGreen",
+        "AREA:inc_avg#$HalfBlue",
+        "AREA:overlap#$HalfBlueGreen",
+        "LINE1:out_avg#$FullGreen:Written",
+        'GPRINT:out_avg:AVERAGE:%5.1lf%s Avg,',
+        'GPRINT:out_max:MAX:%5.1lf%s Max,',
+        'GPRINT:out_avg:LAST:%5.1lf%s Last',
+        'GPRINT:out_avg_sum:LAST:(ca. %5.1lf%sB Total)\l',
+        "LINE1:inc_avg#$FullBlue:Read   ",
+        'GPRINT:inc_avg:AVERAGE:%5.1lf%s Avg,',
+        'GPRINT:inc_max:MAX:%5.1lf%s Max,',
+        'GPRINT:inc_avg:LAST:%5.1lf%s Last',
+        'GPRINT:inc_avg_sum:LAST:(ca. %5.1lf%sB Total)\l'
+        ],
         cache_result => [
             'DEF:min={file}:value:MIN',
             'DEF:avg={file}:value:AVERAGE',
@@ -1071,6 +1105,18 @@ sub load_graph_definitions {
             'GPRINT:max:MAX:%6.2lf Max,',
             'GPRINT:avg:LAST:%6.2lf Last'
         ],
+        cache_size => [
+        'DEF:min={file}:value:MIN',
+        'DEF:avg={file}:value:AVERAGE',
+        'DEF:max={file}:value:MAX',
+        "AREA:max#$HalfBlue",
+        "AREA:min#$Canvas",
+        "LINE1:avg#$FullBlue:ARC cache size (Bytes)",
+        'GPRINT:min:MIN:%6.2lf%s Min,',
+        'GPRINT:avg:AVERAGE:%6.2lf%s Avg,',
+        'GPRINT:max:MAX:%6.2lf%s Max,',
+        'GPRINT:avg:LAST:%6.2lf%s Last'
+        ],
         apache_scoreboard => [
             'DEF:min={file}:value:MIN',
             'DEF:avg={file}:value:AVERAGE',
@@ -1356,6 +1402,34 @@ sub load_graph_definitions {
             'GPRINT:inc_max:MAX:%6.2lf Max,',
             'GPRINT:inc_avg:LAST:%6.2lf Last\l'
         ],
+        disk_io_time => [
+            '-v',
+            'Seconds/s',
+            'DEF:out_min_raw={file}:io_time:MIN',
+            'DEF:out_avg_raw={file}:io_time:AVERAGE',
+            'DEF:out_max_raw={file}:io_time:MAX',
+            'DEF:inc_min_raw={file}:weighted_io_time:MIN',
+            'DEF:inc_avg_raw={file}:weighted_io_time:AVERAGE',
+            'DEF:inc_max_raw={file}:weighted_io_time:MAX',
+            'CDEF:out_min=out_min_raw,1000,/',
+            'CDEF:out_avg=out_avg_raw,1000,/',
+            'CDEF:out_max=out_max_raw,1000,/',
+            'CDEF:inc_min=inc_min_raw,1000,/',
+            'CDEF:inc_avg=inc_avg_raw,1000,/',
+            'CDEF:inc_max=inc_max_raw,1000,/',
+            'CDEF:overlap=out_avg,inc_avg,GT,inc_avg,out_avg,IF',
+            "AREA:out_avg#$HalfGreen",
+            "AREA:inc_avg#$HalfBlue",
+            "AREA:overlap#$HalfBlueGreen",
+            "LINE1:out_avg#$FullGreen:IO time",
+            'GPRINT:out_avg:AVERAGE:%5.1lf%ss Avg,',
+            'GPRINT:out_max:MAX:%5.1lf%ss Max,',
+            'GPRINT:out_avg:LAST:%5.1lf%ss Last\l',
+            "LINE1:inc_avg#$FullBlue:Weighted IO time   ",
+            'GPRINT:inc_avg:AVERAGE:%5.1lf%ss Avg,',
+            'GPRINT:inc_max:MAX:%5.1lf%ss Max,',
+            'GPRINT:inc_avg:LAST:%5.1lf%ss Last\l'
+        ],
         disk_time => [
             '-v',
             'Seconds/s',
@@ -3215,9 +3289,23 @@ sub load_graph_definitions {
             'GPRINT:avg:LAST:%6.2lf Last'
         ],
 # jaf-18aug11 END
-
-
+        bytes => ['-v', 'Bytes',
+        'DEF:avg={file}:value:AVERAGE',
+        'DEF:min={file}:value:MIN',
+        'DEF:max={file}:value:MAX',
+        "AREA:max#$HalfGreen",
+        "AREA:min#$Canvas",
+        "LINE1:avg#$FullGreen:Bytes",
+        'GPRINT:min:MIN:%4.1lf Min,',
+        'GPRINT:avg:AVERAGE:%4.1lf Avg,',
+        'GPRINT:max:MAX:%4.1lf Max,',
+        'GPRINT:avg:LAST:%4.1lf Last\l'
+        ],
     };
+    $GraphDefs->{'ps_code'}             = $GraphDefs->{'ps_state'};
+    $GraphDefs->{'ps_data'}             = $GraphDefs->{'ps_state'};
+    $GraphDefs->{'ps_stacksize'}        = $GraphDefs->{'ps_state'};
+    $GraphDefs->{'ps_vm'}               = $GraphDefs->{'ps_state'};
     $GraphDefs->{'if_multicast'}        = $GraphDefs->{'ipt_packets'};
     $GraphDefs->{'if_tx_errors'}        = $GraphDefs->{'if_rx_errors'};
     $GraphDefs->{'dns_qtype'}           = $GraphDefs->{'dns_opcode'};
@@ -3234,6 +3322,15 @@ sub load_graph_definitions {
 # jaf-18aug11 END
     $GraphDefs->{'vmpage_io-memory'}    = $GraphDefs->{'vmpage_io'};
     $GraphDefs->{'vmpage_io-swap'}      = $GraphDefs->{'vmpage_io'};
+    $GraphDefs->{'cache_ratio'}         = $GraphDefs->{'cache_result'};
+    $GraphDefs->{'cache_eviction'}      = $GraphDefs->{'cache_result'};
+    $GraphDefs->{'cache_operation'}     = $GraphDefs->{'cache_result'};
+    $GraphDefs->{'mutex_operations'}    = $GraphDefs->{'cache_result'};
+    $GraphDefs->{'memory_throttle_count'} = $GraphDefs->{'cache_result'};
+    $GraphDefs->{'hash_collisions'}     = $GraphDefs->{'cache_result'};
+    $GraphDefs->{'operations'} = $GraphDefs->{'derive'};
+    $GraphDefs->{'queue_length'} = $GraphDefs->{'gauge'};
+    $GraphDefs->{'total_values'} = $GraphDefs->{'gauge'};
     $MetaGraphDefs->{'cpu'}             = \&meta_graph_cpu;
     $MetaGraphDefs->{'df_complex'}      = \&meta_graph_df_complex;
     $MetaGraphDefs->{'dns_qtype'}       = \&meta_graph_dns;
@@ -3468,7 +3565,7 @@ sub meta_graph_dns

   @$type_instances = sort @$type_instances;

-  $opts->{'colors'} = _get_n_colors ($type_instances);
+  ###$opts->{'colors'} = _get_n_colors ($type_instances);

   for (@$type_instances)
   {


{i}  (c) 2004 - 2026 BSD Serwis Krzysztof Stryjek. W przypadku błędów, poprawek proszę kontaktować się z administratorem wiki.

CollectDaemon/CollectionModifiedCgi (ostatnio edytowane 2019-12-07 10:44:42 przez wtps0n)