]> git.immae.eu Git - perso/Immae/Projets/Puppet.git/blob - modules/profile/manifests/monitoring/commands.pp
Add monitoring for cryptoportfolio
[perso/Immae/Projets/Puppet.git] / modules / profile / manifests / monitoring / commands.pp
1 class profile::monitoring::commands inherits profile::monitoring {
2 ensure_packages(["monitoring-plugins"])
3
4 file { $plugins:
5 ensure => "directory",
6 owner => "root",
7 group => "naemon",
8 mode => "0755",
9 }
10
11 [
12 "check_command",
13 "check_md_raid",
14 "check_postgres_replication",
15 "check_date",
16 "check_last_file_date",
17 ].each |$file| {
18 file { "$plugins/$file":
19 ensure => "present",
20 owner => "root",
21 group => "naemon",
22 mode => "0755",
23 source => "puppet:///modules/profile/monitoring/$file",
24 }
25 }
26
27 Nagios_command {
28 ensure => "present",
29 owner => "naemon",
30 group => "naemon",
31 target => $objects,
32 notify => Service["naemon"],
33 before => Service["naemon"],
34 require => File["/etc/naemon"],
35 }
36
37 nagios_command {
38 "check-host-alive":
39 command_line => '$USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 5';
40 "check_local_disk":
41 command_line => '$USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$';
42 "check_local_procs":
43 command_line => '$USER1$/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$';
44 "check_local_load":
45 command_line => '$USER1$/check_load -w $ARG1$ -c $ARG2$';
46 "check_local_swap":
47 command_line => '$USER1$/check_swap -n ok -w $ARG1$ -c $ARG2$';
48 "check_ntp":
49 command_line => '$USER1$/check_ntp_time -H 0.arch.pool.ntp.org';
50 "check_md_raid":
51 command_line => '$USER2$/check_md_raid',
52 require => File["$plugins/check_md_raid"];
53 "check_command_output":
54 command_line => '$USER2$/check_command -c "$ARG1$" -o "$ARG2$" $ARG3$',
55 require => File["$plugins/check_command"];
56 "check_postgresql_replication":
57 command_line => '/usr/bin/sudo -u postgres $USER2$/check_postgres_replication "$ARG1$" "$ARG2$" "$ARG3$"',
58 require => File["$plugins/check_postgres_replication"];
59 "check_last_file_date":
60 command_line => '$USER2$/check_last_file_date "$ARG1$" "$ARG2$" "$ARG3$"',
61 require => File["$plugins/check_last_file_date"];
62 "check_date":
63 command_line => '$USER2$/check_date "$ARG1$" "$ARG2$" "$ARG3$"',
64 require => File["$plugins/check_date"];
65 }
66
67 unless empty($naemon_url) {
68 nagios_command {
69 "notify-master":
70 command_line => '/etc/naemon/send_nrdp.sh -H "$HOSTADDRESS$" -s "$SERVICEDESC$" -S "$SERVICESTATEID$" -o "$SERVICEOUTPUT$"',
71 require => File["/etc/naemon/send_nrdp.sh"];
72 }
73 }
74 }