This page last changed on Oct 25, 2013 by mbabik.

Overview

This document describes the policy to accept and integrate new probes into the SAM infrastructure.

Development

Please refer to the official Nagios documentation for probe development

Probes can be developed in any of these languages:

  • Python (2.4)
  • Perl (5.8) - in case of Perl usage of module Nagios::Plugin is highly recommended.
  • C
  • shell scripting (Bash, Bourne)

Some other Nagios conditions:

  • Each probe must provide the following arguments:
    -h help (--help)
    -t timeout (--timeout)
    

    The following arguments should be used if applicable:

    -H hostname (--hostname)
    -p port (--port)
    -u url (--url)
    -v verbose (--verbose)
    -w warning threshold (--warning)
    -c critical threshold (--critical)
    
  • Maximum output size for test/plugin output is 16KB. Above that limit the output will be truncated.

Packaging

Please refer to the official EPEL documentation for packaging:

Some considerations about naming:

  • Each probe package should have a unique namespace. Currently there is no strict definition of the namespace and the existing packages loosely follow revers DNS scheme (e.g. org.sam, hr.srce).
  • Each probe package name should use "nagios-plugins-emi.xxx" where 'xxx' is the name of the service to test (e.g. nagios-plugins-emi.bdii). This makes the name consistent with other nagios plugins.
  • Each metric that the probe implements must have a unique name, we suggest to use the package namespace and a short description of the test (e.g. nagios-plugins-emi.bdii.freshness)

Some considerations about structure:

  • Probes should be stored in directory:
    /usr/libexec/grid-monitoring/probes/<probe_namespace>
    
  • If probes creates temporary files, package should create directory:
    /var/lib/grid-monitoring/<probe_namespace>
    

    With ownership nagios:nagios and permissions 750.

  • If probes package contains configuration files, they should be stored in directory:
    /etc/nagios/plugins/<probe_namespace>/
    

Some considerations about dependencies management:

  • Each probe is responsible for handling its dependencies.
  • The environment needed to execute each probe must be defined by the probe. This will replace the need to configure middleware user interface (UI) from the SAM framework side.
  • The libraries used by the current probes (python-gridmon, perl TOM::Nagios, perl GridMon::sgutils) will be provided by the SAM team and released either in EPEL or in the EMI external repository.

Integration and Testing

The integration and testing of probes foresees the following phases (for probes provided by EMI):

  1. Each PT develops and tests its own probes in their development environments.
  2. EMI builds a common meta-package including all available probes.
  3. EMI tests the execution of probes using a dedicated SAM-nagios instances (with the support of the SAM team).
  4. SAM validates and distributes a new SAM-Nagios release updating the dependency on EMI probes meta-package to the latest version.

For custom probes developed by third parties or regions:

  1. Add the mapping between service flavour and new test in your local POEM instance
  2. Create a JSON metric config file (in /etc/ncg-metric-config.d/something.conf; example https://tomtools.cern.ch/confluence/display/SAM/NCG#NCG-Metricconfigurationfile)
  3. Install/upload your probe to the SAM/Nagios box




Document generated by Confluence on Feb 27, 2014 10:19