Rev 35 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2 | daniel-mar | 1 | // Put this file in /etc/icinga2/conf.d/... |
2 | |||
3 | // VNag - Nagios Framework for PHP |
||
4 | // Developed by Daniel Marschall, ViaThinkSoft <www.viathinksoft.com> |
||
5 | // Licensed under the terms of the Apache 2.0 license |
||
6 | // |
||
79 | daniel-mar | 7 | // Revision 2023-10-14 |
2 | daniel-mar | 8 | |
9 | object CheckCommand "vnag_x509_expire" { |
||
35 | daniel-mar | 10 | // PLEASE ADJUST THIS PATH |
79 | daniel-mar | 11 | command = [ "/daten/vnag/bin/x509_expire.phar" ] |
2 | daniel-mar | 12 | |
13 | arguments = { |
||
14 | "-f" = { |
||
15 | value = "$vnag_x509_expire_file$" |
||
16 | description = "File or filemask to be checked. There are two possible checking modes: If you put a # in front of the file mask, only the oldest file of each group will be checked (use this mode e.g. if you have a directory which contains old backups of certificates beside the current working certificate). Otherwise, all files of the file group are checked." |
||
17 | repeat_key = true |
||
18 | required = true |
||
19 | } |
||
20 | "-w" = { |
||
21 | value = "$vnag_x509_expire_warn$" |
||
22 | description = "Max age of file (warning range). You must use a Nagios compatible unit of measure (i.e. seconds)." |
||
23 | } |
||
24 | "-c" = { |
||
25 | value = "$vnag_x509_expire_crit$" |
||
26 | description = "Max age of file (critical range). You must use a Nagios compatible unit of measure (i.e. seconds)." |
||
27 | } |
||
28 | "-v" = { |
||
29 | set_if = "$vnag_x509_expire_verbose$" |
||
30 | description = "Additionally list files which are OK, not just the files which are out of the time range." |
||
31 | } |
||
32 | } |
||
33 | } |
||
34 | |||
35 | // Example usage: |
||
36 | // |
||
37 | // apply Service "example_letsencrypt_expiration" { |
||
38 | // import "generic-service" |
||
39 | // check_command = "vnag_x509_expire" |
||
40 | // vars = { |
||
41 | // vnag_x509_expire_file = [ "/daten/ssl/letsencrypt/*/certificate.pem" ] |
||
42 | // vnag_x509_expire_warn = "86400s" // 24h |
||
43 | // vnag_x509_expire_crit = "144000s" // 40h |
||
44 | // vnag_x509_expire_verbose = false |
||
45 | // } |
||
46 | // assign where host.name == NodeName |
||
47 | // } |