Nagios::Plugins::Memcached - Nagios plugin to observe memcached.
version 0.02
use Nagios::Plugins::Memcached; my $np = Nagios::Plugins::Memcached->new; $np->run;
Please setup your nagios config.
### check response time(msec) for memcached define command { command_name check_memcached_response command_line /usr/bin/check_memcached -H $HOSTADDRESS$ -w 3 -c 5 } ### check cache size ratio(bytes/limit_maxbytes[%]) for memcached define command { command_name check_memcached_size command_line /usr/bin/check_memcached -H $HOSTADDRESS$ --size-warning 60 --size-critical 80 } ### check cache hit ratio(get_hits/cmd_get[%]) for memcached define command { command_name check_memcached_hit command_line /usr/bin/check_memcached -H $HOSTADDRESS$ --hit-warning 40 --size-critical 20 }
This plugin can execute with all threshold options together.
Usage for check_memcached command.
Usage: check_memcached [-H host] [-w warnings] [-c critical] [--size-warnng size-warnng] [--size-critical size-critical] [--hit-warning hit-warning] [--hit-critical hit-critical] [-t timeout] [-v] [-h] [-?] [-V] [--extra-opts section@config_file] -?, --usage Print usage information -h, --help Print detailed help screen -V, --version Print version information --extra-opts=[<section>[@<config_file>]] Section and/or config_file from which to load extra options (may repeat) -H, --hosts=ADDRESS[:PORT] or HOSTNAME[:PORT] or UNIX_SOCKET Available multiple value. default is localhost:11211 -w, --warnings=INTEGER Time threshold on warning. This unit of the value is msec. -c, --critical=INTEGER Time threshold on critical. This unit of the value is msec. --size-warning=INTEGER Size threshold on warning. This unit of the value is percent. --size-critical=INTEGER Size threshold on critical. This unit of the value is percent. --hit-warning=INTEGER Hit threshold on warning. This unit of the value is percent. --hit-critical=INTEGER Hit threshold on critical. This unit of the value is percent. -t, --timeout=INTEGER Seconds before plugin times out (default: 15) -v, --verbose Show details for command-line debugging (can repeat up to 3 times)
Default value of connection timeout(sec) between the memcached server.
create instance.
setup this plugin.
setup arguments.
run checks.
check execute times of stats.
check using bytes ratio.
check cache hit ratio.
Detecting runmode.
Add default port(11211) if not exists specified port.
Toru Yamaguchi, <zigorou@cpan.org>
<zigorou@cpan.org>
Please report any bugs or feature requests to bug-nagios-plugins-memcached@rt.cpan.org, or through the web interface at http://rt.cpan.org. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-nagios-plugins-memcached@rt.cpan.org
Copyright 2007 Toru Yamaguchi, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Nagios::Plugins::Memcached, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Nagios::Plugins::Memcached
CPAN shell
perl -MCPAN -e shell install Nagios::Plugins::Memcached
For more information on module installation, please visit the detailed CPAN module installation guide.