本文共 5324 字,大约阅读时间需要 17 分钟。
nagios 监控memcached 的方法及其配置
2 是通过nagios 的自己的插件httpd_tcp 来监控memcached
3通过Nagios-Plugins-Memcached 来监控memcached,
Connected to 192.168.2.186 (192.168.2.186).
Escape character is '^]'.
STAT time 1290149053
STAT pointer_size 32
STAT rusage_user 0.006998
STAT rusage_system 0.017997
STAT curr_connections 5
STAT total_connections 52
STAT connection_structures 6
STAT delete_misses 0
STAT bytes_read 348
STAT bytes_written 36417
STAT limit_maxbytes 419430400
STAT accepting_conns 1
STAT listen_disabled_num 0
# check_tcp -H 192.168.2.186 -p 11211 -t 5 -E -s 'stats\r\nquit\r\n' -e 'uptime' -M crit
TCP OK - 0.002 second response time on port 11211 [STAT pid 437
STAT time 1290149407
STAT pointer_size 32
STAT rusage_user 0.006998
STAT rusage_system 0.017997
STAT curr_connections 5
STAT total_connections 56
STAT connection_structures 7
STAT delete_misses 0
STAT bytes_read 395
STAT bytes_written 38793
STAT limit_maxbytes 419430400
STAT accepting_conns 1
STAT listen_disabled_num 0
Are you ready for manual configuration? [yes]
CPAN build and cache directory? [/root/.cpan]
Perform cache scanning (atstart or never)? [atstart]
Your terminal expects ISO-8859-1 (yes/no)? [yes]
File to save your history? [/root/.cpan/histfile]
Policy on building prerequisites (follow, ask or ignore)? [ask]
Where is your tar program? [/bin/tar]
Where is your unzip program? [/usr/bin/unzip]
Where is your make program? [/usr/bin/make]
Where is your links program? [/usr/bin/links]
Where is your wget program? [/usr/bin/wget]
Warning: ncftpget not found in PATH
Where is your ncftpget program? []
Warning: ncftp not found in PATH
Where is your ncftp program? []
Where is your ftp program? [/usr/kerberos/bin/ftp]
Where is your gpg program? [/usr/bin/gpg]
What is your favorite pager program? [/usr/bin/less]
What is your favorite shell? [/bin/bash]
Select your continent (or several nearby continents) [] 2 注: 这是选择地区
Select your country (or several nearby countries) [] 1 注:这选国家
*** Checking for Perl dependencies...
- Cache::Memcached ...missing.
- Nagios::Plugin ...missing.
==> Auto-install the 3 mandatory module(s) from CPAN? [y]
4 查找安装后的check_memcached 的插件,并把该插件拷贝到nagios的插件的目录下面
command_line $USER1$/check_memcached -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$
command_line $USER1$/check_memcached -H $HOSTADDRESS$ --size-warning $ARG1$ --size-critical $ARG2$
command_line $USER1$/check_memcached -H $HOSTADDRESS$ --hit-warning $ARG1$ --hit-critical $ARG2$
use linux-box-remote