1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
class profile::monitoring::services {
Nagios_service {
ensure => "present",
owner => "naemon",
group => "naemon",
notify => Service["naemon"],
before => Service["naemon"],
require => File["/etc/naemon"],
}
sudo::conf {
default:
sudo_file_name => "naemon";
'naemon-fail2ban':
content => "naemon ALL=(root) NOPASSWD: /usr/bin/fail2ban-client ping";
}
profile::monitoring::local_service {
"Size on root partition":
local => {
check_command => "check_local_disk!20%!10%!/",
};
"Total number of process":
local => {
check_command => "check_local_procs!50!100!RSZDT",
};
"Average load":
local => {
check_command => "check_local_load!8.0,8.0,8.0!10.0,10.0,10.0",
};
"Swap usage":
local => {
check_command => "check_local_swap!20!10",
};
"fail2ban is active":
local => {
check_command => "check_command_output!fail2ban-client ping!pong!-r root",
require => Sudo::Conf["naemon-fail2ban"],
};
"NTP is activated and working":
local => {
check_command => "check_ntp",
};
"No mdadm array is degraded":
common => {
ensure => (find_file("/proc/mdstat") == undef) ? { true => "absent", default =>"present" },
},
local => {
check_command => "check_md_raid",
};
}
}
|