Class nagios::client
In: /modules/nagios/manifests/client.pp
Parent: nagios::params

Class: nagios::client

This is the main class to be included on all nodes to be monitored by nagios.

Defines

config   nrpe_file  

Resources

Included Classes

nagios::defaultchecks

Defines

config( $value )

Create nagios specific configuration by using nagios_* facts

nrpe_file( $args => 'false', $command => 'name', $plugin => 'name', $ensure => 'undef', $sudo => 'false', $template => 'check_generic' )

Define: nagios::client::nrpe_file

Install check-specific client nrpe configuration snippet files.

Resources

File["/etc/nagios/facter"]
   ensure => directory
   purge => true
   recurse => true
   require => Package["nrpe"]

Where to store configuration for our custom nagios_* facts

File[$nagios::client::plugin_dir]
   ensure => directory
   require => Package["nrpe"]

Create resource for the check_* parent resource

File[$nagios::params::nrpe_cfg_dir]
   owner => "root"
   group => $nrpe_group
   mode => "0750"
   purge => true
   recurse => true
   ensure => directory
   require => Package["nrpe"]

Included in the package, but we need to enable purging

File[$nagios::params::nrpe_cfg_file]
   owner => "root"
   group => $nrpe_group
   mode => "0640"
   content => template("nagios/nrpe.cfg.erb")
   require => Package["nrpe"]
Nagios::Check::Cpu[$host_name]
Nagios::Check::Disk[$host_name]
Nagios::Check::Load[$host_name]
Nagios::Check::Ping[$host_name]
Nagios::Host[$host_name]
   server => $server
   address => $host_address
   host_alias => $host_alias
   check_period => $host_check_period
   check_command => $host_check_command
   contact_groups => $host_contact_groups
   hostgroups => $host_hostgroups
   notes => $host_notes
   notes_url => $host_notes_url
   notification_period => $host_notification_period
   use => $host_use

The main nagios_host entry

Package[$nagios::params::nrpe_package]
   ensure => installed
   alias => $nagios::params::nrpe_package_alias

Base package(s)

Service[$nagios::params::nrpe_service]
   ensure => running
   enable => true
   hasstatus => true
   subscribe => File[$nagios::params::nrpe_cfg_file]

Most plugins use nrpe, so we install it everywhere

[Validate]