1Nagios::Plugin::Config(U3s)er Contributed Perl DocumentatNiaognios::Plugin::Config(3)
2
3
4
6 Nagios::Plugin::Config - read nagios plugin .ini style config files
7
9 # Read given nagios plugin config file
10 $Config = Nagios::Plugin::Config->read( '/etc/nagios/plugins.ini' );
11
12 # Search for and read default nagios plugin config file
13 $Config = Nagios::Plugin::Config->read();
14
15 # Access sections and properties (returns scalars or arrayrefs)
16 $rootproperty = $Config->{_}->{rootproperty};
17 $one = $Config->{section}->{one};
18 $Foo = $Config->{section}->{Foo};
19
21 Nagios::Plugin::Config is a subclass of the excellent Config::Tiny,
22 with the following changes:
23
24 · Repeated keys are allowed within sections, returning lists instead
25 of scalars
26
27 · Write functionality has been removed i.e. access is read only
28
29 · Nagios::Plugin::Config searches for a default nagios plugins file
30 if no explicit filename is given to "read()". The current standard
31 locations checked are:
32
33 /etc/nagios/plugins.ini
34 /usr/local/nagios/etc/plugins.ini
35 /usr/local/etc/nagios /etc/opt/nagios/plugins.ini
36 /etc/nagios-plugins.ini
37 /usr/local/etc/nagios-plugins.ini
38 /etc/opt/nagios-plugins.ini
39
40 To use a custom location, set a "NAGIOS_CONFIG_PATH" environment
41 variable to the set of directories that should be checked. The
42 first "plugins.ini" or "nagios-plugins.ini" file found will be
43 used.
44
46 Config::Tiny, Nagios::Plugin
47
49 This code is maintained by the Nagios Plugin Development Team:
50 <http://nagiosplug.sourceforge.net>.
51
53 Copyright (C) 2006-2007 by Nagios Plugin Development Team
54
55 This library is free software; you can redistribute it and/or modify it
56 under the same terms as Perl itself.
57
58
59
60perl v5.12.1 2010-04-15 Nagios::Plugin::Config(3)