Puppet Class: nagios::server::plugins::event_handler

Defined in:
manifests/server/plugins/event_handler.pp

Overview

Class: nagios::server::plugins::event_handler

This is going to create the event handler script and command that can then be used by client based services for example nagios::nrpe::process. It has a standard event handler that should be sufficent for most things, but could be extended in the future.

Authors

Ben Field <ben.field@concreteplatform.com>



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'manifests/server/plugins/event_handler.pp', line 11

class nagios::server::plugins::event_handler {
  require nagios::server::config
  include nagios::server::service

  file { 'event_handler.sh':
    ensure  => present,
    path    => '/usr/lib/nagios/eventhandlers/event_handler.sh',
    source  => 'puppet:///modules/nagios/server/plugins/event_handler.sh',
    owner   => 'nagios',
    group   => 'nagios',
    mode    => '0755',
    require => File['/usr/lib/nagios/eventhandlers'],
  }

  nagios_command { 'event_handler':
    ensure       => 'present',
    command_name => 'event_handler',
    command_line => '/usr/lib/nagios/eventhandlers/event_handler.sh -h $HOSTADDRESS$ -s $SERVICESTATE$ -t $SERVICESTATETYPE$ -a $SERVICEATTEMPT$ -c $ARG1$',
    target       => '/etc/nagios3/conf.d/puppet/command_nagios.cfg',
    notify       => Exec['rechmod'],
  }

}