Chef cookbook to install Nagios NRPE client (was previously part of the Nagios cookbook)
This cookbook is a custom-resource cookbook. Legacy recipes and node attributes have been removed; see migration.md for migration examples.
This cookbook is maintained by the Sous Chefs. The Sous Chefs are a community of Chef cookbook maintainers working together to maintain important cookbooks. If you’d like to know more please visit sous-chefs.org or come chat with us on the Chef Community Slack in #sous-chefs.
Chef 15.3+
- Debian
- FreeBSD
- Ubuntu
- RHEL including CentOS and Oracle Linux
- Amazon Linux (2.x cannot be installed via package)
- Fedora
- SUSE / openSUSE
Notes: This cookbook has been tested on the listed platforms. It may work on other platforms with or without modification.
Installs NRPE from packages or source, installs plugins, renders server configuration, manages allowed hosts, and enables/starts the service.
nrpe 'default' do
allowed_hosts %w(192.0.2.10)
endThe check resource provides an easy way to add and remove NRPE checks from within cookbooks.
:addcreates a NRPE configuration file and reloads the NRPE process. Default action.:removeremoves the configuration file and reloads the NRPE process
command_nameThe name of the check. This is the command that you will call from your nagios_service data bag checkwarning_conditionString that you will pass to the command with the -w flagcritical_conditionString that you will pass to the command with the -c flagcommandThe actual command to execute (including the path). If this is not specified, this will useplugin_dir/command_nameas the path to the command.parametersAny additional parameters you wish to pass to the plugin.templateUse the specific erb template to render NRPE config command.
# Use resource to define check_load
nrpe_check "check_load" do
command '/usr/lib/nagios/plugins/check_load'
warning_condition '10'
critical_condition '15'
action :add
end# Remove the check_load definition
nrpe_check "check_load" do
action :remove
endUsing template:
nrpe_check "check_load" do
template "check_load.cfg.erb"
action :add
endThis project exists thanks to all the people who contribute.
Thank you to all our backers!
Support this project by becoming a sponsor. Your logo will show up here with a link to your website.