source: noc/nagios/misccommands.cfg @ 48

Last change on this file since 48 was 48, checked in by presbrey, 18 years ago
scripts.mit.edu NOC nagios configuration
File size: 4.3 KB
Line 
1################################################################################
2# Sample object config file for Nagios
3#
4# Read the documentation for more information on this configuration file.  I've
5# provided some comments here, but things may not be so clear without further
6# explanation, so make sure to read the HTML documentation!
7#
8# Last Modified: 12-17-2005
9#
10################################################################################
11
12
13################################################################################
14# COMMAND DEFINITIONS
15#
16# SYNTAX:
17#
18#       define command{
19#               template      <templatename>
20#               name          <objectname>
21#               command_name  <commandname>
22#               command_line  <commandline>
23#               }
24#
25# WHERE:
26#
27# <templatename> = object name of another command definition that should be
28#                  used as a template for this definition (optional)
29# <objectname>   = object name of command definition, referenced by other
30#                  command definitions that use it as a template (optional)
31# <commandname>  = name of the command, as recognized/used by Nagios
32# <commandline>  = command line
33#
34################################################################################
35
36
37
38
39################################################################################
40#
41# SAMPLE NOTIFICATION COMMANDS
42#
43# These are some example notification commands.  They may or may not work on
44# your system without modification.
45#
46################################################################################
47
48
49# 'host-notify-by-email' command definition
50define command{
51        command_name    host-notify-by-email
52        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 "Host $HOSTSTATE$ alert for $HOSTNAME$!" $CONTACTEMAIL$
53        }
54
55
56# 'host-notify-by-epager' command definition
57define command{
58        command_name    host-notify-by-epager
59        command_line    /usr/bin/printf "%b" "Host '$HOSTALIAS$' is $HOSTSTATE$\nInfo: $HOSTOUTPUT$\nTime: $LONGDATETIME$" | /bin/mail -s "$NOTIFICATIONTYPE$ alert - Host $HOSTNAME$ is $HOSTSTATE$" $CONTACTPAGER$
60        }
61
62# 'notify-by-email' command definition
63define command{
64        command_name    notify-by-email
65        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$" | /bin/mail -s "** $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
66        }
67
68
69# 'notify-by-epager' command definition
70define command{
71        command_name    notify-by-epager
72        command_line    /usr/bin/printf "%b" "Service: $SERVICEDESC$\nHost: $HOSTNAME$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\nInfo: $SERVICEOUTPUT$\nDate: $LONGDATETIME$" | /bin/mail -s "$NOTIFICATIONTYPE$: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$" $CONTACTPAGER$
73        }
74
75
76
77
78
79################################################################################
80#
81# SAMPLE PERFORMANCE DATA COMMANDS
82#
83# These are sample performance data commands that can be used to send performance
84# data output to two text files (one for hosts, another for services).  If you
85# plan on simply writing performance data out to a file, consider using the
86# host_perfdata_file and service_perfdata_file options in the main config file.
87#
88################################################################################
89
90
91# 'process-host-perfdata' command definition
92define command{
93        command_name    process-host-perfdata
94        command_line    /usr/bin/printf "%b" "$LASTHOSTCHECK$\t$HOSTNAME$\t$HOSTSTATE$\t$HOSTATTEMPT$\t$HOSTSTATETYPE$\t$HOSTEXECUTIONTIME$\t$HOSTOUTPUT$\t$HOSTPERFDATA$\n" >> /var/log/nagios/host-perfdata.out
95        }
96
97
98# 'process-service-perfdata' command definition
99define command{
100        command_name    process-service-perfdata
101        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" >> /var/log/nagios/service-perfdata.out
102        }
103
104
105define command {
106  command_name  ng-service-perfdata
107  command_line  /home/noc/ng/bin/insert.pl
108}
109#  command_line  /home/nagios/ng/bin/test.sh
Note: See TracBrowser for help on using the repository browser.