Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use nrpe for nagios monitoring; also add selinux
- Loading branch information
Thomas Vander Stichele
committed
Nov 5, 2013
1 parent
366a698
commit ecc5f14
Showing
2 changed files
with
49 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# = Define: sentry::nrpe_service | ||
# | ||
# This define deploys checks run through nagios. | ||
# | ||
# == Parameters | ||
# | ||
# [* plugin *] | ||
# What plugin to use. | ||
# | ||
define sentry::nrpe_service ( | ||
$plugin, | ||
$args | ||
) { | ||
|
||
if (' ' in $name) { | ||
fail("name ${name} cannot contain spaces") | ||
} | ||
|
||
include nagios::server | ||
|
||
# definition of nrpe check in client's /etc/nagios/nrpe.d/nrpe-$name.cfg | ||
nagios::client::nrpe_file { "check_${name}": | ||
plugin => $plugin, | ||
args => $args, | ||
} | ||
|
||
# definition of server-side nagios command to use nrpe client-side | ||
nagios_command { "check_nrpe_${name}": | ||
# -u turns socket timeout into unknowns | ||
command_line => "${nagios::server::nrpe} -u -c check_${name}" | ||
} | ||
|
||
# defition of server-side service name; needs to be unique by client name | ||
nagios::service { "${name}_nrpe_from_${::hostname}": | ||
check_command => "check_nrpe_${name}", | ||
use => "nrpe-service", | ||
|
||
} | ||
|
||
} |