脚本源自:exchange.nagios.org,由ewayfly修改完成。
复制代码代码如下:
#!/bin/bash
# Return codes:
# Arguments: # Right number of args?
if [ $# -ne 3 ] # Does $DIRECTORY exist?
if [ ! -d $DIRECTORY ]; then # Is the crit level less than the warn level?
if [ $CRITLEVEL -lt $WARNLEVEL -o $CRITLEVEL -eq $WARNLEVEL ]; then
# Do we have grep/wc installed?
if [ $grepproc == "" ]; then
if [ $wcproc == "" ]; then
# Get current file count:
if [ $FCOUNT -lt $WARNLEVEL ]
应用举例:
复制代码代码如下:
define service{
(责任编辑:IT)host_name client-233 use generic-service check_command check_nrpe!check_dir_count service_description check_curr_dir_filecount notifications_enabled 1 event_handler_enabled 1 notification_period t247 check_period t247 max_check_attempts 3 check_interval 5 contact_groups tech-admins retry_check_interval 2 notification_options w,u,c } |