summaryrefslogtreecommitdiffstats
path: root/Monitoring/nagios/shinken/commands.cfg
blob: 79a5e6e031c1744526fac110178deef524318202 (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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
# Here are some sample commands for checking classics things like
# systems and websites

# -----------------------------------------------------------------
#
#      Localhost checks
#
# -----------------------------------------------------------------


# Simple disk check for LOCALHOST ONLY!
define command {
       command_name     check_local_disks
       command_line	$PLUGINSDIR$/check_disk -w 10% -c 5% -x /dev/shm -e -l
}


define command {
       command_name     check_local_load
       command_line	$PLUGINSDIR$/check_load -w 3,3,3 -c 5,5,5
}

define command {
       command_name     check_local_mem
       command_line     $PLUGINSDIR$/check_mem.pl -u -w 90 -c 95 -C
}


define command {
       command_name     check_local_swap
       command_line     $PLUGINSDIR$/check_swap -w 50% -c 25%
}

define command {
       command_name     check_local_cpu
       command_line     $PLUGINSDIR$/check_cpu -w 20 -c 10
}




# -----------------------------------------------------------------
#
#      Classic network calls
#
# -----------------------------------------------------------------

# Simple tcp check
define command {
       command_name	check_tcp
       command_line	$PLUGINSDIR$/check_tcp  -H $HOSTADDRESS$ -p $ARG1$
}

# Simple web check
define command {
       command_name	check_http
       command_line	$PLUGINSDIR$/check_http -H $HOSTADDRESS$
}

# And with SSL
define command {
       command_name     check_https
       command_line     $PLUGINSDIR$/check_http -H $HOSTADDRESS$ -S
}


# Check a DNS entry
define command {
       command_name	check_dig
       command_line 	$PLUGINSDIR$/check_dig -H $HOSTADDRESS$ -l $ARG1$
}

# Check a FTP service
define command {
       command_name	check_ftp
       command_line	$PLUGINSDIR$/check_ftp -H $HOSTADDRESS$
}


# Ask a nrpe agent
define command {
       command_name	check_nrpe
       command_line	$PLUGINSDIR$/check_nrpe -H $HOSTADDRESS$ -t 9 -u -c $ARG1$
}

# Same but with arguments
define command {
       command_name	check_nrpe_args
       command_line	$PLUGINSDIR$/check_nrpe -H $HOSTADDRESS$ -t 9 -u -c $ARG1$ -a $ARG2$ $ARG3$ $ARG4$ $ARG5$
}

# Simple ping command
define command {
       command_name	check_ping
       command_line	$PLUGINSDIR$/check_ping -H $HOSTADDRESS$ -w 3000,100% -c 5000,100% -p 1
}

# Look at good ssh launch
define command {
       command_name	check_ssh
       command_line	$PLUGINSDIR$/check_ssh -H $HOSTADDRESS$
}

# Look for good smtp connection
define command {
       command_name	check_smtp
       command_line	$PLUGINSDIR$/check_smtp -H $HOSTADDRESS$
}

# And SMTPS too
define command {
       command_name	check_smtps
       command_line	$PLUGINSDIR$/check_smtp -H $HOSTADDRESS$ -S
}

# Look at a SSL certificate
define command {
       command_name	check_https_certificate
       command_line	$PLUGINSDIR$/check_http -H $HOSTADDRESS$ -C 30
}

#Look at an HP printer state
define command{
       command_name     check_hpjd
       command_line     $PLUGINSDIR$/check_hpjd -H $HOSTADDRESS$ -C $SNMPCOMMUNITYREAD$
}


# Look at Oracle connection
define command {
       command_name	check_oracle_listener
       command_line	$PLUGINSDIR$/check_oracle --tns $HOSTADDRESS$
}

# Same but for MSSQL
# Look at http://labs.consol.de/nagios/check_mssql_health/ to get it
# Don't forget to change $MSSQLUSER$ and $MSSQLPASSWORD$ in resources.cfg before you use this ;)
define command {
       command_name	check_mssql_connection
       command_line	$PLUGINSDIR$/check_mssql_health --hostname $HOSTADDRESS$ --username "$MSSQLUSER$" --password "$MSSQLPASSWORD$" --mode connection-time
}


# Ldap query
# Don't forget to update the macros in the resources.cfg file
define command {
       command_name	check_ldap
       command_line	$PLUGINSDIR$/check_ldap -H $HOSTADDRESS$ -b "$LDAPBASE$" -D $DOMAINUSER$ -P "$DOMAINPASSWORD$"
}

# Now the same, but in LDAPS
# Don't forget to update the macros in the resources.cfg
define command {
       command_name     check_ldaps
       command_line     $PLUGINSDIR$/check_ldaps -H $HOSTADDRESS$ -b "$LDAPBASE$" -D $DOMAINUSER$ -P "$DOMAINPASSWORD$"
}

# Distant mysql check
define command {
       command_name	check_mysql_connection
       command_line	$PLUGINSDIR$/check_mysql -H $HOSTADDRESS$ -u $MYSQLUSER$ -p $MYSQLPASSWORD$
}


## Now ESX and VM checks
##ARG1 and take cpu, io, net or mem
define command{
       command_name     check_esx_host
       command_line     $PLUGINSDIR$/check_esx3.pl -D $VCENTER$ -H $HOSTADDRESS$ -u $VCENTERLOGIN$ -p $VCENTERPASSWORD$ l $ARG1$
}

define command{
        command_name    check_esx_vm
        command_line    $PLUGINSDIR$/check_esx3.pl -D $VCENTER$ -N $HOSTALIAS$ -u $VCENTERLOGIN$ -p $VCENTERPASSWORD$ -l $ARG1$
}


#### Then samples which are not really useful in the real world

#Pollertag is a advanced features for mix architectures. Look at the doc for it.
define command{
	command_name	check_linux_host_alive
	command_line	$USER1$/check_tcp -H $HOSTADDRESS$ -p 22 -t 3
	#poller_tag	DMZ
	#module_type	nrpe_poller
}

#Pollertag is a advanced features for mix architectures. Look at the doc for it.
define command{
        command_name    check_host_alive
        command_line    $USER1$/check_ping -H $HOSTADDRESS$ -w 1,50% -c 2,70% -p 1
        #poller_tag     DMZ
	#module_type	nrpe_poller
}


define command{
        command_name    check_windows_host_alive
        command_line    $USER1$/check_tcp -H $HOSTADDRESS$ -p 139 -t 3
        #poller_tag     DMZ
	#module_type	nrpe_poller
}


define command{
	command_name	check_local_disk
	command_line	$USER1$/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
 #$USER1$/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     $USER1$/check_dummy.sh 2
}


define command{
        command_name    check_dummy
        command_line    $USER1$/check_dummy.sh $ARG1$
	#poller_tag	DMZ
}


define command{
	command_name	super_event_kill_everyone
	command_line	$USER1$/check.sh $HOSTADDRESS$ -c $ARG1$ SERVICE $_HOSTDELLSUCK$
}


# We say Http checks are always OK
define command{
	command_name	check_http2
	command_line	$USER1$/check_dummy.sh 1
	#module_type	nrpe_poller
}

define command{
	command_name	check-host-alive
	command_line	$USER1$/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_vm_cpu
       command_line	$USER1$/check_esx3.pl -H lulu
}


#### Now notification commands
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$" | /usr/bin/mail -s "Host $HOSTSTATE$ alert for $HOSTNAME$!" $CONTACTEMAIL$
}


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


#### And Discovery commands
define command{
        command_name        nmap_discovery
        command_line        $USER1$/nmap_discovery_runner.py -t $NMAPTARGETS$
}

define command{
        command_name        vmware_esx_discovery
        command_line        $USER1$/vmware_discovery_runner.py -V $VCENTER$ -u $VCENTERLOGIN$ -p $VCENTERPASSWORD$ -r "lower|nofqdn"
}