I have NRPE daemons running on all of my remote Linux boxes. I have a couple configurations in place and I'm trying to standardize the paths in my nrpe.cfg. The changes are deployed via Puppet.
I would like to use the following syntax:
command[mycommand]=$USER1$/check_tcp .. etc.
The $USER1$ variable is not available in my NRPE setup. I could write Puppet templates for all the variants but I would much prefer to manage this through a native method. Is there anything available to do so? If not does anyone have a sample Puppet config that will address this?
$USERn$
is a standard macro for Nagios. They are defined in theresource.cfg
file:and this file is included in the main configuration:
AFAIK, you cannot use it on the remote host, with NRPE.
I put together a custom Fact that addresses my needs. I also tried a small switch that would apply the arch but it wasn't cross platform.
lib/facter/nrpe.rb
Here are some of the custom facts, and manifest code we use for handling nrpe. Be sure that puppet ensures the service is setup to start at boot, and is running. Since we run Fedora 15, with an older version of puppet, be aware that some versions of puppet can't handle Fedora 15's systemd.
nrpe_plugin_directory.rb
nrpe_cfg_file.rb
Manifest code:
In modules/nagios/target/params.pp:
In modules/nagios/templates/custom-checks.cfg
In modules/nagios/target.pp: