察看check_disk插件程序的使用
[iyunv@KCentOS5C ~]# /usr/local/nagios/libexec/check_disk -h
------------------------------------------------------------------
check_disk v1793 (nagios-plugins 1.4.10)
Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>
Copyright (c) 1999-2006 Nagios Plugin Development Team
<nagiosplug-devel@lists.sourceforge.net>
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
至于$USER1$/check_disk这个变量路径是在哪里指定的呢?其实这个就是定义在Nagios的资源文件resource.cfg里面了。
[iyunv@KCentOS5C ~]# vi /usr/local/nagios/etc/resource.cfg
------------------------------------------------------------------
# Sets $USER1$ to be the path to the plugins
$USER1$=/usr/local/nagios/libexec
这里就定义$USER1$这个路径变量,用来帮助Nagios找到自己的plugins插件程序的位置。
------------------------------------------------------------------
<check_tcp>
Usage:check_tcp -H host -p port [-w <warning time>] [-c <critical time>] [-s <send string>]
[-e <expect string>] [-q <quit string>][-m <maximum bytes>] [-d <delay>]
[-t <timeout seconds>] [-r <refuse state>] [-M <mismatch state>] [-v] [-4|-6] [-j]
[-D <days to cert expiry>] [-S <use SSL>] [-E]
-w, --warning=DOUBLE
Response time to result in warning status (seconds)
-c, --critical=DOUBLE
Response time to result in critical status (seconds)
-H, --hostname=ADDRESS
Host name, IP Address, or unix socket (must be an absolute path)
-p, --port=INTEGER
Port number (default: none)
------------------------------------------------------------------
<check_check_local_disk>
Usage: check_disk -w limit -c limit [-W limit] [-K limit] {-p path | -x device}
[-C] [-E] [-e] [-g group ] [-k] [-l] [-M] [-m] [-R path ] [-r path ]
[-t timeout] [-u unit] [-v] [-X type]
-w, --warning=INTEGER
Exit with WARNING status if less than INTEGER units of disk are free
-w, --warning=PERCENT%
Exit with WARNING status if less than PERCENT of disk space is free
-c, --critical=INTEGER
Exit with CRITICAL status if less than INTEGER units of disk are free
-c, --critical=PERCENT%
Exit with CRITCAL status if less than PERCENT of disk space is free
-p, --path=PATH, --partition=PARTITION
Path or partition (may be repeated)
------------------------------------------------------------------
4.本地系统监测服务:监测本地主机运行进程数。
------------------------------------------------------------------
<localhost.cfg>
define service{
use local-service
host_name localhost
service_description Total Processes
check_command check_local_procs!250!400!RSZDT
}
<check_ping>
Usage:check_procs -w <range> -c <range> [-m metric] [-s state] [-p ppid]
[-u user] [-r rss] [-z vsz] [-P %cpu] [-a argument-array]
[-C command] [-t timeout] [-v]
Required Arguments:
-w, --warning=RANGE
Generate warning state if metric is outside this range
-c, --critical=RANGE
Generate critical state if metric is outside this range
Optional Filters:
-s, --state=STATUSFLAGS
Only scan for processes that have, in the output of `ps`, one or
more of the status flags you specify (for example R, Z, S, RS,
RSZDT, plus others based on the output of your 'ps' command).
------------------------------------------------------------------