Page MenuHomeSoftware Heritage

reduce icinga/nagios apt check frequency to 24h
Closed, MigratedEdits Locked

Description

When there's a package upgrade pending, of any kind, icinga gets quite annoying, mailing:

***** Icinga  *****

Notification Type: PROBLEM

Service: apt
Host: pergamon.softwareheritage.org
Address: 127.0.0.1
State: WARNING

Date/Time: 2016-01-23 18:58:10 +0100

Additional Info: APT WARNING: 46 packages available for upgrade (0 critical updates).

Comment: []

every 30 minutes.

Such a frequency is justified for other critical issues, but it's not for pending apt upgrades.

We should reduce it to something saner, like 24h.

Event Timeline

olasd claimed this task.
olasd added a subscriber: olasd.

Should be fixed.

diff --git a/icinga2/conf.d/apt.conf b/icinga2/conf.d/apt.conf
index b2c77a0..15484c1 100644
--- a/icinga2/conf.d/apt.conf
+++ b/icinga2/conf.d/apt.conf
@@ -4,4 +4,6 @@ apply Service "apt" {
   check_command = "apt"
 
   assign where host.name == NodeName
+
+  vars.notification_interval = 43200
 }
diff --git a/icinga2/conf.d/notifications.conf b/icinga2/conf.d/notifications.conf
index 73f0f5f..2816d4b 100644
--- a/icinga2/conf.d/notifications.conf
+++ b/icinga2/conf.d/notifications.conf
@@ -23,5 +23,9 @@ apply Notification "mail-icingaadmin" to Service {
   user_groups = host.vars.notification.mail.groups
   users = host.vars.notification.mail.users
 
+  if (service.vars.notification_interval) {
+    interval = service.vars.notification_interval
+  }
+
   assign where host.vars.notification.mail
 }
olasd changed the visibility from "All Users" to "Public (No Login Required)".May 13 2016, 5:08 PM