diff options
Diffstat (limited to 'modules/profile/manifests/monitoring/commands.pp')
-rw-r--r-- | modules/profile/manifests/monitoring/commands.pp | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/modules/profile/manifests/monitoring/commands.pp b/modules/profile/manifests/monitoring/commands.pp new file mode 100644 index 0000000..1c8d0b4 --- /dev/null +++ b/modules/profile/manifests/monitoring/commands.pp | |||
@@ -0,0 +1,70 @@ | |||
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_last_file_date", | ||
16 | ].each |$file| { | ||
17 | file { "$plugins/$file": | ||
18 | ensure => "present", | ||
19 | owner => "root", | ||
20 | group => "naemon", | ||
21 | mode => "0755", | ||
22 | source => "puppet:///modules/profile/monitoring/$file", | ||
23 | } | ||
24 | } | ||
25 | |||
26 | Nagios_command { | ||
27 | ensure => "present", | ||
28 | owner => "naemon", | ||
29 | group => "naemon", | ||
30 | target => $objects, | ||
31 | notify => Service["naemon"], | ||
32 | before => Service["naemon"], | ||
33 | require => File["/etc/naemon"], | ||
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": | ||
50 | command_line => '$USER2$/check_md_raid', | ||
51 | require => File["$plugins/check_md_raid"]; | ||
52 | "check_command_output": | ||
53 | command_line => '$USER2$/check_command -c "$ARG1$" -o "$ARG2$" $ARG3$', | ||
54 | require => File["$plugins/check_command"]; | ||
55 | "check_postgresql_replication": | ||
56 | command_line => '/usr/bin/sudo -u postgres $USER2$/check_postgres_replication "$ARG1$" "$ARG2$" "$ARG3$"', | ||
57 | require => File["$plugins/check_postgres_replication"]; | ||
58 | "check_last_file_date": | ||
59 | command_line => '$USER2$/check_last_file_date "$ARG1$" "$ARG2$" "$ARG3$"', | ||
60 | require => File["$plugins/check_last_file_date"], | ||
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 | } | ||