aboutsummaryrefslogtreecommitdiff
path: root/modules/profile/manifests/monitoring/commands.pp
blob: 7e9683f70809ebe8373ad6de6c0a681876f3149a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
class profile::monitoring::commands inherits profile::monitoring {
  ensure_packages(["monitoring-plugins"])

  file { "/etc/naemon/monitoring-plugins":
    ensure => "directory",
    owner  => "naemon",
    group  => "naemon",
    mode   => "0700",
  }

  file { "/etc/naemon/monitoring-plugins/check_command":
    ensure => "present",
    owner  => "naemon",
    group  => "naemon",
    mode   => "0700",
    source => "puppet:///modules/profile/monitoring/check_command",
  }

  file { "/etc/naemon/monitoring-plugins/check_md_raid":
    ensure => "present",
    owner  => "naemon",
    group  => "naemon",
    mode   => "0700",
    source => "puppet:///modules/profile/monitoring/check_md_raid",
  }

  Nagios_command {
    ensure => "present",
    owner  => "naemon",
    group  => "naemon",
    target => "/etc/naemon/objects.cfg",
    notify => Service["naemon"],
    before => Service["naemon"],
  }

  nagios_command {
    "check-host-alive":
      command_line => '$USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 5';
    "check_local_disk":
      command_line => '$USER1$/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$';
    "check_local_procs":
      command_line => '$USER1$/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$';
    "check_local_load":
      command_line => '$USER1$/check_load -w $ARG1$ -c $ARG2$';
    "check_local_swap":
      command_line => '$USER1$/check_swap -n ok -w $ARG1$ -c $ARG2$';
    "check_ntp":
      command_line => '$USER1$/check_ntp_time -H 0.arch.pool.ntp.org';
    "check_md_raid":
      command_line => '$USER2$/check_md_raid';
    "check_command_output":
      command_line => '$USER2$/check_command -c "$ARG1$" -o "$ARG2$" $ARG3$',
      require      => File["/etc/naemon/monitoring-plugins/check_command"];
  }

  unless empty($naemon_url) {
    nagios_command {
      "notify-master":
        command_line => '/etc/naemon/send_nrdp.sh -H "$HOSTADDRESS$" -s "$SERVICEDESC$" -S "$SERVICESTATEID$" -o "$SERVICEOUTPUT$"',
        require      => File["/etc/naemon/send_nrdp.sh"];
    }
  }
}