-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnagios.cfg
More file actions
62 lines (53 loc) · 2.69 KB
/
Copy pathnagios.cfg
File metadata and controls
62 lines (53 loc) · 2.69 KB
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
## ────────────────────────────────────────────────────────────────────
## nagios/nagios.cfg — example Nagios/Icinga object definitions for
## check_cck_ssl. Include this from your main nagios.cfg or
## /etc/nagios3/conf.d/ after installing the plugin.
## ────────────────────────────────────────────────────────────────────
## ── Command definitions ──────────────────────────────────────────────
# Check a live TLS host on port 443 (default thresholds: warn=30, crit=14)
define command {
command_name check_ssl_cert
command_line $USER1$/check_cck_ssl -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$
}
# Check a live TLS host on a custom port
define command {
command_name check_ssl_cert_port
command_line $USER1$/check_cck_ssl -H $HOSTADDRESS$ -p $ARG1$ -w $ARG2$ -c $ARG3$
}
# Check a local PEM certificate file
define command {
command_name check_ssl_cert_file
command_line $USER1$/check_cck_ssl -f $ARG1$ -w $ARG2$ -c $ARG3$
}
## ── Service definitions ──────────────────────────────────────────────
# Check example.com's TLS cert; warn at 30 days, critical at 14
define service {
use generic-service
host_name example.com
service_description SSL Certificate
check_command check_ssl_cert!30!14
check_interval 60 ; check every hour (minutes)
retry_interval 5
max_check_attempts 3
notification_interval 1440 ; re-notify daily
}
# Check an HTTPS service on a non-standard port
define service {
use generic-service
host_name internal.example.com
service_description SSL Certificate (8443)
check_command check_ssl_cert_port!8443!30!14
check_interval 60
retry_interval 5
max_check_attempts 3
}
# Check a certificate file directly (e.g. on the Nagios host itself)
define service {
use generic-service
host_name localhost
service_description SSL Cert /etc/ssl/certs/my-service.pem
check_command check_ssl_cert_file!/etc/ssl/certs/my-service.pem!30!14
check_interval 1440 ; check once a day
retry_interval 60
max_check_attempts 3
}