The actual environment is as follows:
10.0.0.167:6380
10.0.0.165:6379/6380
1. Download Redis Monitor Plugin
Download link Address:
Http://exchange.nagios.org/directory/Plugins/Databases/check_redis-2Epl/details
Https://github.com/willixix/WL-NagiosPlugins
2. Define Monitoring commands
Add the following in Commands.cfg:
# Check Redis
Define Command {
Command_name Check_redis
Command_line $USER 1$/check_redis.pl-h $HOSTADDRESS $-P $ARG 1$-a $ARG 2$-W $ARG 3$-C $ARG 4$-F
}
3. Define the Host
Define Host{
Use Linux-server; Inherit default values from a template
HOST_NAME 10.0.0.165; The name we ' re giving to this host
Alias Redis-linux; A longer name associated with the host
Address 10.0.0.165; IP Address of the host
}
Define Host{
Use Linux-server; Inherit default values from a template
HOST_NAME 10.0.0.167; The name we ' re giving to this host
Alias Redis-linux; A longer name associated with the host
Address 10.0.0.167; IP Address of the host
}
4. Define the host group
Define HostGroup {
Hostgroup_name redis_servers
Alias Redis Servers
Members 10.0.0.165,10.0.0.167
}
5. Define Service groups
Define Servicegroup{
Servicegroup_name redisservices
Alias Redis Services
}
6. Define Monitoring items
# Vim Redis-server.cfg
Define Service {
Use Generic-service,nagiosgraph
Hostgroup_name redis_servers
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,~,~
HOST_NAME!10.0.0.167
Servicegroups redisservices
}
Define Service {
Use Generic-service,nagiosgraph
Hostgroup_name redis_servers
Service_description Redis Client 6380
Check_command check_redis!6380! ' Connected_clients,blocked_clients,client_longest_output_list,client_biggest_input_buf '!100,5,~,~!500,10,~,~
Servicegroups redisservices
}
Define Service {
Use Generic-service,nagiosgraph
Hostgroup_name redis_servers
Service_description Redis Memory
Check_command check_redis!6379! ' Used_memory_human,used_memory_peak_human '!~,~!~,~
HOST_NAME!10.0.0.167
Servicegroups redisservices
}
Define Service {
Use Generic-service,nagiosgraph
Hostgroup_name redis_servers
Service_description Redis Memory 6380
Check_command check_redis!6380! ' Used_memory_human,used_memory_peak_human '!~,~!~,~
Servicegroups redisservices
}
Define Service {
Use Generic-service,nagiosgraph
Hostgroup_name redis_servers
Service_description Redis CPU
Check_command check_redis!6379! ' Used_cpu_sys,used_cpu_user,used_cpu_sys_children,used_cpu_user_children '!~,~,~,~!~,~,~,~; undefined monitoring alarm threshold
HOST_NAME!10.0.0.167; exclude 10.0.0.167 This station
Servicegroups redisservices
}
Define Service {
Use Generic-service,nagiosgraph
Hostgroup_name redis_servers
Service_description Redis CPU 6380
Check_command check_redis!6380! ' Used_cpu_sys,used_cpu_user,used_cpu_sys_children,used_cpu_user_children '!~,~,~,~!~,~,~,~
Servicegroups redisservices
}
7. Master Group diagram
8. Service Photos
9. The specific
Original from: ttlsa.com