check_dns v1992 (nagios-plugins 1.4.13)
Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>
Copyright (c) 2000-2008 Nagios Plugin Development Team
<nagiosplug-devel@lists.sourceforge.net>
This plugin uses the nslookup program to obtain the IP address for the given host/domain query.
An optional DNS server to use may be specified.
If no DNS server is specified, the default server(s) specified in /etc/resolv.conf will be used.
Usage:check_dns -H host [-s server] [-a expected-address] [-A] [-t timeout] [-w warn] [-c crit]
Options:
-h, --help
Print detailed help screen
-V, --version
Print version information
-H, --hostname=HOST
The name or address you want to query
-s, --server=HOST
Optional DNS server you want to use for the lookup
-a, --expected-address=IP-ADDRESS|HOST
Optional IP-ADDRESS you expect the DNS server to return. HOST must end with
a dot (.). This option can be repeated multiple times (Returns OK if any
value match). If multiple addresses are returned at once, you have to match
the whole string of addresses separated with commas (sorted alphabetically).
-A, --expect-authority
Optionally expect the DNS server to be authoritative for the lookup
-w, --warning=seconds
Return warning if elapsed time exceeds value. Default off
-c, --critical=seconds
Return critical if elapsed time exceeds value. Default off
-t, --timeout=INTEGER
Seconds before connection times out (default: 10)
Send email to nagios-users@lists.sourceforge.net if you have questions
regarding use of this software. To submit patches or suggest improvements,
send email to nagiosplug-devel@lists.sourceforge.net
define command{
command_name check-host-alive
command_line $USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 1
}
host_name CentOS-Server //这个名字我已经在hosts.cgf有定义,他的IP是192.168.1.105
service_descripti插件的命令调用on check-host-alive //标识,在nagios的web管理显示
check_command check-host-alive //( 插件的命令调用 )
max_check_attempts 5
check_period 24x7
normal_check_interval 3
notification_interval 10
notification_period 24x7
notification_options w,u,c,r
contact_groups admins
}
# 'check_local_disk' command definition
define command{
command_name check_local_disk
command_line $USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
}
check_local_disk实际上是执行的check_disk插件.这里的$ARG1$, $ARG2$, $ARG3$是三个变量,要我们在使用它的时侯为他们赋值,在之前我们已经提到了这个check_disk这个插件的用法,-w的参数指定磁盘剩了多少是警告状态,-c的参数指定剩多少是严重状态,-p用来指定路径.
define service{
host_name localhost
service_description check-local-disk
check_command check_local_disk!10%!5%!/
max_check_attempts 5
.......
notification_options w,u,c,r
contact_groups admins
}
b、这个命令必须在commands.cfg中定义
c、定义这个命令时使用了libexec下的插件
如果命令不带$ARG1$就可以在services.cfg中直接使用,如果带了使用时就带上参数,以!相隔。