]> git.pld-linux.org Git - projects/nagios-config.git/blob - misccommands.cfg
755eb97cd965fe0f8cd5baa6fb35637b67978455
[projects/nagios-config.git] / misccommands.cfg
1 ################################################################################
2 # Object config file for Nagios
3 #
4 ################################################################################
5
6
7 ################################################################################
8 # COMMAND DEFINITIONS
9 #
10 # SYNTAX:
11 #
12 #       define command {
13 #               template      <templatename>
14 #               name          <objectname>
15 #               command_name  <commandname>
16 #               command_line  <commandline>
17 #       }
18 #
19 # WHERE:
20 #
21 # <templatename> = object name of another command definition that should be
22 #                  used as a template for this definition (optional)
23 # <objectname>   = object name of command definition, referenced by other
24 #                  command definitions that use it as a template (optional)
25 # <commandname>  = name of the command, as recognized/used by Nagios
26 # <commandline>  = command line
27 #
28 ################################################################################
29
30
31
32
33 ################################################################################
34 #
35 # NOTIFICATION COMMANDS
36 #
37 # This is a sample service notification command that can be used to send email
38 # notifications (about service alerts) to contacts.
39 #
40 ################################################################################
41
42
43 # This is a sample service notification command that can be used to send email
44 # notifications (about service alerts) to contacts.
45 define command {
46         command_name    notify-by-email
47         command_line    /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$
48 }
49
50 # 'notify-by-epager' command definition
51 define command {
52         command_name    notify-by-epager
53         command_line    /bin/printf "%b" "Service: $SERVICEDESC$\nHost: $HOSTNAME$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\nInfo: $SERVICEOUTPUT$\nDate: $LONGDATETIME$" | /bin/mail -s "$NOTIFICATIONTYPE$: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$" $CONTACTPAGER$
54 }
55
56 # This is a sample host notification command that can be used to send email
57 # notifications (about host alerts) to contacts.
58 define command {
59         command_name    host-notify-by-email
60         command_line    /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$
61 }
62
63 # 'host-notify-by-epager' command definition
64 define command {
65         command_name    host-notify-by-epager
66         command_line    /bin/printf "%b" "Host '$HOSTALIAS$' is $HOSTSTATE$\nInfo: $HOSTOUTPUT$\nTime: $LONGDATETIME$" | /bin/mail -s "$NOTIFICATIONTYPE$ alert - Host $HOSTNAME$ is $HOSTSTATE$" $CONTACTPAGER$
67 }
68
69 ################################################################################
70 #
71 # PERFORMANCE DATA COMMANDS
72 #
73 # These are sample performance data commands that can be used to send performance
74 # data output to two text files (one for hosts, another for services).  If you
75 # plan on simply writing performance data out to a file, consider compiling
76 # Nagios with native file support for performance data.  This is done by
77 # supplying the --with-file-perfdata option to the configure script.
78 #
79 ################################################################################
80
81 # 'process-host-perfdata' command definition
82 define command {
83         command_name    process-host-perfdata
84         command_line    /bin/printf "%b" "$LASTHOSTCHECK$\t$HOSTNAME$\t$HOSTSTATE$\t$HOSTATTEMPT$\t$HOSTSTATETYPE$\t$HOSTEXECUTIONTIME$\t$HOSTOUTPUT$\t$HOSTPERFDATA$" >> /var/lib/nagios/host-perfdata.out
85 }
86
87 # 'process-service-perfdata' command definition
88 define command {
89         command_name    process-service-perfdata
90         command_line    /bin/printf "%b" "$LASTSERVICECHECK$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICESTATE$\t$SERVICEATTEMPT$\t$SERVICESTATETYPE$\t$SERVICEEXECUTIONTIME$\t$SERVICELATENCY$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$" >> /var/lib/nagios/service-perfdata.out
91 }
This page took 0.258287 seconds and 2 git commands to generate.