|
8 | 8 | "--critical": { |
9 | 9 | "value": "$mailq_critical$" |
10 | 10 | }, |
| 11 | + "--mta": { |
| 12 | + "value": "$mailq_mta$" |
| 13 | + }, |
11 | 14 | "--warning": { |
12 | 15 | "value": "$mailq_warning$" |
13 | 16 | } |
|
29 | 32 | "datafield_id": 3, |
30 | 33 | "is_required": "n", |
31 | 34 | "var_filter": null |
| 35 | + }, |
| 36 | + { |
| 37 | + "datafield_id": 4, |
| 38 | + "is_required": "n", |
| 39 | + "var_filter": null |
32 | 40 | } |
33 | 41 | ], |
34 | 42 | "imports": [], |
|
72 | 80 | "tpl-service-generic" |
73 | 81 | ], |
74 | 82 | "max_check_attempts": 5, |
75 | | - "notes": "Checks the number of messages in the mail queue using the \"mailq\" command. Alerts when the queue length exceeds the configured thresholds.", |
| 83 | + "notes": "Checks how long the oldest mail in the local mail queue has been waiting and alerts when it exceeds the configured duration thresholds. On hosts with Postfix, reads the queue via `postqueue -j` (JSON, with `arrival_time` as Unix epoch) for maximum accuracy. On Exim hosts, reads `mailq` (which is aliased to `exim -bp` by exim) and parses the age literal that exim prints next to each queued message. On other hosts, falls back to running `mailq` and parsing `Date:` lines from the output. A non-empty queue with 100 mails that are all a few minutes old is still OK, while a single mail stuck for more than an hour triggers a WARN, which matches how most admins actually want to be alerted on a mail queue.", |
76 | 84 | "notes_url": "https://linuxfabrik.github.io/monitoring-plugins/check-plugins/mailq/", |
77 | 85 | "object_name": "tpl-service-mailq", |
78 | 86 | "object_type": "template", |
|
84 | 92 | "vars": { |
85 | 93 | "criticality": "C", |
86 | 94 | "mailq_always_ok": false, |
87 | | - "mailq_critical": 250, |
88 | | - "mailq_warning": 2 |
| 95 | + "mailq_critical": "3D", |
| 96 | + "mailq_mta": "auto", |
| 97 | + "mailq_warning": "1h" |
89 | 98 | }, |
90 | 99 | "volatile": null, |
91 | 100 | "zone": null, |
92 | 101 | "uuid": "ed0b2520-5428-494b-9a7c-54860bd1cecc" |
93 | 102 | } |
94 | 103 | }, |
| 104 | + "DataList": { |
| 105 | + "mailq_mta_list": { |
| 106 | + "list_name": "mailq_mta_list", |
| 107 | + "owner": "icinga-admin", |
| 108 | + "entries": [ |
| 109 | + { |
| 110 | + "entry_name": "auto", |
| 111 | + "entry_value": "Auto", |
| 112 | + "format": "string", |
| 113 | + "allowed_roles": null |
| 114 | + }, |
| 115 | + { |
| 116 | + "entry_name": "postfix", |
| 117 | + "entry_value": "Postfix", |
| 118 | + "format": "string", |
| 119 | + "allowed_roles": null |
| 120 | + }, |
| 121 | + { |
| 122 | + "entry_name": "exim", |
| 123 | + "entry_value": "Exim", |
| 124 | + "format": "string", |
| 125 | + "allowed_roles": null |
| 126 | + }, |
| 127 | + { |
| 128 | + "entry_name": "sendmail", |
| 129 | + "entry_value": "Sendmail", |
| 130 | + "format": "string", |
| 131 | + "allowed_roles": null |
| 132 | + } |
| 133 | + ], |
| 134 | + "uuid": "08085327-d955-406b-8745-c804ca15220a" |
| 135 | + } |
| 136 | + }, |
95 | 137 | "Datafield": { |
96 | 138 | "1": { |
97 | 139 | "varname": "mailq_always_ok", |
|
105 | 147 | "2": { |
106 | 148 | "varname": "mailq_critical", |
107 | 149 | "caption": "Mailq: Critical", |
108 | | - "description": "CRIT threshold for the number of mails in the queue.", |
| 150 | + "description": "CRIT threshold for the age of the oldest mail in the queue. Accepts a duration with a unit suffix (`Ns`, `Nm`, `Nh`, `ND`, `NW`, `NM`, `NY`, case-sensitive units). Example: `--critical=3D` to alert when the oldest mail has been in the queue for 3 days or more.", |
109 | 151 | "datatype": "Icinga\\Module\\Director\\DataType\\DataTypeString", |
110 | 152 | "format": null, |
111 | 153 | "settings": { |
|
114 | 156 | "uuid": "08ba1716-c276-4591-a718-3c6ab9b052e2" |
115 | 157 | }, |
116 | 158 | "3": { |
| 159 | + "varname": "mailq_mta", |
| 160 | + "caption": "Mailq: Mta", |
| 161 | + "description": "Which mail transfer agent to query. The default `auto` probes for `postqueue` (Postfix), then `exim`/`exim4` (Exim), and falls back to `mailq` (Sendmail-style) otherwise. Override this if the detection picks the wrong MTA.", |
| 162 | + "datatype": "Icinga\\Module\\Director\\DataType\\DataTypeDatalist", |
| 163 | + "format": null, |
| 164 | + "settings": { |
| 165 | + "behavior": "strict", |
| 166 | + "data_type": "string", |
| 167 | + "datalist": "mailq_mta_list" |
| 168 | + }, |
| 169 | + "uuid": "834e8c2c-2356-4207-ab7d-86ffdbc35696" |
| 170 | + }, |
| 171 | + "4": { |
117 | 172 | "varname": "mailq_warning", |
118 | 173 | "caption": "Mailq: Warning", |
119 | | - "description": "WARN threshold for the number of mails in the queue.", |
| 174 | + "description": "WARN threshold for the age of the oldest mail in the queue. Accepts a duration with a unit suffix (`Ns`, `Nm`, `Nh`, `ND`, `NW`, `NM`, `NY`, case-sensitive units). Example: `--warning=1h` to alert when the oldest mail has been in the queue for an hour or more.", |
120 | 175 | "datatype": "Icinga\\Module\\Director\\DataType\\DataTypeString", |
121 | 176 | "format": null, |
122 | 177 | "settings": { |
|
0 commit comments