172 lines
6.4 KiB
INI
172 lines
6.4 KiB
INI
|
|
###############################################################################
|
||
|
|
# COMMANDS.CFG - SAMPLE COMMAND DEFINITIONS FOR NAGIOS 3.5.0
|
||
|
|
#
|
||
|
|
# Last Modified: 05-31-2007
|
||
|
|
#
|
||
|
|
# NOTES: This config file provides you with some example command definitions
|
||
|
|
# that you can reference in host, service, and contact definitions.
|
||
|
|
#
|
||
|
|
# You don't need to keep commands in a separate file from your other
|
||
|
|
# object definitions. This has been done just to make things easier to
|
||
|
|
# understand.
|
||
|
|
#
|
||
|
|
###############################################################################
|
||
|
|
|
||
|
|
|
||
|
|
################################################################################
|
||
|
|
#
|
||
|
|
# SAMPLE NOTIFICATION COMMANDS
|
||
|
|
#
|
||
|
|
# These are some example notification commands. They may or may not work on
|
||
|
|
# your system without modification. As an example, some systems will require
|
||
|
|
# you to use "/usr/bin/mailx" instead of "/usr/bin/mail" in the commands below.
|
||
|
|
#
|
||
|
|
################################################################################
|
||
|
|
|
||
|
|
|
||
|
|
# 'notify-host-by-email' command definition
|
||
|
|
define command{
|
||
|
|
command_name notify-host-by-email
|
||
|
|
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
|
||
|
|
}
|
||
|
|
|
||
|
|
# 'notify-service-by-email' command definition
|
||
|
|
define command{
|
||
|
|
command_name notify-service-by-email
|
||
|
|
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n" | /bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
################################################################################
|
||
|
|
#
|
||
|
|
# SAMPLE HOST CHECK COMMANDS
|
||
|
|
#
|
||
|
|
################################################################################
|
||
|
|
|
||
|
|
# - these commands are now in nagios-plugins/config. see ping.cfg
|
||
|
|
|
||
|
|
################################################################################
|
||
|
|
#
|
||
|
|
# SAMPLE SERVICE CHECK COMMANDS
|
||
|
|
#
|
||
|
|
# These are some example service check commands. They may or may not work on
|
||
|
|
# your system, as they must be modified for your plugins. See the HTML
|
||
|
|
# documentation on the plugins for examples of how to configure command definitions.
|
||
|
|
#
|
||
|
|
# NOTE: The following 'check_local_...' functions are designed to monitor
|
||
|
|
# various metrics on the host that Nagios is running on (i.e. this one).
|
||
|
|
################################################################################
|
||
|
|
|
||
|
|
# '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_load' command definition
|
||
|
|
define command{
|
||
|
|
command_name check_local_load
|
||
|
|
command_line $USER1$/check_load -w $ARG1$ -c $ARG2$
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
# 'check_local_procs' command definition
|
||
|
|
define command{
|
||
|
|
command_name check_local_procs
|
||
|
|
command_line $USER1$/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
# 'check_local_users' command definition
|
||
|
|
define command{
|
||
|
|
command_name check_local_users
|
||
|
|
command_line $USER1$/check_users -w $ARG1$ -c $ARG2$
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
# 'check_local_swap' command definition
|
||
|
|
define command{
|
||
|
|
command_name check_local_swap
|
||
|
|
command_line $USER1$/check_swap -w $ARG1$ -c $ARG2$
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
# 'check_local_mrtgtraf' command definition
|
||
|
|
define command{
|
||
|
|
command_name check_local_mrtgtraf
|
||
|
|
command_line $USER1$/check_mrtgtraf -F $ARG1$ -a $ARG2$ -w $ARG3$ -c $ARG4$ -e $ARG5$
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
################################################################################
|
||
|
|
# NOTE: The following 'check_...' commands are used to monitor services on
|
||
|
|
# both local and remote hosts.
|
||
|
|
################################################################################
|
||
|
|
|
||
|
|
# 'check_snmp' command definition
|
||
|
|
define command{
|
||
|
|
command_name check_snmp
|
||
|
|
command_line $USER1$/check_snmp -H $HOSTADDRESS$ $ARG1$
|
||
|
|
}
|
||
|
|
|
||
|
|
################################################################################
|
||
|
|
# NOTE: The following 'check_nrpe' commands are used to monitor services on
|
||
|
|
# remote hosts, using custom scripts and the nrpe server on the remote
|
||
|
|
# hosts.
|
||
|
|
################################################################################
|
||
|
|
|
||
|
|
# Check disk space command using usedspace_bash
|
||
|
|
define command{
|
||
|
|
command_name usedspace_bash
|
||
|
|
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c usedspace_bash
|
||
|
|
}
|
||
|
|
|
||
|
|
# Check nikki (bot) using check_nikki
|
||
|
|
define command{
|
||
|
|
command_name checknikki_bash
|
||
|
|
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -t 60 -c checknikki_bash
|
||
|
|
}
|
||
|
|
|
||
|
|
# Check bugbot using checkbugbot_bash
|
||
|
|
define command{
|
||
|
|
command_name checkbugbot_bash
|
||
|
|
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c checkbugbot_bash
|
||
|
|
}
|
||
|
|
|
||
|
|
# Check broadcastbot using checkbroadcastbot_bash
|
||
|
|
define command{
|
||
|
|
command_name checkbroadcastbot_bash
|
||
|
|
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -t 60 -c checkbroadcastbot_bash
|
||
|
|
}
|
||
|
|
|
||
|
|
################################################################################
|
||
|
|
#
|
||
|
|
# SAMPLE PERFORMANCE DATA COMMANDS
|
||
|
|
#
|
||
|
|
# These are sample performance data commands that can be used to send performance
|
||
|
|
# data output to two text files (one for hosts, another for services). If you
|
||
|
|
# plan on simply writing performance data out to a file, consider using the
|
||
|
|
# host_perfdata_file and service_perfdata_file options in the main config file.
|
||
|
|
#
|
||
|
|
################################################################################
|
||
|
|
|
||
|
|
|
||
|
|
# 'process-host-perfdata' command definition
|
||
|
|
define command{
|
||
|
|
command_name process-host-perfdata
|
||
|
|
command_line /usr/bin/printf "%b" "$LASTHOSTCHECK$\t$HOSTNAME$\t$HOSTSTATE$\t$HOSTATTEMPT$\t$HOSTSTATETYPE$\t$HOSTEXECUTIONTIME$\t$HOSTOUTPUT$\t$HOSTPERFDATA$\n" >> /usr/local/nagios/var/host-perfdata.out
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
# 'process-service-perfdata' command definition
|
||
|
|
define command{
|
||
|
|
command_name process-service-perfdata
|
||
|
|
command_line /usr/bin/printf "%b" "$LASTSERVICECHECK$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICESTATE$\t$SERVICEATTEMPT$\t$SERVICESTATETYPE$\t$SERVICEEXECUTIONTIME$\t$SERVICELATENCY$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$\n" >> /usr/local/nagios/var/service-perfdata.out
|
||
|
|
}
|
||
|
|
|
||
|
|
|