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