Nagios::Plugin::Config(3pm)

Nagios::Plugin::Config3pm

Read nagios plugin .ini style config files

Usage

    # Read given nagios plugin config file
    $Config = Nagios::Plugin::Config->read( '/etc/nagios/plugins.ini' );
    # Search for and read default nagios plugin config file
    $Config = Nagios::Plugin::Config->read();
    # Access sections and properties (returns scalars or arrayrefs)
    $rootproperty =  $Config->{_}->{rootproperty};
    $one = $Config->{section}->{one};
    $Foo = $Config->{section}->{Foo};

Overview

Nagios::Plugin::Config is a subclass of the excellent Config::Tiny, with the following changes:

•

Repeated keys are allowed within sections, returning lists instead of scalars

•

Write functionality has been removed i.e. access is read only

•

Nagios::Plugin::Config searches for a default nagios plugins file if no explicit filename is given to "read()". The current standard locations checked are:

/etc/nagios/plugins.ini
/usr/local/nagios/etc/plugins.ini
/usr/local/etc/nagios /etc/opt/nagios/plugins.ini
/etc/nagios-plugins.ini
/usr/local/etc/nagios-plugins.ini
/etc/opt/nagios-plugins.ini

To use a custom location, set a "NAGIOS_CONFIG_PATH" environment variable to the set of directories that should be checked. The first "plugins.ini" or "nagios-plugins.ini" file found will be used.

Releases

3 releases since Debian 6.0 (Squeeze); the text changed 1 time.

  1. 6.0
  2. 7–8

Authors

This code is maintained by the Nagios Plugin Development Team: <http://nagiosplug.sourceforge.net>.

From libnagios-plugin-perl 0.36-1 in Debian 8 (Jessie). Parsed by carta from the page's man source.