在么,我们来讲讲如何让nagios来监控memcached吧。
需要一些perl的modules
1. Nagios::Plugin
2. Nagios::Plugins::Memcached
3. Carp::Clan
其他的你可能还会缺,安装的时候使用sudo make install -B来看看吧~~
安装的时候执行以下三步来进行安装:
$ perl Makefile.PL
$ make
$ sudo make install
找找你的nagios的配置文件,又一个叫commands.cfg的,添加以下内容:
### check response time(msec) for memcached
define command {
command_name check_memcached_response
command_line /usr/local/bin/check_memcached -H $HOSTADDRESS$ -w 300 -c 500 #这地方的数值是msec!
}
### check cache size ratio(bytes/limit_maxbytes[%]) for memcached
define command {
command_name check_memcached_size
command_line /usr/local/bin/check_memcached -H $HOSTADDRESS$ --size-warning 90 --size-critical 95
}
### check cache hit ratio(get_hits/cmd_get[%]) for memcached
define command {
command_name check_memcached_hit
command_line /usr/local/bin/check_memcached -H $HOSTADDRESS$ --hit-warning 10 --size-critical 5
}
你可以根据自己的需要修改阀值。
剩下的都是你去配置自己服务所需要的监控了~~
原贴:http://li3.cn/?action=show&id=622