mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-22 02:51:03 +00:00
Initial version
This commit is contained in:
parent
366a668992
commit
cf3e168706
1 changed files with 38 additions and 0 deletions
38
plugins/other/memcached_requests_
Executable file
38
plugins/other/memcached_requests_
Executable file
|
@ -0,0 +1,38 @@
|
||||||
|
#!/usr/bin/env perl
|
||||||
|
# ex:ts=4
|
||||||
|
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
|
use Cache::Memcached;
|
||||||
|
|
||||||
|
my $cmd = shift || '';
|
||||||
|
if ($cmd eq 'config') {
|
||||||
|
print "graph_title Memcached requests\n";
|
||||||
|
print "graph_args --base 1000 -l 0\n";
|
||||||
|
print "graph_vlabel requests\n";
|
||||||
|
print "graph_category memcached\n";
|
||||||
|
print "graph_info This graph monitors the number of get and set requests.\n";
|
||||||
|
print "gets.label gets\n";
|
||||||
|
print "gets.info Number of get requests\n";
|
||||||
|
print "gets.min 0\n";
|
||||||
|
print "gets.type DERIVE\n";
|
||||||
|
print "gets.draw AREA\n";
|
||||||
|
print "sets.label sets\n";
|
||||||
|
print "sets.info Number of set requests\n";
|
||||||
|
print "sets.min 0\n";
|
||||||
|
print "sets.type DERIVE\n";
|
||||||
|
print "sets.draw STACK\n";
|
||||||
|
exit 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
$0 =~ /memcached_requests_(\d+_\d+_\d+_\d+)_(\d+)$/;
|
||||||
|
my ($ip, $port) = ($1, $2);
|
||||||
|
$ip =~ s/_/./g;
|
||||||
|
my $address = "$ip:$port";
|
||||||
|
|
||||||
|
my $memd = new Cache::Memcached { 'servers' => [$address] };
|
||||||
|
my $memstats = $memd->stats(['misc']);
|
||||||
|
|
||||||
|
print "gets.value " . $memstats->{hosts}->{$address}->{misc}->{cmd_get} . "\n";
|
||||||
|
print "sets.value " . $memstats->{hosts}->{$address}->{misc}->{cmd_set} . "\n";
|
Loading…
Add table
Add a link
Reference in a new issue