]> git.immae.eu Git - perso/Immae/Projets/Puppet.git/blame - modules/profile/manifests/monitoring/services.pp
Fix monitoring load average
[perso/Immae/Projets/Puppet.git] / modules / profile / manifests / monitoring / services.pp
CommitLineData
d8f933bd 1class profile::monitoring::services {
d8f933bd 2
b5d92dc4
IB
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
69624636 13 profile::monitoring::local_service {
d8f933bd 14 "Size on root partition":
69624636
IB
15 local => {
16 check_command => "check_local_disk!20%!10%!/",
17 };
d8f933bd 18 "Total number of process":
69624636
IB
19 local => {
20 check_command => "check_local_procs!50!100!RSZDT",
21 };
d8f933bd 22 "Average load":
69624636 23 local => {
b5d92dc4 24 check_command => "check_local_load!$warn_load!$max_load",
69624636 25 };
d8f933bd 26 "Swap usage":
69624636
IB
27 local => {
28 check_command => "check_local_swap!20!10",
29 };
d8f933bd 30 "fail2ban is active":
b5305b5c
IB
31 sudos => {
32 "naemon-fail2ban" => "naemon ALL=(root) NOPASSWD: /usr/bin/fail2ban-client ping",
33 },
34 local => {
69624636 35 check_command => "check_command_output!fail2ban-client ping!pong!-r root",
69624636 36 };
d8f933bd 37 "NTP is activated and working":
69624636
IB
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 };
d8f933bd 48 }
b5305b5c
IB
49
50 Profile::Monitoring::Local_service <| |>
0cdf4940 51 Profile::Monitoring::External_service <| |>
d8f933bd 52}