-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmisccommands.cfg
122 lines (95 loc) · 4.86 KB
/
misccommands.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
################################################################################
# Sample object config file for Nagios
#
# Read the documentation for more information on this configuration file. I've
# provided some comments here, but things may not be so clear without further
# explanation, so make sure to read the HTML documentation!
#
# Last Modified: 12-17-2005
#
################################################################################
################################################################################
# COMMAND DEFINITIONS
#
# SYNTAX:
#
# define command{
# template <templatename>
# name <objectname>
# command_name <commandname>
# command_line <commandline>
# }
#
# WHERE:
#
# <templatename> = object name of another command definition that should be
# used as a template for this definition (optional)
# <objectname> = object name of command definition, referenced by other
# command definitions that use it as a template (optional)
# <commandname> = name of the command, as recognized/used by Nagios
# <commandline> = command line
#
################################################################################
################################################################################
#
# SAMPLE NOTIFICATION COMMANDS
#
# These are some example notification commands. They may or may not work on
# your system without modification.
#
################################################################################
# 'host-notify-by-email' command definition
define command{
command_name host-notify-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" | $USER6$ /usr/bin/mail -s "Host $HOSTSTATE$ alert for $HOSTNAME$!" $CONTACTEMAIL$
}
# 'host-notify-by-zephyr' command definition
define command{
command_name host-notify-by-zephyr
command_line /usr/bin/printf "%b" "Host $HOSTSTATE$ $NOTIFICATIONTYPE$ alert for $HOSTNAME$!\n$HOSTOUTPUT$" | $USER6$ /usr/bin/zwrite -d -s "Nagios" -c $CONTACTEMAIL$ -i "nagios.$HOSTALIAS$"
}
# 'host-notify-by-epager' command definition
define command{
command_name host-notify-by-epager
command_line /usr/bin/printf "%b" "Host '$HOSTALIAS$' is $HOSTSTATE$\nInfo: $HOSTOUTPUT$\nTime: $LONGDATETIME$" | $USER6$ /usr/bin/mail -s "Host $HOSTNAME$ is $HOSTSTATE$" $CONTACTPAGER$
}
# 'notify-by-email' command definition
define command{
command_name notify-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$" | $USER6$ /usr/bin/mail -s "** $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}
# 'notify-by-zephyr' command definition
define command{
command_name notify-by-zephyr
command_line /usr/bin/printf "%b" "$NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$\n$SERVICEOUTPUT$\n$LONGSERVICEOUTPUT$" | $USER6$ /usr/bin/zwrite -d -s "Nagios" -c $CONTACTEMAIL$ -i "nagios.$HOSTALIAS$.$SERVICEDESC$"
}
# 'notify-by-epager' command definition
define command{
command_name notify-by-epager
command_line /usr/bin/printf "%b" "Info: $SERVICEOUTPUT$\nDate: $LONGDATETIME$" | $USER6$ /usr/bin/mail -s "$NOTIFICATIONTYPE$: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$" $CONTACTPAGER$
}
################################################################################
#
# 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" >> /var/log/nagios/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" >> /var/log/nagios/service-perfdata.out
}
define command {
command_name ng-service-perfdata
command_line /home/noc/ng/bin/insert.pl
}
# command_line /home/nagios/ng/bin/test.sh