Monitor...:Config(3)
π NAME π
Monitoring::Plugin::Config is the module that reads nagios plugin .ini style config files, and honestly it's giving very useful bestie energy. This is the Monitor...:Config(3) page, hanging out in the User Contributed Perl Documentation section.
β¨ SYNOPSIS β¨
Okay so the whole vibe is literally this:
# Read given nagios plugin config file
$Config = Monitoring::Plugin::Config->read( '/etc/nagios/plugins.ini' );
# Search for and read default nagios plugin config file
$Config = Monitoring::Plugin::Config->read();
# Access sections and properties (returns scalars or arrayrefs)
$rootproperty = $Config->{_}->{rootproperty};
$one = $Config->{section}->{one};
$Foo = $Config->{section}->{Foo};
π¦ DESCRIPTION π¦
Monitoring::Plugin::Config is a subclass of the excellent Config::Tiny, bestie, with these changes:
- Repeated keys are allowed within sections, returning lists instead of scalars. So if a key shows up more than once, you're getting a list back, not a single scalar β slay.
- Write functionality has been removed i.e. access is read only. No writing, periodt. Read only, fr fr.
Monitoring::Plugin::Configsearches for a default nagios plugins file if no explicit filename is given toread(). 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.
πΈ SEE ALSO πΈ
Go peek at the cousins: Config::Tiny, Monitoring::Plugin. Iykyk.
π AUTHOR π
This code is maintained by the Monitoring Plugin Development Team: see https://monitoring-plugins.org.
π COPYRIGHT AND LICENSE π
Copyright (C) 2014 by Monitoring Plugin Team Copyright (C) 2006-2014 by Nagios Plugin Development Team
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Catch you later, bestie β signed off with perl v5.42.0, dated 2018-08-02, and the page is Monitor...:Config(3). Stay config-coded. π
π
π¦ where this page comes from
- opensuse-leap 16.0: perl-Monitoring-Plugin 0.40-bp160.1.8 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms