]>
Commit | Line | Data |
---|---|---|
d8f933bd IB |
1 | class profile::monitoring::commands inherits profile::monitoring { |
2 | ensure_packages(["monitoring-plugins"]) | |
3 | ||
0363f38e | 4 | file { $plugins: |
d8f933bd | 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", | |
96f8d0f0 | 15 | "check_date", |
b5305b5c IB |
16 | "check_last_file_date", |
17 | ].each |$file| { | |
0363f38e | 18 | file { "$plugins/$file": |
b5305b5c IB |
19 | ensure => "present", |
20 | owner => "root", | |
21 | group => "naemon", | |
22 | mode => "0755", | |
23 | source => "puppet:///modules/profile/monitoring/$file", | |
24 | } | |
d8f933bd IB |
25 | } |
26 | ||
27 | Nagios_command { | |
28 | ensure => "present", | |
29 | owner => "naemon", | |
30 | group => "naemon", | |
0363f38e | 31 | target => $objects, |
d8f933bd IB |
32 | notify => Service["naemon"], |
33 | before => Service["naemon"], | |
69624636 | 34 | require => File["/etc/naemon"], |
d8f933bd IB |
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": | |
63102a9b | 49 | command_line => '$USER1$/check_ntp_time -t 30 -q -H 0.arch.pool.ntp.org'; |
d8f933bd | 50 | "check_md_raid": |
b5305b5c | 51 | command_line => '$USER2$/check_md_raid', |
0363f38e | 52 | require => File["$plugins/check_md_raid"]; |
d8f933bd IB |
53 | "check_command_output": |
54 | command_line => '$USER2$/check_command -c "$ARG1$" -o "$ARG2$" $ARG3$', | |
0363f38e | 55 | require => File["$plugins/check_command"]; |
b5305b5c IB |
56 | "check_postgresql_replication": |
57 | command_line => '/usr/bin/sudo -u postgres $USER2$/check_postgres_replication "$ARG1$" "$ARG2$" "$ARG3$"', | |
0363f38e | 58 | require => File["$plugins/check_postgres_replication"]; |
b5305b5c IB |
59 | "check_last_file_date": |
60 | command_line => '$USER2$/check_last_file_date "$ARG1$" "$ARG2$" "$ARG3$"', | |
96f8d0f0 IB |
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"]; | |
d8f933bd IB |
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 | } |