aboutsummaryrefslogblamecommitdiff
path: root/modules/profile/manifests/monitoring/commands.pp
blob: a25f7b3e6af655e42da1523e7c1252a53c9ee2ab (plain) (tree)
































                                                                   
                                   





























                                                                                                                                    
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"],
    require => File["/etc/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"];
    }
  }
}