Nagios:...:Config(3)
π NAME
ok so bestie, meet Nagios::Plugin::Config β it reads nagios plugin .ini style config files. that's it, that's the whole vibe. it reads files, it does not write them, periodt.
β¨ SYNOPSIS β¨
# 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};
like, you literally just call read and then poke at hash keys. the {_} one is the root section btw, iykyk π«Ά
πΈ DESCRIPTION πΈ
Nagios::Plugin::Config is a subclass of the excellent Config::Tiny β yes, we're stanning. it's the same iconic energy, just with these glow-ups:
- repeated keys are allowed within sections π and they come back as lists instead of scalars. so when a key shows up more than once you get an arrayref situation, not a sad lone value.
- write functionality has been removed, meaning access is read only. you look, you don't touch. no cap.
Nagios::Plugin::Configsearches for a default nagios plugins file if you don't handread()an explicit filename. the current standard locations it checks 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
(copy those exactly bestie, don't get creative with them π)
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. first come, first served, main character wins π
β lowkey important: it'sNAGIOS_CONFIG_PATHholding directories, and the winner is whichever ofplugins.ini/nagios-plugins.iniit finds first.
π¦ SEE ALSO π¦
Config::Tiny, Nagios::Plugin
go give them a follow, they're the family π
π AUTHORS π
this code is maintained by the Nagios Plugin Development Team: <http://nagiosplug.sourceforge.net>.
π COPYRIGHT and LICENCE π
Copyright (C) 2006-2007 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.
and that's the whole thing, bestie β¨ this masterpiece dropped in the perl v5.42.0 era, dated 2024-03-04, and it's filed under Nagios:...:Config(3) β mwah, slay, go read some .ini files ππ§π
π¦ where this page comes from
- opensuse-leap 16.0: perl-Nagios-Plugin 0.36-bp160.1.8 Β· Artistic-1.0 or GPL-2.0+
- opensuse-leap 16.0: perl-Nagios-Plugin 0.36-bp160.1.8 Β· Artistic-1.0 or GPL-2.0+
- opensuse-leap 16.0: perl-Nagios-Plugin 0.36-bp160.1.8 Β· Artistic-1.0 or GPL-2.0+
- opensuse-leap 16.0: perl-Nagios-Plugin 0.36-bp160.1.8 Β· Artistic-1.0 or GPL-2.0+
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms