]> granicus.if.org Git - icinga2/blob - itl/command-plugins.conf
Docs: Add cli commands
[icinga2] / itl / command-plugins.conf
1 /******************************************************************************
2  * Icinga 2                                                                   *
3  * Copyright (C) 2012-2014 Icinga Development Team (http://www.icinga.org)    *
4  *                                                                            *
5  * This program is free software; you can redistribute it and/or              *
6  * modify it under the terms of the GNU General Public License                *
7  * as published by the Free Software Foundation; either version 2             *
8  * of the License, or (at your option) any later version.                     *
9  *                                                                            *
10  * This program is distributed in the hope that it will be useful,            *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              *
13  * GNU General Public License for more details.                               *
14  *                                                                            *
15  * You should have received a copy of the GNU General Public License          *
16  * along with this program; if not, write to the Free Software Foundation     *
17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.             *
18  ******************************************************************************/
19
20 template CheckCommand "ping-common" {
21         import "plugin-check-command"
22
23         command = [ PluginDir + "/check_ping" ]
24
25         arguments = {
26                 "-H" = "$ping_address$"
27                 "-w" = "$ping_wrta$,$ping_wpl$%"
28                 "-c" = "$ping_crta$,$ping_cpl$%"
29                 "-p" = "$ping_packets$"
30                 "-t" = "$ping_timeout$"
31         }
32
33         vars.ping_wrta = 100
34         vars.ping_wpl = 5
35         vars.ping_crta = 200
36         vars.ping_cpl = 15
37 }
38
39 object CheckCommand "ping4" {
40         import "ping-common"
41
42         command += [ "-4" ]
43
44         vars.ping_address = "$address$"
45 }
46
47 object CheckCommand "ping6" {
48         import "ping-common"
49
50         command += [ "-6" ]
51
52         vars.ping_address = "$address6$"
53 }
54
55 object CheckCommand "hostalive" {
56         import "ping4"
57
58         vars.ping_wrta = 3000.0
59         vars.ping_wpl = 80
60
61         vars.ping_crta = 5000.0
62         vars.ping_cpl = 100
63 }
64
65
66 template CheckCommand "fping-common" {
67         import "plugin-check-command"
68
69         command = [
70                 PluginDir + "/check_fping",
71                 "$fping_address$"
72         ]
73
74         arguments = {
75                 "-w" = "$fping_wrta$,$fping_wpl$%"
76                 "-c" = "$fping_crta$,$fping_cpl$%"
77                 "-n" = "$fping_number$"
78                 "-i" = "$fping_interval$"
79                 "-b" = "$fping_bytes$"
80                 "-T" = "$fping_target_timeout$"
81                 "-S" = "$fping_source_ip$"
82                 "-I" = "$fping_source_interface$"
83         }
84
85         vars.fping_wrta = 100
86         vars.fping_wpl = 5
87         vars.fping_crta = 200
88         vars.fping_cpl = 15
89         vars.fping_number = 5
90         vars.fping_interval = 500
91 }
92
93 object CheckCommand "fping4" {
94         import "fping-common"
95
96         command += [ "-4" ]
97
98         vars.fping_address = "$address$"
99 }
100
101 object CheckCommand "fping6" {
102         import "fping-common"
103
104         command += [ "-6" ]
105
106         vars.fping_address = "$address6$"
107 }
108
109 object CheckCommand "dummy" {
110         import "plugin-check-command"
111
112         command = [
113                 PluginDir + "/check_dummy",
114                 "$dummy_state$",
115                 "$dummy_text$"
116         ]
117
118         vars.dummy_state = 0
119         vars.dummy_text = "Check was successful."
120 }
121
122 object CheckCommand "passive" {
123         import "dummy"
124
125         vars.dummy_state = 3
126         vars.dummy_text = "No Passive Check Result Received."
127 }
128
129 object CheckCommand "tcp" {
130         import "plugin-check-command"
131
132         command = [
133                 PluginDir + "/check_tcp",
134                 "-H", "$tcp_address$",
135                 "-p", "$tcp_port$"
136         ]
137
138         vars.tcp_address = "$address$"
139 }
140
141 object CheckCommand "ssl" {
142         import "plugin-check-command"
143
144         command = [ PluginDir + "/check_tcp" ]
145
146         arguments = {
147                 "-H" = "$ssl_address$"
148                 "-p" = "$ssl_port$"
149                 "--ssl" = { }
150                 "--timeout" = "$ssl_timeout$"
151                 "-D" = "$ssl_cert_valid_days_warn$,$ssl_cert_valid_days_critical$"
152         }
153
154         vars.ssl_address = "$address$"
155 }
156
157 object CheckCommand "udp" {
158         import "plugin-check-command"
159
160         command = [
161                 PluginDir + "/check_udp",
162                 "-H", "$udp_address$",
163                 "-p", "$udp_port$"
164         ]
165
166         vars.udp_address = "$address$"
167 }
168
169 object CheckCommand "http" {
170         import "plugin-check-command"
171
172         command = [ PluginDir + "/check_http" ]
173
174         arguments = {
175                 "-H" = "$http_vhost$"
176                 "-I" = "$http_address$"
177                 "-u" = "$http_uri$"
178                 "-p" = "$http_port$"
179                 "-S" = {
180                         set_if = "$http_ssl$"
181                 }
182                 "--sni" = {
183                         set_if = "$http_sni$"
184                 }
185                 "-C" = {
186                         value = "$http_certificate$"
187                         description = "Minimum number of days a certificate has to be valid. Port defaults to 443."
188                 }
189                 "-J" = {
190                         value = "$http_clientcert$"
191                         description = "Name of file contains the client certificate (PEM format)"
192                 }
193                 "-K" = {
194                         value = "$http_privatekey$"
195                         description = "Name of file contains the private key (PEM format)"
196                 }
197                 "-a" = {
198                         value = "$http_auth_pair$"
199                         description = "Username:password on sites with basic authentication"
200                 }
201                 "--no-body" = {
202                         set_if = "$http_ignore_body$"
203                 }
204                 "-w" = "$http_warn_time$"
205                 "-c" = "$http_critical_time$"
206                 "-e" = "$http_expect$"
207                 "-d" = {
208                         value = "$http_headerstring$"
209                         description = "String to expect in the response headers"
210                 }
211                 "-s" = {
212                         value = "$http_string$"
213                         description = "String to expect in the content"
214                 }
215                 "-P" = {
216                         value = "$http_post$"
217                         description = "URL encoded http POST data"
218                 }
219                 "-j" = {
220                         value = "$http_method$"
221                         description = "Set http method (for example: HEAD, OPTIONS, TRACE, PUT, DELETE)"
222                 }
223                 "-M" = {
224                         value = "$http_maxage$"
225                         description = "Warn if document is more than seconds old"
226                 }
227                 "-T" = {
228                         value = "$http_contenttype$"
229                         description = "Specify Content-Type header when POSTing"
230                 }
231                 "-l" = {
232                         set_if = "$http_linespan$"
233                         description = "Allow regex to span newline"
234                         order = 1
235                 }
236                 "-r" = {
237                         value = "$http_expect_body_regex$"
238                         description = "Search page for regex"
239                         order = 2
240                 }
241                 "-R" = {
242                         value = "$http_expect_body_eregi$"
243                         description = "Search page for case-insensitive regex"
244                         order = 2
245                 }
246                 "--invert-regex" = {
247                         set_if = "$http_invertregex$"
248                         description = "Return CRITICAL if found, OK if not"
249                 }
250                 "-b" = {
251                         value = "$http_proxy_auth_pair$"
252                         description = "Username:password on proxy-servers with basic authentication"
253                 }
254                 "-A" = {
255                         value = "$http_useragent$"
256                         description = "String to be sent in http header as User Agent"
257                 }
258                 "-k" = {
259                         value = "$http_header$"
260                         description = "Any other tags to be sent in http header"
261                 }
262                 "-E" = {
263                         set_if = "$http_extendedperfdata$"
264                         description = "Print additional perfdata"
265                 }
266                 "-f" = {
267                         value = "$http_onredirect$"
268                         description = "How to handle redirect pages"
269                 }
270                 "-m" = {
271                         value = "$http_pagesize$"
272                         description = "Minim page size required:Maximum page size required"
273                 }
274                 "-t" = {
275                         value = "$http_timeout$"
276                         description = "Seconds before connection times out"
277                 }
278         }
279
280         vars.http_address = "$address$"
281         vars.http_ssl = false
282         vars.http_sni = false
283         vars.http_linespan = false
284         vars.http_invertregex = false
285 }
286
287 object CheckCommand "ftp" {
288         import "plugin-check-command"
289
290         command = [ PluginDir + "/check_ftp" ]
291
292         arguments = {
293                 "-H" = "$ftp_address$"
294         }
295
296         vars.ftp_address = "$address$"
297 }
298
299 object CheckCommand "smtp" {
300         import "plugin-check-command"
301
302         command = [ PluginDir + "/check_smtp" ]
303
304         arguments = {
305                 "-H" = "$smtp_address$"
306                 "-p" = "$smtp_port$"
307                 "-f" = "$smtp_mail_from$"
308         }
309
310         vars.smtp_address = "$address$"
311 }
312
313 object CheckCommand "ssmtp" {
314         import "plugin-check-command"
315
316         command = [ PluginDir + "/check_ssmtp" ]
317         arguments = {
318                 "-H" = "$ssmtp_address$"
319                 "-p" = "$ssmtp_port$"
320                 "-f" = "$ssmtp_mail_from$"
321         }
322
323         vars.ssmtp_address = "$address$"
324 }
325
326 object CheckCommand "imap" {
327         import "plugin-check-command"
328
329         command = [ PluginDir + "/check_imap" ]
330
331         arguments = {
332                 "-H" = "$imap_address$"
333                 "-p" = "$imap_port$"
334         }
335
336         vars.imap_address = "$address$"
337 }
338
339 object CheckCommand "simap" {
340         import "plugin-check-command"
341
342           command = [ PluginDir + "/check_simap" ]
343
344         arguments = {
345                 "-H" = "$simap_address$"
346                 "-p" = "$simap_port$"
347         }
348
349         vars.simap_address = "$address$"
350 }
351
352 object CheckCommand "pop" {
353         import "plugin-check-command"
354
355         command = [ PluginDir + "/check_pop" ]
356
357         arguments = {
358                 "-H" = "$pop_address$"
359                 "-p" = "$pop_port$"
360         }
361
362         vars.pop_address = "$address$"
363 }
364
365 object CheckCommand "spop" {
366         import "plugin-check-command"
367
368         command = [ PluginDir + "/check_spop" ]
369
370         arguments = {
371                 "-H" = "$spop_address$"
372                 "-p" = "$spop_port$"
373         }
374
375         vars.spop_address = "$address$"
376 }
377
378 object CheckCommand "ntp_time" {
379         import "plugin-check-command"
380
381         command = [ PluginDir + "/check_ntp_time" ]
382
383         arguments = {
384                 "-H" = "$ntp_address$"
385         }
386
387         vars.ntp_address = "$address$"
388 }
389
390 object CheckCommand "ssh" {
391         import "plugin-check-command"
392
393         command = [ PluginDir + "/check_ssh" ]
394
395         arguments = {
396                 "-p" = "$ssh_port$"
397                 "-t" = "$ssh_timeout$"
398                 "host" = {
399                         value = "$ssh_address$"
400                         skip_key = true
401                         order = 1
402                 }
403         }
404
405         vars.ssh_address = "$address$"
406 }
407
408 object CheckCommand "disk" {
409         import "plugin-check-command"
410
411         command = [ PluginDir + "/check_disk" ]
412
413         arguments = {
414                 "-w" = "$disk_wfree$%"
415                 "-c" = "$disk_cfree$%"
416         }
417
418         vars.disk_wfree = 20
419         vars.disk_cfree = 10
420 }
421
422 object CheckCommand "users" {
423         import "plugin-check-command"
424
425         command = [ PluginDir + "/check_users" ]
426
427         arguments = {
428                 "-w" = "$users_wgreater$"
429                 "-c" = "$users_cgreater$"
430         }
431
432         vars.users_wgreater = 20
433         vars.users_cgreater = 50
434 }
435
436 object CheckCommand "procs" {
437         import "plugin-check-command"
438
439         command = [ PluginDir + "/check_procs" ]
440
441     arguments = {
442         "-w" = {
443             value = "$procs_warning$"
444             description = "Generate warning state if metric is outside this range" 
445         }
446         "-c" = {
447             value = "$procs_critical$"
448             description = "Generate critical state if metric is outside this range" 
449         }
450         "-m" = {
451             value = "$procs_metric$"
452             description = "Check thresholds against metric" 
453         }
454         "-t" = {
455             value = "$procs_timeout$"
456             description = "Seconds before plugin times out"
457         }
458         "-T" = {
459             set_if = "$procs_traditional$"
460             description = "Filter own process the traditional way by PID instead of /proc/pid/exe"
461         }
462         "-s" = {
463             value = "$procs_state$"
464             description = "Only scan for processes that have one or more of the status flags you specify"
465         }
466         "-p" = {
467             value = "$procs_ppid$"
468             description = "Only scan for children of the parent process ID indicated"
469         }
470         "-z" = {
471             value = "$procs_vsz$"
472             description = "Only scan for processes with VSZ higher than indicated"
473         }
474         "-r" = {
475             value = "$procs_rss$"
476             description = "Only scan for processes with RSS higher than indicated"
477         }
478         "-P" = {
479             value = "$procs_pcpu$"
480             description = "Only scan for processes with PCPU higher than indicated"
481         }
482         "-u" = {
483             value = "$procs_user$"
484             description = "Only scan for processes with user name or ID indicated"
485         }
486         "-a" = {
487             value = "$procs_argument$"
488             description = "Only scan for processes with args that contain STRING"
489         }
490         "--ereg-argument-array" = {
491             value = "$procs_argument_regex$"
492             description = "Only scan for processes with args that contain the regex STRING"
493         }
494         "-C" = {
495             value = "$procs_command$"
496             description = "Only scan for exact matches of COMMAND (without path)"
497         }
498         "-k" = {
499             set_if = "$procs_nokthreads$"
500             description = "Only scan for non kernel threads"
501         }
502     }
503
504     vars.procs_traditional = false
505     vars.procs_nokthreads = false
506     vars.procs_warning = 250
507     vars.procs_critical = 400
508 }
509
510 object CheckCommand "swap" {
511         import "plugin-check-command"
512
513         command = [ PluginDir + "/check_swap" ]
514
515         arguments = {
516                 "-w" = "$swap_wfree$%"
517                 "-c" = "$swap_cfree$%"
518         }
519
520         vars.swap_wfree = 50
521         vars.swap_cfree = 25
522 }
523
524 object CheckCommand "load" {
525         import "plugin-check-command"
526
527         command = [ PluginDir + "/check_load" ]
528
529         arguments = {
530                 "-w" = "$load_wload1$,$load_wload5$,$load_wload15$"
531                 "-c" = "$load_cload1$,$load_cload5$,$load_cload15$"
532         }
533
534         vars.load_wload1 = 5.0
535         vars.load_wload5 = 4.0
536         vars.load_wload15 = 3.0
537
538         vars.load_cload1 = 10.0
539         vars.load_cload5 = 6.0
540         vars.load_cload15 = 4.0
541 }
542
543 object CheckCommand "snmp" {
544         import "plugin-check-command"
545
546         command = [ PluginDir + "/check_snmp" ]
547
548         arguments = {
549                 "-H" = "$snmp_address$"
550                 "-o" = "$snmp_oid$"
551                 "-C" = "$snmp_community$"
552                 "-c" = "$snmp_crit$"
553                 "-w" = "$snmp_warn$"
554                 "-s" = "$snmp_string$"
555                 "-r" = "$snmp_ereg$"
556                 "-R" = "$snmp_eregi$"
557                 "-l" = "$snmp_label$"
558                 "-u" = "$snmp_units$"
559                 "--invert-search" = {
560                         set_if = "$snmp_invert_search$"
561                         description = "Invert search result and return CRITICAL if found"
562                 }
563         }
564
565         vars.snmp_address = "$address$"
566         vars.snmp_community = "public"
567         vars.snmp_invert_search = false
568 }
569
570 object CheckCommand "snmpv3" {
571         import "plugin-check-command"
572
573         command = [ PluginDir + "/check_snmp" ]
574
575         arguments = {
576                 "-H" = "$snmpv3_address$"
577                 "-P" = 3
578                 "--seclevel" = "authPriv"
579                 "-U" = "$snmpv3_user$"
580                 "-a" = "$snmpv3_auth_alg$"
581                 "-A" = "$snmpv3_auth_key$"
582                 "-x" = "$snmpv3_priv_alg$"
583                 "-X" = "$snmpv3_priv_key$"
584                 "-o" = "$snmpv3_oid$"
585                 "-c" = "$snmpv3_crit$"
586                 "-w" = "$snmpv3_warn$"
587         }
588
589         vars.snmpv3_address = "$address$"
590         vars.snmpv3_auth_alg = "SHA"
591         vars.snmpv3_priv_alg = "AES"
592 }
593
594 object CheckCommand "snmp-uptime" {
595         import "snmp"
596
597         vars.snmp_oid = "1.3.6.1.2.1.1.3.0"
598 }
599
600 object CheckCommand "apt" {
601         import "plugin-check-command"
602
603         command = [ PluginDir + "/check_apt" ]
604 }
605
606 object CheckCommand "dhcp" {
607         import "plugin-check-command"
608
609         command = [ PluginDir + "/check_dhcp" ]
610
611         arguments = {
612                 "-s" = "$dhcp_serverip$"
613                 "-r" = "$dhcp_requestedip$"
614                 "-t" = "$dhcp_timeout$"
615                 "-i" = "$dhcp_interface$"
616                 "-m" = "$dhcp_mac$"
617                 "-u" = {
618                         set_if = "$dhcp_unicast$"
619                 }
620         }
621
622         vars.dhcp_unicast = false
623 }
624
625 object CheckCommand "dns" {
626         import "plugin-check-command"
627
628         command = [ PluginDir + "/check_dns" ]
629
630         arguments = {
631                 "-H" = "$dns_lookup$"
632                 "-s" = "$dns_server$"
633                 "-a" = "$dns_expected_answer$"
634                 "-A" = {
635                         set_if = "$dns_authoritative$"
636                 }
637         }
638
639         vars.dns_lookup = "$host_name$"
640         vars.dns_expected_answer = "$address$"
641 }
642
643 object CheckCommand "dig" {
644         import "plugin-check-command"
645
646         command = [ PluginDir + "/check_dig" ]
647
648         arguments = {
649                 "-H" = "$dig_server$"
650                 "-l" = "$dig_lookup$"
651         }
652
653         vars.dig_server = "$address$"
654 }
655
656 object CheckCommand "nscp" {
657         import "plugin-check-command"
658
659         command = [ PluginDir + "/check_nt" ]
660
661         arguments = {
662                 "-H" = "$nscp_address$"
663                 "-p" = "$nscp_port$"
664                 "-s" = "$nscp_password$"
665                 "-v" = {
666                         value = "$nscp_variable$"
667                         required = true
668                 }
669                 "-l" = "$nscp_params$"
670                 "-w" = "$nscp_warn$"
671                 "-c" = "$nscp_crit$"
672                 "-t" = "$nscp_timeout$"
673         }
674
675         vars.nscp_address = "$address$"
676         vars.nscp_port = 12489
677 }
678
679 object CheckCommand "by_ssh" {
680         import "plugin-check-command"
681
682         command = [ PluginDir + "/check_by_ssh" ]
683
684         arguments = {
685                 "-H" = "$by_ssh_address$"
686                 "-p" = "$by_ssh_port$"
687                 "-C" = "$by_ssh_command$"
688                 "-l" = "$by_ssh_logname$"
689                 "-i" = "$by_ssh_identity$"
690                 "-q" = {
691                         set_if = "$by_ssh_quiet$"
692                 }
693                 "-w" = "$by_ssh_warn$"
694                 "-c" = "$by_ssh_crit$"
695                 "-t" = "$by_ssh_timeout$"
696         }
697
698         vars.by_ssh_address = "$address$"
699         vars.by_ssh_quiet = false
700 }
701
702 object CheckCommand "ups" {
703         import "plugin-check-command"
704
705         command = [ PluginDir + "/check_ups" ]
706
707         arguments = {
708                 "-H" = "$ups_address$"
709                 "-u" = "$ups_name$"
710         }
711
712         vars.ups_address = "$address$"
713         vars.ups_name = "ups"
714 }
715
716 object CheckCommand "nrpe" {
717         import "plugin-check-command"
718
719         command = [ PluginDir + "/check_nrpe" ]
720
721         arguments = {
722                 "-H" = "$nrpe_address$"
723                 "-p" = "$nrpe_port$"
724                 "-c" = "$nrpe_command$"
725                 "-n" = {
726                         set_if = "$nrpe_no_ssl$"
727                         description = "Do not use SSL."
728                 }
729                 "-u" = {
730                         set_if = "$nrpe_timeout_unknown$"
731                         description = "Make socket timeouts return an UNKNOWN state instead of CRITICAL"
732                 }
733                 "-t" = "$nrpe_timeout$"
734         }
735
736         vars.nrpe_address = "$address$"
737         vars.nrpe_no_ssl = false
738         vars.nrpe_timeout_unknown = false
739 }
740
741 /* Contrib plugins */
742 object CheckCommand "running_kernel" {
743         import "plugin-check-command"
744
745         command = [ "sudo", PluginDir + "/check_running_kernel" ]
746 }
747