分类: LINUX
2010-02-10 14:09:31
[root@server1 libexec]# ./check_disk -h
check_disk (nagios-plugins 1.4.9) 1.91
Copyright (c) 1999 Ethan Galstad <>
Copyright (c) 1999-2006 Nagios Plugin Development Team
This plugin checks the amount of used disk space on a mounted file system
and generates an alert if free space is less than one of the threshold values
Usage: check_disk -w limit -c limit [-p path | -x device] [-t timeout][-m] [-e] [-W limit] [-K limit] [-v] [-q] [-E]
Options:
……以下略 |
################################################################################
#
# SAMPLE HOST CHECK COMMANDS
#
################################################################################
# This command checks to see if a host is "alive" by pinging it
# The check must result in a 100% packet loss or 5 second (5000ms) round trip
# average time to produce a critical error.
# Note: Only one ICMP echo packet is sent (determined by the '-p 1' argument)
# 'check-host-alive' command definition
define command{
command_name check-host-alive
command_line $USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 1
} |
# 'check_local_disk' command definition
define command{
command_name check_local_disk
command_line $USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
} |
services.cfg定义监控项目用某个命令
↓
这个命令必须在commands.cfg中定义
↓
定义这个命令时使用了libexec下的插件 |
define service{
host_name nagios-server
要监控的机器,给出机器名,注意必须是hosts.cfg中定义的
service_description check ftp
给这个监控项目起个名字吧,任意起,你自己懂就行
check_command check_ftp
所用的命令,当然必须是commands.cfg中定义了的
max_check_attempts 5
normal_check_interval 3
retry_check_interval 2
check_period 24x7
notification_interval 10
notification_period 24x7
notification_options w,u,c,r
contact_groups sagroup
} |
define service{
host_name dbpi
意义同上
service_description check-ssh
意义同上
check_command check_tcp!22
ssh所用的tcp的22号端口,我就用commands中定义的check_tcp命令.至于!22的意思不用我说了吧.
max_check_attempts 5
normal_check_interval 3
retry_check_interval 2
check_period 24x7
notification_interval 10
notification_period 24x7
notification_options w,u,c,r
contact_groups sagroup
} |
define service{
host_name yahoon
service_description check-http
check_command check_http
max_check_attempts 5
normal_check_interval 3
retry_check_interval 2
check_period 24x7
notification_interval 10
notification_period 24x7
notification_options w,u,c,r
contact_groups sagroup
} |
define service{
host_name nagios-server
service_description check disk
check_command check_local_disk!10%!5%!/
max_check_attempts 5
normal_check_interval 3
retry_check_interval 2
check_period 24x7
notification_interval 10
notification_period 24x7
notification_options w,u,c,r
contact_groups sagroup
} |