Centos系统下载大全 | Redhat系统下载大全 | Windows2012系统下载大全 | Windows2008系统下载大全| CMS教程 | 网站地图 51运维网-专注Linux/Unix系统安全运维!
当前位置:51运维网 > 监控 > Nagios > 正文

nagios监控客户端(linux) 五

时间:2014-08-26 21:48 来源:未知 作者:www.51ou.com 阅读:

1 先看我们监控的对象

 

 

n1

2  学习监控的配置步骤

  我个人的使用方法:

       定义命令———–>定义主机—————>定义服务

3  那接下面我们配置监控客户端(客户端操作)

1
2
3
4
5
6
7
8
安装以下服务 apache   vsftpd     redis     memcached  mysql(这里的mysql要建议一个库,并创建一个用户对这个库有全部权限)
 
[root@51ou.com opt]# vi /usr/local/nagios/etc/nrpe.cfg
command[check_users]=/usr/local/nagios/libexec/check_users -w 5 -c 10
command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20
command[check_sda1]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p/dev/sda1
command[check_zombie_procs]=/usr/local/nagios/libexec/check_procs -w 5 -c 10 -s Z
command[check_total_procs]=/usr/local/nagios/libexec/check_procs -w 150 -c 200

4  按照我们的思路,定义命令

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
 
}
define command{
command_name check_mysql
command_line $USER1$/check_mysql -H $HOSTADDRESS$ -u $ARG1$ -p $ARG2$
}
 
 
 
#Memcached
### check response time(msec) for memcached
define command {
command_name check_memcached_response
command_line $USER1$/check_memcached -H $HOSTADDRESS$:11211 -w $ARG1$ -c $ARG2$
}
 
### check cache size ratio(bytes/limit_maxbytes[%]) for memcached
define command {
command_name check_memcached_size
command_line $USER1$/check_memcached -H $HOSTADDRESS$:11211
--size-warning $ARG1$ --size-critical $ARG2$
}
 
### check cache hit ratio(get_hits/cmd_get[%]) for memcached
define command {
command_name check_memcached_hit
command_line $USER1$/check_memcached -H $HOSTADDRESS$:11211
--hit-warning $ARG1$ --hit-critical $ARG2$
}
 
 
# check redis
define command {
command_name check_redis
command_line $USER1$/check_redis.pl -H $HOSTADDRESS$ -p
$ARG1$ -a $ARG2$ -w $ARG3$ -c $ARG4$ -f
}

 

5  定义主机和服务

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
[root@51ou.com opt]# cat /usr/local/nagios/etc/objects/linhost.cfg
define host{
        use                     linux-server
        host_name               linhost
        alias                   lvs linux node
        address                 192.168.250.198
}
 
 
define service{
        use                     generic-service
        host_name               linhost
        service_description     check_users
        check_command           check_nrpe!check_users
}
define service{
        use                     generic-service
        host_name               linhost
        service_description     Load
        check_command           check_nrpe!check_load
}
define service{
        use                     generic-service
        host_name               linhost
        service_description     sda1
        check_command           check_nrpe!check_sda1
}
define service{
        use                     generic-service
        host_name               linhost
        service_description     zombie
        check_command           check_nrpe!check_zombie_procs
}
define service{
        use                     generic-service
        host_name               linhost
        service_description     total
        check_command           check_nrpe!check_total_procs
}
define service{
        use                     generic-service
        host_name               linhost
        service_description     apache
        check_command           check_http
}
define service{
        use                     generic-service
        host_name               linhost
        service_description     mysqld
        check_command           check_mysql!nagios!123456
}
define service{
        use                     generic-service
        host_name               linhost
        service_description     vsftpd
        check_command           check_ftp
}
define service{
        use                     generic-service
        host_name               linhost
        service_description     Memcached_response
        check_command           check_memcached_response!300!500
}
 
define service{
        use                     generic-service
        host_name               linhost
        service_description     Memcached_size
        check_command           check_memcached_size!90!95
}
define service{
        use                     generic-service
        host_name               linhost
        service_description     Memcached_hit
        check_command           check_memcached_hit!10!5
}
define service{
        use                     generic-service
        host_name               linhost
        service_description     Redis Client
        check_command           check_redis!6379!'connected_clients,blocked_clients,
client_longest_output_list,client_biggest_input_buf'!100,5,~,~!500,10,~,~
 
}
define service{
        use                     generic-service
        host_name               linhost
        service_description     Redis Memory
        check_command           check_redis!6379!'used_memory_human,used_memory_peak_human'!~,~!~,~
}
define service{
        use                     generic-service
        host_name               linhost
        service_description     Redis CPU
        check_command           check_redis!6379!'used_cpu_sys,used_cpu_user
,used_cpu_sys_children,used_cpu_user_children'!~,~,~,~!~,~,~,~
}

感谢您对【51运维网 http://www.51ou.com/】的支持,我们为您免费提供《nagios监控客户端(linux) 五》技术文章,《nagios监控客户端(linux) 五》详细使用和说明,有时《nagios监控客户端(linux) 五》可能不完善、敬请谅解!如果《nagios监控客户端(linux) 五》有错误请给我们留言,我们将尽快修复文章错误,如果您觉得本站不错,请分享给周围的朋友!谢谢!

顶一下
(0)
0%
踩一下
(0)
0%
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
验证码:点击我更换图片