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