1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-26 02:48:28 +00:00

Fixed some syntax problems.

This commit is contained in:
Matt West 2010-11-08 00:07:10 +01:00 committed by Steve Schnepp
parent ceb3af8e70
commit 312bfae174

View file

@ -26,7 +26,7 @@ Available Graphs contained in this Plugin
bytes => This graphs the current network traffic in and out bytes => This graphs the current network traffic in and out
commands => I<MULTIGRAPH> This graphs the current commands being issued to the memcache machine. Multigraph breaks this down to per slab. commands => I<MULTIGRAPH> This graphs the current commands being issued to the memcache machine. B<Multigraph breaks this down to per slab.>
conns => This graphs the current, max connections as well as avg conns per sec avg conns per sec is derived from total_conns / uptime. conns => This graphs the current, max connections as well as avg conns per sec avg conns per sec is derived from total_conns / uptime.
@ -37,16 +37,15 @@ items => I<MULTIGRAPH> This graphs the current items and total items in the memc
memory => I<MULTIGRAPH> This graphs the current and max memory allocation B<Multigraph breaks this down to per slab.> memory => I<MULTIGRAPH> This graphs the current and max memory allocation B<Multigraph breaks this down to per slab.>
The following example holds true for all graphing options in this plugin. The following example holds true for all graphing options in this plugin.
Example: ln -s /usr/share/munin/plugins/memcached_multi.pl /etc/munin/plugins/memcached_bytes Example: ln -s /usr/share/munin/plugins/memcached_multi_ /etc/munin/plugins/memcached_multi_bytes
=head1 ADDITIONAL INFORMATION =head1 ADDITIONAL INFORMATION
You will find that some of the graphs have LEI on them. This was done in order to save room You will find that some of the graphs have LEI on them. This was done in order to save room
on space for text and stands for B<Last Evicted Item>. on space for text and stands for B<Last Evicted Item>.
The B<Timescale> variable formats certain graphs based on the following guidelines. This currently The B<Timescale> variable formats certain graphs based on the following guidelines.
only effects the Request for Last Evicted Item graph. 1 => Seconds
1 => Seconds B<time_scale higher than 4 or undef defaults to seconds>
2 => Minutes 2 => Minutes
3 => Hours B<*Default*> 3 => Hours B<*Default*>
4 => Days 4 => Days
@ -59,20 +58,16 @@ Thanks to dormando as well for putting up with me ;)
=head1 AUTHOR =head1 AUTHOR
Matthew West <mhwest at livejournal dot com> Matt West < https://code.google.com/p/memcached-munin-plugin/ >
=head1 LICENSE =head1 LICENSE
GPLv2 GPLv2
=head1 VERSION
v1.21 - Tested against v1.4.5 Memcached Node
=head1 MAGIC MARKERS =head1 MAGIC MARKERS
#%# family=auto #%# family=auto
#%# capabilities=autoconf suggest #%# capabilities=autoconf suggest
=cut =cut
@ -90,7 +85,7 @@ my %stats;
# stats and stats settings. # stats and stats settings.
my %items; my %items;
# This gives us eviction rates and other error stats per slab # This gives us eviction rates and other hit stats per slab
# We track this so we can see if something was evicted earlier than necessary # We track this so we can see if something was evicted earlier than necessary
my %chnks; my %chnks;
@ -100,7 +95,6 @@ my %chnks;
my $timescale = $ENV{timescale} || 3; my $timescale = $ENV{timescale} || 3;
# This gives us the ability to control the timescale our graphs are displaying. # This gives us the ability to control the timescale our graphs are displaying.
# As of right now, this only affects the graph for Last Request for Last Evicted Item (LEI)
# The default it set to divide by hours, if you want to get seconds set it to 1. # The default it set to divide by hours, if you want to get seconds set it to 1.
# Options: 1 = seconds, 2 = minutes, 3 = hours, 4 = days # Options: 1 = seconds, 2 = minutes, 3 = hours, 4 = days
@ -136,6 +130,7 @@ $graphs{items} = {
}, },
datasrc => [ datasrc => [
{ name => 'curr_items', label => 'Current Items', min => '0' }, { name => 'curr_items', label => 'Current Items', min => '0' },
{ name => 'total_items', label => 'New Items', min => '0', type => 'DERIVE' },
], ],
}; };
@ -160,7 +155,7 @@ $graphs{bytes} = {
title => 'Network Traffic', title => 'Network Traffic',
category => 'memcached', category => 'memcached',
info => 'This graph shows the network traffic in (-) / out (+) of the machine', info => 'This graph shows the network traffic in (-) / out (+) of the machine',
order => 'bytes_read,bytes_written', order => 'bytes_read bytes_written',
}, },
datasrc => [ datasrc => [
{ name => 'bytes_read', type => 'DERIVE', label => 'Network Traffic coming in (-)', graph => 'no', cdef => 'bytes_read,8,*', min => '0' }, { name => 'bytes_read', type => 'DERIVE', label => 'Network Traffic coming in (-)', graph => 'no', cdef => 'bytes_read,8,*', min => '0' },
@ -175,7 +170,7 @@ $graphs{conns} = {
category => 'memcached', category => 'memcached',
title => 'Connections', title => 'Connections',
info => 'This graph shows the number of connections being handled by memcached', info => 'This graph shows the number of connections being handled by memcached',
order => 'max_conns,curr_conns,avg_conns', order => 'max_conns curr_conns avg_conns',
}, },
datasrc => [ datasrc => [
{ name => 'curr_conns', label => 'Current Connections', min => '0' }, { name => 'curr_conns', label => 'Current Connections', min => '0' },
@ -747,21 +742,21 @@ sub time_scale {
my $value; my $value;
if ($configopt eq 'config') { if ($configopt eq 'config') {
if (($timescale == 1) || ($timescale > 4) || (!defined($timescale))) { if ($timescale == 1) {
$value = "Seconds" . $origvalue; $value = "Seconds" . $origvalue;
} elsif ($timescale == 2) { } elsif ($timescale == 2) {
$value = "Minutes" . $origvalue; $value = "Minutes" . $origvalue;
} elsif ($timescale == 3) { } elsif (($timescale == 3) || ($timescale > 4) || (!defined($timescale))) {
$value = "Hours" . $origvalue; $value = "Hours" . $origvalue;
} elsif ($timescale == 4) { } elsif ($timescale == 4) {
$value = "Days" . $origvalue; $value = "Days" . $origvalue;
} }
} elsif ($configopt eq 'data') { } elsif ($configopt eq 'data') {
if (($timescale == 1) || ($timescale > 4) || (!defined($timescale))) { if ($timescale == 1) {
$value = sprintf("%02.2f", $origvalue / 1); $value = sprintf("%02.2f", $origvalue / 1);
} elsif ($timescale == 2) { } elsif ($timescale == 2) {
$value = sprintf("%02.2f", $origvalue / 60); $value = sprintf("%02.2f", $origvalue / 60);
} elsif ($timescale == 3) { } elsif (($timescale == 3) || ($timescale > 4) || (!defined($timescale))) {
$value = sprintf("%02.2f", $origvalue / 3600); $value = sprintf("%02.2f", $origvalue / 3600);
} elsif ($timescale == 4) { } elsif ($timescale == 4) {
$value = sprintf("%02.2f", $origvalue / 86400); $value = sprintf("%02.2f", $origvalue / 86400);