2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00

Merge pull request #567 from ioppermann/varnish4

Fix hit rate calculation for varnish4 plugin
This commit is contained in:
Steve Schnepp 2015-03-10 21:25:33 +01:00
commit c61cdea256
2 changed files with 6 additions and 4 deletions

View File

@ -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
-------------

View File

@ -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',
@ -304,6 +305,7 @@ my %ASPECTS = (
},
'objects' => {
'title' => 'Number of objects',
'order' => 'n_object n_objectcore n_vampireobject n_objecthead',
'values' => {
'n_object' => {
'type' => 'GAUGE',
@ -673,6 +675,7 @@ my %ASPECTS = (
},
'expunge' => {
'title' => 'Object expunging',
'order' => 'n_expired n_lru_nuked',
'values' => {
'n_expired' => {
'type' => 'DERIVE',
@ -885,7 +888,6 @@ sub usage
my %state = (
'stat' => 0, # inside <stat> or not
'field' => 'none', # <name>, <value>, <stat>, etc.
'values' => ()
);
# Reset the state of XML, mainly used for end-elements.
@ -924,7 +926,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