ReleaseEngineering/PuppetAgain/Modules/nrpe: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(Created page with "This module installs [http://exchange.nagios.org/directory/Addons/Monitoring-Agents/NRPE--2D-Nagios-Remote-Plugin-Executor/details NRPE], as well as configuring plugins and check...")
 
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 2: Line 2:


= Usage =
= Usage =
Include nrpe in the relevant [[ReleaseEngineering/Puppet/Modules/toplevel|toplevel]] class, then realize any Nrpe::Check instances that you need on that host, e.g.,
    include nrpe
    realize(Nrpe::Check['check_buildbot'])
    realize(Nrpe::Check['check_ide_smart'])
    realize(Nrpe::Check['check_procs_regex'])
    realize(Nrpe::Check['check_child_procs_regex'])


The available checks are listed in [http://hg.mozilla.org/build/puppet/file/tip/modules/nrpe/manifests/checks.pp modules/nrpe/manifests/checks.pp].
In the higher toplevel classes,
 
  include nrpe
 
gets the basic checks (but note it's not used on test slaves!).  At lower levels, include the checks you need, noting that the "check_" is replaced by "check::", e.g.,
 
  include nrpe::check::buildbot
  include nrpe::check::procs_regex
 
The available checks are in [http://hg.mozilla.org/build/puppet/file/tip/modules/nrpe/manifests/check modules/nrpe/manifests/check].


= Defining New Checks =
= Defining New Checks =


Remember that NRPE has _checks_, which are defined in the configuration, and _plugins_, which are scripts to which checks can refer.  Often, but not always, they have the same name.
Remember that NRPE has '''checks''', which are defined in the configuration, and '''plugins''', which are scripts to which checks can refer.  Often, but not always, they have the same name.


To add a new check, you'll need to add another virtual resource to [http://hg.mozilla.org/build/puppet/file/tip/modules/nrpe/manifests/checks.pp modules/nrpe/manifests/checks.pp], like the others thereThe title of the resource is the check name, and the ''cfg'' attribute is the entry for ''nrpe.cfg''If you also need to install a plugin, add a ''plugin'' attribute giving its name.  The plugin will be automatically installed from a file in [http://hg.mozilla.org/build/puppet/file/tip/modules/nrpe/files modules/nrpe/files] by the same name.
Add a new manifest file in ''modules/nrpe/manifests/check'', named after the check without the leading "check_"Add a ''nrpe::check'' resource for your check, with a ''cfg'' attribute specifying the configuration for the check (the portion following "command[whatever]=")To add a plugin, include a ''nrpe::plugin'' resource naming the plugin, and drop the plugin script into ''modules/nrpe/files''.  The existing classes provide excellent examples to follow.

Latest revision as of 21:37, 26 September 2012

This module installs NRPE, as well as configuring plugins and checks flexibly.

Usage

In the higher toplevel classes,

 include nrpe

gets the basic checks (but note it's not used on test slaves!). At lower levels, include the checks you need, noting that the "check_" is replaced by "check::", e.g.,

 include nrpe::check::buildbot
 include nrpe::check::procs_regex

The available checks are in modules/nrpe/manifests/check.

Defining New Checks

Remember that NRPE has checks, which are defined in the configuration, and plugins, which are scripts to which checks can refer. Often, but not always, they have the same name.

Add a new manifest file in modules/nrpe/manifests/check, named after the check without the leading "check_". Add a nrpe::check resource for your check, with a cfg attribute specifying the configuration for the check (the portion following "command[whatever]="). To add a plugin, include a nrpe::plugin resource naming the plugin, and drop the plugin script into modules/nrpe/files. The existing classes provide excellent examples to follow.