diff options
Diffstat (limited to 'modules/profile/manifests/monitoring/commands.pp')
-rw-r--r-- | modules/profile/manifests/monitoring/commands.pp | 63 |
1 files changed, 63 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..7e9683f --- /dev/null +++ b/modules/profile/manifests/monitoring/commands.pp | |||
@@ -0,0 +1,63 @@ | |||
1 | class profile::monitoring::commands inherits profile::monitoring { | ||
2 | ensure_packages(["monitoring-plugins"]) | ||
3 | |||
4 | file { "/etc/naemon/monitoring-plugins": | ||
5 | ensure => "directory", | ||
6 | owner => "naemon", | ||
7 | group => "naemon", | ||
8 | mode => "0700", | ||
9 | } | ||
10 | |||
11 | file { "/etc/naemon/monitoring-plugins/check_command": | ||
12 | ensure => "present", | ||
13 | owner => "naemon", | ||
14 | group => "naemon", | ||
15 | mode => "0700", | ||
16 | source => "puppet:///modules/profile/monitoring/check_command", | ||
17 | } | ||
18 | |||
19 | file { "/etc/naemon/monitoring-plugins/check_md_raid": | ||
20 | ensure => "present", | ||
21 | owner => "naemon", | ||
22 | group => "naemon", | ||
23 | mode => "0700", | ||
24 | source => "puppet:///modules/profile/monitoring/check_md_raid", | ||
25 | } | ||
26 | |||
27 | Nagios_command { | ||
28 | ensure => "present", | ||
29 | owner => "naemon", | ||
30 | group => "naemon", | ||
31 | target => "/etc/naemon/objects.cfg", | ||
32 | notify => Service["naemon"], | ||
33 | before => Service["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 | "check_command_output": | ||
52 | command_line => '$USER2$/check_command -c "$ARG1$" -o "$ARG2$" $ARG3$', | ||
53 | require => File["/etc/naemon/monitoring-plugins/check_command"]; | ||
54 | } | ||
55 | |||
56 | unless empty($naemon_url) { | ||
57 | nagios_command { | ||
58 | "notify-master": | ||
59 | command_line => '/etc/naemon/send_nrdp.sh -H "$HOSTADDRESS$" -s "$SERVICEDESC$" -S "$SERVICESTATEID$" -o "$SERVICEOUTPUT$"', | ||
60 | require => File["/etc/naemon/send_nrdp.sh"]; | ||
61 | } | ||
62 | } | ||
63 | } | ||