From ed8a615e551a3e5e2d27b7432a5156c9c9397e3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20POIROUX?= Date: Tue, 29 Jul 2014 09:39:47 +0200 Subject: [PATCH 1/7] Bugfix warning messages Odd number of elements in hash assignment at /etc/munin/plugins/varnish_bans line 884. Use of uninitialized value $ident in hash element at /etc/munin/plugins/varnish_bans line 927. --- plugins/varnish4/varnish4_ | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/varnish4/varnish4_ b/plugins/varnish4/varnish4_ index 5ba23dad..f348151e 100644 --- a/plugins/varnish4/varnish4_ +++ b/plugins/varnish4/varnish4_ @@ -885,7 +885,6 @@ sub usage my %state = ( 'stat' => 0, # inside or not 'field' => 'none', # , , , etc. - 'values' => () ); # Reset the state of XML, mainly used for end-elements. @@ -924,7 +923,7 @@ sub xml_commit_state if ($key eq 'flag') { $data = translate_type($data); } - if (defined($type) and $type ne "") { + if (defined($type) and $type ne "" and defined($ident) and $ident ne "") { $data{$type}{$ident}{$name}{$key} = $data; } else { $data{$name}{$key} = $data From d658c583e8fc948bbfedc3c1fc1d2dd7d55e5c0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20POIROUX?= Date: Tue, 29 Jul 2014 09:45:45 +0200 Subject: [PATCH 2/7] Quotes error syntax error at /etc/munin/plugins/varnish_bans line 925, near """ defined" --- plugins/varnish4/varnish4_ | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/varnish4/varnish4_ b/plugins/varnish4/varnish4_ index f348151e..60df9de3 100644 --- a/plugins/varnish4/varnish4_ +++ b/plugins/varnish4/varnish4_ @@ -923,7 +923,7 @@ sub xml_commit_state if ($key eq 'flag') { $data = translate_type($data); } - if (defined($type) and $type ne "" and defined($ident) and $ident ne "") { + if (defined($type) and $type ne '' and defined($ident) and $ident ne '') { $data{$type}{$ident}{$name}{$key} = $data; } else { $data{$name}{$key} = $data From cc15e334538b02185040ea77ae4f0e7e03ed797a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20POIROUX?= Date: Tue, 29 Jul 2014 09:39:47 +0200 Subject: [PATCH 3/7] Bugfix warning messages Odd number of elements in hash assignment at /etc/munin/plugins/varnish_bans line 884. Use of uninitialized value $ident in hash element at /etc/munin/plugins/varnish_bans line 927. --- plugins/varnish4/varnish4_ | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/varnish4/varnish4_ b/plugins/varnish4/varnish4_ index 60df9de3..f348151e 100644 --- a/plugins/varnish4/varnish4_ +++ b/plugins/varnish4/varnish4_ @@ -923,7 +923,7 @@ sub xml_commit_state if ($key eq 'flag') { $data = translate_type($data); } - if (defined($type) and $type ne '' and defined($ident) and $ident ne '') { + if (defined($type) and $type ne "" and defined($ident) and $ident ne "") { $data{$type}{$ident}{$name}{$key} = $data; } else { $data{$name}{$key} = $data From 47a99e02ee6726df655a539e629daebfa243940d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20POIROUX?= Date: Tue, 29 Jul 2014 09:45:45 +0200 Subject: [PATCH 4/7] Quotes error syntax error at /etc/munin/plugins/varnish_bans line 925, near """ defined" --- plugins/varnish4/varnish4_ | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/varnish4/varnish4_ b/plugins/varnish4/varnish4_ index f348151e..60df9de3 100644 --- a/plugins/varnish4/varnish4_ +++ b/plugins/varnish4/varnish4_ @@ -923,7 +923,7 @@ sub xml_commit_state if ($key eq 'flag') { $data = translate_type($data); } - if (defined($type) and $type ne "" and defined($ident) and $ident ne "") { + if (defined($type) and $type ne '' and defined($ident) and $ident ne '') { $data{$type}{$ident}{$name}{$key} = $data; } else { $data{$name}{$key} = $data From de86866b0292880da76b4a190bb71acf32130301 Mon Sep 17 00:00:00 2001 From: Ingo Oppermann Date: Thu, 8 Jan 2015 17:45:56 +0000 Subject: [PATCH 5/7] Fix typos in installation instruction --- plugins/varnish4/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/varnish4/README.md b/plugins/varnish4/README.md index 5043a75e..c861ce3b 100644 --- a/plugins/varnish4/README.md +++ b/plugins/varnish4/README.md @@ -8,7 +8,7 @@ Installation ------------ - Copy `varnish4_` to the Munin plugins directory (`/usr/share/munin/plugins/`) -- Make varnish_ runnable (`chmod +x /usr/share/munin/plugins/varnish_`) +- Make `varnish4_` runnable (`chmod +x /usr/share/munin/plugins/varnish4_`) Configuration ------------- From 7041db3964d4e35fb5ad9c68bdb9279820a94c7f Mon Sep 17 00:00:00 2001 From: Ingo Oppermann Date: Thu, 8 Jan 2015 17:50:35 +0000 Subject: [PATCH 6/7] Fix hit rate calculation In varnish4, purges are counted as client_req but not as hit or miss anymore. This fix recalculates client_req based on cache_(hit|miss|hitpass). --- plugins/varnish4/varnish4_ | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/varnish4/varnish4_ b/plugins/varnish4/varnish4_ index 60df9de3..70b0f67d 100644 --- a/plugins/varnish4/varnish4_ +++ b/plugins/varnish4/varnish4_ @@ -238,7 +238,8 @@ my %ASPECTS = ( 'client_req' => { 'type' => 'DERIVE', 'min' => '0', - 'graph' => 'off' + 'graph' => 'off', + 'rpn' => [ 'cache_hit' , 'cache_miss' , 'cache_hitpass' , '+' , '+' ] }, 'cache_hit' => { 'type' => 'DERIVE', From 50cb217cfe50e70fe7454dde097e740e9aee7600 Mon Sep 17 00:00:00 2001 From: Ingo Oppermann Date: Thu, 8 Jan 2015 17:54:57 +0000 Subject: [PATCH 7/7] Set order for objects and expunge --- plugins/varnish4/varnish4_ | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/varnish4/varnish4_ b/plugins/varnish4/varnish4_ index 70b0f67d..ed0833e1 100644 --- a/plugins/varnish4/varnish4_ +++ b/plugins/varnish4/varnish4_ @@ -305,6 +305,7 @@ my %ASPECTS = ( }, 'objects' => { 'title' => 'Number of objects', + 'order' => 'n_object n_objectcore n_vampireobject n_objecthead', 'values' => { 'n_object' => { 'type' => 'GAUGE', @@ -674,6 +675,7 @@ my %ASPECTS = ( }, 'expunge' => { 'title' => 'Object expunging', + 'order' => 'n_expired n_lru_nuked', 'values' => { 'n_expired' => { 'type' => 'DERIVE',