summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--files/monitoring/icinga2/checkcommands/check_postfix_mailqueue.conf40
-rw-r--r--manifests/monitoring/service/postfix_mailqueue.pp4
-rw-r--r--templates/monitoring/service/postfix_mailqueue.erb11
3 files changed, 55 insertions, 0 deletions
diff --git a/files/monitoring/icinga2/checkcommands/check_postfix_mailqueue.conf b/files/monitoring/icinga2/checkcommands/check_postfix_mailqueue.conf
index 0a64554..dbcee3b 100644
--- a/files/monitoring/icinga2/checkcommands/check_postfix_mailqueue.conf
+++ b/files/monitoring/icinga2/checkcommands/check_postfix_mailqueue.conf
@@ -8,6 +8,46 @@ object CheckCommand "postfix-mailqueue" {
value = "$config_dir$"
description = "Postfix config directory."
}
+ "--deferred_warn" = {
+ value = "$deferred_warn$"
+ description = "Warning level for deferred queue."
+ }
+ "--deferred_crit" = {
+ value = "$deferred_crit$"
+ description = "Critical level for deferred queue."
+ }
+ "--active_warn" = {
+ value = "$active_warn$"
+ description = "Warning level for active queue."
+ }
+ "--active_crit" = {
+ value = "$active_crit$"
+ description = "Critical level for active queue."
+ }
+ "--maildrop_warn" = {
+ value = "$maildrop_warn$"
+ description = "Warning level for maildrop queue."
+ }
+ "--maildrop_crit" = {
+ value = "$maildrop_crit$"
+ description = "Critical level for maildrop queue."
+ }
+ "--incoming_warn" = {
+ value = "$incoming_warn$"
+ description = "Warning level for incoming queue."
+ }
+ "--incoming_crit" = {
+ value = "$incoming_crit$"
+ description = "Critical level for incoming queue."
+ }
+ "--hold_warn" = {
+ value = "$hold_warn$"
+ description = "Warning level for hold queue."
+ }
+ "--hold_crit" = {
+ value = "$hold_crit$"
+ description = "Critical level for hold queue."
+ }
}
}
diff --git a/manifests/monitoring/service/postfix_mailqueue.pp b/manifests/monitoring/service/postfix_mailqueue.pp
index 74eee26..0f7a9c1 100644
--- a/manifests/monitoring/service/postfix_mailqueue.pp
+++ b/manifests/monitoring/service/postfix_mailqueue.pp
@@ -9,6 +9,10 @@ define tails::monitoring::service::postfix_mailqueue (
Optional[String] $display_name = undef,
Boolean $enable_notifications = true,
Stdlib::Absolutepath $config_dir = '/etc/postfix',
+ # Thresholds apply to every queue except "corrupt",
+ # which has critical=1 by default in the check script.
+ Integer[0] $warning_threshold = 5,
+ Integer[0] $critical_threshold = 5,
){
if $display_name == undef {
diff --git a/templates/monitoring/service/postfix_mailqueue.erb b/templates/monitoring/service/postfix_mailqueue.erb
index 0145409..f643bb2 100644
--- a/templates/monitoring/service/postfix_mailqueue.erb
+++ b/templates/monitoring/service/postfix_mailqueue.erb
@@ -14,4 +14,15 @@ object Service "<%= @displayed_name %>" {
vars.config_dir = "<%= @config_dir %>"
+ vars.deferred_warn = "<%= @warning_threshold %>"
+ vars.deferred_crit = "<%= @critical_threshold %>"
+ vars.active_warn = "<%= @warning_threshold %>"
+ vars.active_crit = "<%= @critical_threshold %>"
+ vars.maildrop_warn = "<%= @warning_threshold %>"
+ vars.maildrop_crit = "<%= @critical_threshold %>"
+ vars.incoming_warn = "<%= @warning_threshold %>"
+ vars.incoming_crit = "<%= @critical_threshold %>"
+ vars.hold_warn = "<%= @warning_threshold %>"
+ vars.hold_crit = "<%= @critical_threshold %>"
+
}