]> git.immae.eu Git - perso/Immae/Projets/Puppet.git/blob - modules/profile/manifests/monitoring/services.pp
Fix monitoring load average
[perso/Immae/Projets/Puppet.git] / modules / profile / manifests / monitoring / services.pp
1 class profile::monitoring::services {
2
3 $warn_1_load = 1.5*$facts["processorcount"]
4 $warn_5_load = $facts["processorcount"]
5 $warn_15_load = $facts["processorcount"]
6 $warn_load = join([$warn_1_load, $warn_5_load, $warn_15_load], ",")
7
8 $max_1_load = 2*$facts["processorcount"]
9 $max_5_load = $facts["processorcount"]
10 $max_15_load = $facts["processorcount"]
11 $max_load = join([$max_1_load, $max_5_load, $max_15_load], ",")
12
13 profile::monitoring::local_service {
14 "Size on root partition":
15 local => {
16 check_command => "check_local_disk!20%!10%!/",
17 };
18 "Total number of process":
19 local => {
20 check_command => "check_local_procs!50!100!RSZDT",
21 };
22 "Average load":
23 local => {
24 check_command => "check_local_load!$warn_load!$max_load",
25 };
26 "Swap usage":
27 local => {
28 check_command => "check_local_swap!20!10",
29 };
30 "fail2ban is active":
31 sudos => {
32 "naemon-fail2ban" => "naemon ALL=(root) NOPASSWD: /usr/bin/fail2ban-client ping",
33 },
34 local => {
35 check_command => "check_command_output!fail2ban-client ping!pong!-r root",
36 };
37 "NTP is activated and working":
38 local => {
39 check_command => "check_ntp",
40 };
41 "No mdadm array is degraded":
42 common => {
43 ensure => (find_file("/proc/mdstat") == undef) ? { true => "absent", default =>"present" },
44 },
45 local => {
46 check_command => "check_md_raid",
47 };
48 }
49
50 Profile::Monitoring::Local_service <| |>
51 Profile::Monitoring::External_service <| |>
52 }