]>
Commit | Line | Data |
---|---|---|
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 | master => { | |
39 | check_interval => "60", | |
40 | freshness_threshold => Integer(60*60*1.5), | |
41 | }, | |
42 | local => { | |
43 | check_command => "check_ntp", | |
44 | check_interval => "60" | |
45 | }; | |
46 | "No mdadm array is degraded": | |
47 | common => { | |
48 | ensure => (find_file("/proc/mdstat") == undef) ? { true => "absent", default =>"present" }, | |
49 | }, | |
50 | local => { | |
51 | check_command => "check_md_raid", | |
52 | }; | |
53 | } | |
54 | ||
55 | Profile::Monitoring::Local_service <| |> | |
56 | Profile::Monitoring::External_service <| |> | |
57 | } |