]> git.immae.eu Git - perso/Immae/Projets/Puppet.git/blobdiff - modules/profile/manifests/monitoring/services.pp
Put longer time for ntp checks
[perso/Immae/Projets/Puppet.git] / modules / profile / manifests / monitoring / services.pp
index b20a3528546c1ad6bf7c142feb099b04cb7c7850..5ff3c6dcb358215d3c367ed513f423535d212535 100644 (file)
@@ -1,5 +1,15 @@
 class profile::monitoring::services {
 
+  $warn_1_load  = 1.5*$facts["processorcount"]
+  $warn_5_load  = $facts["processorcount"]
+  $warn_15_load = $facts["processorcount"]
+  $warn_load = join([$warn_1_load, $warn_5_load, $warn_15_load], ",")
+
+  $max_1_load  = 2*$facts["processorcount"]
+  $max_5_load  = $facts["processorcount"]
+  $max_15_load = $facts["processorcount"]
+  $max_load = join([$max_1_load, $max_5_load, $max_15_load], ",")
+
   profile::monitoring::local_service {
     "Size on root partition":
       local => {
@@ -11,7 +21,7 @@ class profile::monitoring::services {
       };
     "Average load":
       local => {
-        check_command => "check_local_load!8.0,8.0,8.0!10.0,10.0,10.0",
+        check_command => "check_local_load!$warn_load!$max_load",
       };
     "Swap usage":
       local => {
@@ -25,8 +35,13 @@ class profile::monitoring::services {
         check_command => "check_command_output!fail2ban-client ping!pong!-r root",
       };
     "NTP is activated and working":
-      local => {
-        check_command => "check_ntp",
+      master => {
+        check_interval      => "60",
+        freshness_threshold => Integer(60*60*1.5),
+      },
+      local  => {
+        check_command  => "check_ntp",
+        check_interval => "60"
       };
     "No mdadm array is degraded":
       common => {
@@ -38,4 +53,5 @@ class profile::monitoring::services {
   }
 
   Profile::Monitoring::Local_service <| |>
+  Profile::Monitoring::External_service <| |>
 }