]>
Commit | Line | Data |
---|---|---|
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 => "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 { "/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 | } | |
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"], | |
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["/etc/naemon/monitoring-plugins/check_md_raid"]; | |
52 | "check_command_output": | |
53 | command_line => '$USER2$/check_command -c "$ARG1$" -o "$ARG2$" $ARG3$', | |
54 | require => File["/etc/naemon/monitoring-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["/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"], | |
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 | } |