summaryrefslogtreecommitdiff
path: root/nagios/objects/commands.cfg
blob: 65f97231afdcdaa7682234cad0a06f377c1cc9fb (plain)
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
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" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
}

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" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}

define command {
    command_name    check-host-alive
    command_line    $USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 5 -4
}

define command {
    command_name    check_file_age
    command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_file_age -a $ARG1$
}

define command {
    command_name    check_file_exists
    command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_file_exists -a $ARG1$
}

define command {
    command_name    check_file_no_linger
    command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_file_no_linger -a $ARG1$
}

define command {
    command_name    check_disk
    command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_disk -a $ARG1$ $ARG2$ $ARG3$
}

define command {
    command_name    check_mount
    command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_mount -a $ARG1$
}

define command {
    command_name    check_drbd
    command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_drbd -t 30:UNKNOWN
}

define command {
    command_name    check_raid
    command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_raid -t 30:UNKNOWN
}

define command {
    command_name    check_load
    command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_load
}

define command {
    command_name    check_procs
    command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_total_procs
}

define command {
    command_name    check_users
    command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_users
}

define command {
    command_name    check_swap
    command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_swap -a $ARG1$ $ARG2$
}

define command {
    command_name    check_sensors
    command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_sensors
}

define command {
    command_name    check_haproxy
    command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_haproxy
}

define command {
    command_name    check_crm
    command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_crm
}

define command {
    command_name    check_service
    command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_service -a $ARG1$
}

define command {
    command_name    check_needrestart
    command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_needrestart -t 30:UNKNOWN
}


################################################################################
# NOTE:  The following 'check_...' commands are used to monitor services on
#        both local and remote hosts.
################################################################################

define command {
    command_name    check_ice
    command_line    $USER1$/check_ice $HOSTADDRESS$ -p $ARG1$ $ARG2$ $ARG3$ $ARG4$ $ARG5$
}

define command {
    command_name    check_http
    command_line    $USER1$/check_http -I $HOSTADDRESS$ -H sys.randomdan.homeip.net $ARG1$
}

define command {
    command_name    check_https
    command_line    $USER1$/check_http -I $HOSTADDRESS$ -H sys.randomdan.homeip.net --sni -S 2+ $ARG1$
}

define command {
    command_name    check_ssh
    command_line    $USER1$/check_ssh $ARG1$ $HOSTADDRESS$
}

define command {
    command_name    check_dhcp
    command_line    $USER1$/check_dhcp $ARG1$
}

define command {
    command_name    check_ping
    command_line    $USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5 -4
}

define command {
    command_name    check_simap
    command_line    $USER1$/check_simap -H $HOSTADDRESS$ $ARG1$
}

define command {
    command_name    check_smtp
    command_line    $USER1$/check_smtp -H $HOSTADDRESS$ $ARG1$
}

define command {
    command_name    check_pgsql
    command_line    $USER1$/check_pgsql -H $HOSTADDRESS$ -l postgres
}

define command {
    command_name    check_pg_repl
    command_line    $USER1$/check_pgactivity -h firebrand,defiant -s hot_standby_delta -U postgres -w 200k -c 1m
}

define command {
    command_name    check_mysql
    command_line    $USER1$/check_mysql -H $HOSTADDRESS$ -P 13306 -S -w 10 -c 60 -u nagios -p r3pl
}

define command {
    command_name    check_tcp
    command_line    $USER1$/check_tcp -H $HOSTADDRESS$ -p $ARG1$ $ARG2$
}

define command {
    command_name    check_ldap
    command_line    $USER1$/check_ldap -H $HOSTADDRESS$ -b dc=random,dc=lan -3
}

define command {
    command_name    check_ntp
    command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_time
}

define command {
    command_name    check_kernel
    command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_kernel
}

define command {
    command_name    check_dns
    command_line    $USER1$/check_dns -H $HOSTADDRESS$ -s $HOSTADDRESS$
}

define command {
    command_name    check_glusterfs
    command_line    sudo $USER1$/check_glusterfs -p -f -l $ARG1$
}
define command {
    command_name    check_glusterfs_nospace
    command_line    sudo $USER1$/check_glusterfs -p -f -l $ARG1$ -w 98 -c 99
}

#
# 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.
#
################################################################################


define command {
    command_name    process-service-perfdata
    command_line    /usr/lib64/nagiosgraph/bin/insert.pl "$LASTSERVICECHECK$||$HOSTNAME$||$SERVICEDESC$||$SERVICEOUTPUT$||$SERVICEPERFDATA$"
}