1Monitoring::Plugin::ConUfsiegr(3C)ontributed Perl DocumeMnotnaittioorning::Plugin::Config(3)
2
3
4
6 Monitoring::Plugin::Config - read nagios plugin .ini style config files
7
9 # Read given nagios plugin config file
10 $Config = Monitoring::Plugin::Config->read( '/etc/nagios/plugins.ini' );
11
12 # Search for and read default nagios plugin config file
13 $Config = Monitoring::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 Monitoring::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 • Monitoring::Plugin::Config searches for a default nagios plugins
30 file if no explicit filename is given to read(). The current
31 standard 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, Monitoring::Plugin
47
49 This code is maintained by the Monitoring Plugin Development Team: see
50 https://monitoring-plugins.org
51
53 Copyright (C) 2014 by Monitoring Plugin Team Copyright (C)
54 2006-2014 by Nagios Plugin Development Team
55
56 This library is free software; you can redistribute it and/or modify it
57 under the same terms as Perl itself.
58
59
60
61perl v5.38.0 2023-07-20 Monitoring::Plugin::Config(3)