Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

398 lines (331 sloc) 14.448 kb
################################################################################
# commands.cfg - Main commands definition file
#===============================================================================
# This file show sample command definitions which are commonly used to monitor
# systems, websites, databases, etc.
#
# See also "pack/*/*/commands.cfg".
#
# You need the Nagios plugins installed under $PLUGINSDIR$ (see resource.cfg)
# in order to use most of these commands. For your own network you may need
# other plugins, which you can write yourself or find at Nagios Exchange.
#
# This file has three sections for easier reading:
# - Localhost_checks
# - Network_checks
# - Host_alive_checks
# - Notification_commands
# - Discovery_commands
# (You can use section names to jump there)
#===============================================================================
# Reference: http://www.shinken-monitoring.org/wiki/official/configuringshinken/configobjects/command
# Nagios Plugins: http://www.nagios.org/download/plugins/
# Nagios Exchange (Plugins repository): http://exchange.nagios.org/
################################################################################
################################################################################
# Localhost_checks
#===============================================================================
# Download:
# - Included in Nagios Plugins.
# - check_local_mem:
# https://github.com/justintime/nagios-plugins
################################################################################
## Check free space on local disks
# 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.
# 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]
define command {
command_name check_local_disks
command_line $PLUGINSDIR$/check_disk -w 10% -c 5% -x /dev/shm -e -l
}
## Check local load
# This plugin tests the current system load average.
# check_load [-r] -w WLOAD1,WLOAD5,WLOAD15 -c CLOAD1,CLOAD5,CLOAD15
define command {
command_name check_local_load
command_line $PLUGINSDIR$/check_load -w 3,3,3 -c 5,5,5
}
## Check used memory
# check_mem.pl -<f|u> -w <warnlevel> -c <critlevel>
define command {
command_name check_local_mem
command_line $PLUGINSDIR$/check_mem.pl -u -w 90 -c 95
}
## Check swap space on local machine.
# check_swap [-av] -w <percent_free>% -c <percent_free>%
# check_swap [-av] -w <bytes_free> -c <bytes_free>
define command {
command_name check_local_swap
command_line $PLUGINSDIR$/check_swap -w 50% -c 25%
}
################################################################################
# Network_checks
#===============================================================================
# Download:
# - Included in Nagios Plugins.
# - check_nrpe:
# http://exchange.nagios.org/directory/Addons/Monitoring-Agents/NRPE--2D-Nagios-Remote-Plugin-Executor/details
# - check_snmp_*:
# ???
################################################################################
## Check a TCP port
# This plugin tests TCP connections with the specified host (or unix socket).
# 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 <warn days cert expire>[,<crit days cert expire>]] [-S
# <use SSL>] [-E]
define command {
command_name check_tcp
command_line $PLUGINSDIR$/check_tcp -H $HOSTADDRESS$ -p $ARG1$
}
## Check a DNS entry
## This plugin test the DNS service on the specified host using dig
# check_dig -l <query_address> [-H <host>] [-p <server port>] [-T <query type>]
# [-w <warning interval>] [-c <critical interval>] [-t <timeout>] [-a <expected
# answer address>] [-v]
define command {
command_name check_dig
command_line $PLUGINSDIR$/check_dig -H $HOSTADDRESS$ -l $ARG1$
}
## Check ping command
## Use ping to check connection statistics for a remote host.
# check_ping -H <host_address> -w <wrta>,<wpl>% -c <crta>,<cpl>% [-p packets]
# [-t timeout] [-4|-6]
define command {
command_name check_ping
command_line $PLUGINSDIR$/check_ping -H $HOSTADDRESS$ -w 3000,100% -c 5000,100% -p 1
}
## Check Oracle status
# check_oracle --tns <Oracle Sid or Hostname/IP address>
# check_oracle --db <ORACLE_SID>
# etc. (see plugin's help)
define command {
command_name check_oracle_listener
command_line $PLUGINSDIR$/check_oracle --tns $HOSTADDRESS$
}
## Ask a NRPE agent
## Requires that you have the NRPE daemon running on the remote host.
# check_nrpe -H <host> [-n] [-u] [-p <port>] [-t <timeout>] [-c <command>] [-a
# <arglist...>]
define command {
command_name check_nrpe
command_line $PLUGINSDIR$/check_nrpe -H $HOSTADDRESS$ -t 9 -u -c $ARG1$
#module_type nrpe_poller
}
## Ask a NRPE agent with arguments (passing arguments may be a security risk)
## Requires that you have the NRPE daemon running on the remote host.
# check_nrpe -H <host> [-n] [-u] [-p <port>] [-t <timeout>] [-c <command>] [-a
# <arglist...>]
define command {
command_name check_nrpe_args
command_line $PLUGINSDIR$/check_nrpe -H $HOSTADDRESS$ -t 9 -u -c $ARG1$ -a $ARG2$ $ARG3$ $ARG4$ $ARG5$
#module_type nrpe_poller
}
# Check SNMP service presence on target
define command {
command_name check_snmp_service
command_line $PLUGINSDIR$/check_snmp_service -H $HOSTADDRESS$ -C $SNMPCOMMUNITYREAD$
}
# Compare time between target and shinken
define command {
command_name check_snmp_time
command_line $PLUGINSDIR$/check_snmp_time.pl -H $HOSTADDRESS$ -C $SNMPCOMMUNITYREAD$ -f -w $ARG1$ -c $ARG2$
}
# Check filesystem usage over SNMP
define command {
command_name check_snmp_storage
command_line $PLUGINSDIR$/check_snmp_storage.pl -H $HOSTADDRESS$ -C $SNMPCOMMUNITYREAD$ -T pl -f -m $ARG1$ -w $ARG2$ -c $ARG3$
}
# Same but special OID for HPUX
define command {
command_name check_snmp_hpux_storage
command_line $PLUGINSDIR$/check_snmp_hpux_storage.pl -H $HOSTADDRESS$ -C $SNMPCOMMUNITYREAD$ -T pl -f -m $ARG1$ -w $ARG2$ -c $ARG3$
}
################################################################################
# application performance monitoring checks (end user experience)
#===============================================================================
# Download:
# - Included in shinken.
# This check is in alpha release and should be enabled with the following
# installer command : ./install --enableeue
# This is based on cucumber (see http://cukes.info)
################################################################################
define command {
command_name check_eue
command_line /usr/bin/cucumber --format Eue::Shinken $PLUGINSDIR$/eue/$ARG1$.feature
timeout 60
}
################################################################################
# Host_alive_checks
################################################################################
define command {
command_name check_host_alive
command_line $PLUGINSDIR$/check_ping -H $HOSTADDRESS$ -w 1,50% -c 2,70% -p 1
#poller_tag DMZ
#module_type nrpe_poller
}
define command {
command_name check_linux_host_alive
command_line $PLUGINSDIR$/check_tcp -H $HOSTADDRESS$ -p 22 -t 3
#poller_tag DMZ
#module_type nrpe_poller
}
define command {
command_name check_windows_host_alive
command_line $PLUGINSDIR$/check_tcp -H $HOSTADDRESS$ -p 139 -t 3
#poller_tag DMZ
#module_type nrpe_poller
}
################################################################################
# Commands you probably don't need.
# TODO: Remove them, no?
################################################################################
define command {
command_name check-host-alive
command_line $PLUGINSDIR$/check.sh $HOSTADDRESS$ -c $ARG1$ HOST $_HOSTDELLSUCK$ $SERVICEDESC:srv-1:Service-2$ $SERVICEDESC::Service-30$ $HOSTADDRESS:$ $HOSTGROUPALIAS:linux-servers$
#module_type dummy_poller
}
define command {
command_name check_local_disk
command_line $PLUGINSDIR$/check.sh $HOSTADDRESS$ -c $ARG1$ SERVICE $USER1$
#poller_tag DMZ
#module_type nrpe_poller
}
# Dummy check port command
define command {
command_name check_port
command_line /bin/ping localhost -c 1
#command_line $PLUGINSDIR$/check.sh $HOSTADDRESS$ -c $ARG1$
#poller_tag DMZ
#module_type nrpe_poller
}
# Dummy check for mysql, always CRITICAL
define command {
command_name check_mysql
command_line $PLUGINSDIR$/check_dummy.sh 2
}
define command {
command_name check_dummy
command_line $PLUGINSDIR$/check_dummy.sh $ARG1$
#poller_tag DMZ
}
define command {
command_name check_utf8
command_line $PLUGINSDIR$/check_utf8.sh
}
define command {
command_name super_event_kill_everyone
command_line $PLUGINSDIR$/check.sh $HOSTADDRESS$ -c $ARG1$ SERVICE $_HOSTDELLSUCK$
}
# We say Http checks are always OK
define command {
command_name check_http2
command_line $PLUGINSDIR$/check_dummy.sh 1
#module_type nrpe_poller
}
define command {
command_name check_vm_cpu
command_line $PLUGINSDIR$/check_esx3.pl -H lulu
}
################################################################################
# Notification_commands
#===============================================================================
# Download:
# - notify-*-by-email:
# Use 'printf' and 'mail' system tools. (you may need to update their
# paths, ie. "/bin/mail" instead of "/usr/bin/mail").
# - notify-*-by-xmpp:
# The Python script is in the libexec folder of the Shinken's sources.
# It need the Python XMPP module.
# On supported distributions, this addon can be installed and configured by
# ./install -a notify_by_xmpp
# - notify-*-by-android-sms:
# Use Shinken reactionner (see shinken-specific.cfg).
################################################################################
## Notify Host by Email
define command {
command_name notify-host-by-email
command_line /usr/bin/printf "%b" "Shinken Notification\n\nType:$NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\nDate/Time: $DATE$\n" | /usr/bin/mail -s "Host $HOSTSTATE$ alert for $HOSTNAME$!" $CONTACTEMAIL$
}
## Notify Service by Email
define command {
command_name notify-service-by-email
command_line /usr/bin/printf "%b" "Shinken Notification\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $DATE$ Additional Info : $SERVICEOUTPUT$\n" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}
## Notify Host by XMPP
define command {
command_name notify-host-by-xmpp
command_line $PLUGINSDIR$/notify_by_xmpp.py -a $PLUGINSDIR$/notify_by_xmpp.ini "Host '$HOSTNAME$' is $HOSTSTATE$ - Info : $HOSTOUTPUT$" $CONTACTEMAIL$
}
## Notify Service by XMPP
define command {
command_name notify-service-by-xmpp
command_line $PLUGINSDIR$/notify_by_xmpp.py -a $PLUGINSDIR$/notify_by_xmpp.ini "$NOTIFICATIONTYPE$ $HOSTNAME$ $SERVICEDESC$ $SERVICESTATE$ $SERVICEOUTPUT$ $LONGDATETIME$" $CONTACTEMAIL$
}
## Notify Host by SMS (through an Android phone)
# You need both reactionner_tag and module_type in most cases!
define command {
command_name notify-host-by-android-sms
command_line android_sms $CONTACTPAGER$ Host: $HOSTNAME$\nAddress: $HOSTADDRESS$\nState: $HOSTSTATE$\nInfo: $OUTPUT$\nDate: $DATETIME$
reactionner_tag android_sms
module_type android_sms
}
## Notify Service by SMS (through an Android phone)
# You need both reactionner_tag and module_type in most cases!
define command {
command_name notify-service-by-android-sms
command_line android_sms $CONTACTPAGER$ Service: $SERVICEDESC$\nHost: $HOSTNAME$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\nInfo: $OUTPUT$\nDate: $DATETIME$
reactionner_tag android_sms
module_type android_sms
}
################################################################################
# Skonf related commands
#===============================================================================
define command {
command_name restart_shinken
command_line sudo /etc/init.d/shinken restart
}
define command {
command_name reload_shinken
command_line sudo /etc/init.d/shinken reload
}
define command {
command_name configuration_check
command_line sudo /etc/init.d/shinken check
}
################################################################################
# Discovery_commands
#===============================================================================
# Download:
# - nmap_discovery, vmware_esx_discovery:
# Shinken's sources (in libexec)
# - fs_discovery, cluster_discovery:
# ???
################################################################################
## NMAP Discovery
# nmap_discovery_runner.py [options] -t nmap scanning targets
define command {
command_name nmap_discovery
command_line $PLUGINSDIR$/nmap_discovery_runner.py --min-rate $NMAPMINRATE$ --max-retries $NMAPMAXRETRIES$ -t $NMAPTARGETS$
}
## VMWare ESX Discovery
# vmware_discovery_runner.py [options]
define command {
command_name vmware_esx_discovery
command_line $PLUGINSDIR$/vmware_discovery_runner.py -V $VCENTER$ -u $VCENTERLOGIN$ -p $VCENTERPASSWORD$ -r "lower|nofqdn"
}
##
#
define command {
command_name fs_discovery
command_line $PLUGINSDIR$/fs_discovery_runner.py -H $HOSTNAME$ -C $SNMPCOMMUNITYREAD$ -O $ARG1$ -m tags
}
##
#
define command {
command_name cluster_discovery
command_line $PLUGINSDIR$/cluster_discovery_runner.py -H $HOSTNAME$ -C $SNMPCOMMUNITYREAD$ -O $ARG1$
}
Jump to Line
Something went wrong with that request. Please try again.