From 42b94f45905d7545b93c86308403ce3a6c285faa Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Mon, 30 Sep 2013 00:39:30 +0200 Subject: Add extra-opts documentation Import the --extra-opts documentation from our old site. The --help output of plugins refers to . diff --git a/etc/nginx/site.conf b/etc/nginx/site.conf index 8d56aeb..4ef3ad1 100644 --- a/etc/nginx/site.conf +++ b/etc/nginx/site.conf @@ -61,7 +61,7 @@ server { location ^~ /snapshot { return 301 /download$request_uri; } - location ~ ^/(?:man|guidelines$) { + location ~ ^/(?:man|guidelines|extra-opts$) { return 301 /doc$request_uri.html; } } diff --git a/web/content/doc/extra-opts.md b/web/content/doc/extra-opts.md new file mode 100644 index 0000000..542c199 --- /dev/null +++ b/web/content/doc/extra-opts.md @@ -0,0 +1,72 @@ +title: Extra-Opts +parent: Documentation +--- + +# Extra-Opts + +Starting with the 1.4.12 release, Nagios C plugins support reading +configuration options from a configuration file. This needs to be enabled at +compile-time for now (`--enable-extra-opts`) and will be enabled by default in +the future. Perl plugins using the Nagios::Plugin module have this support +since version 0.16. + +You can easily know if a plugin supports *extra-opts* by checking the `--help` +output for the `--extra-opts` option. Once compiled in, the `--extra-opts` +plugin option allows reading extra options from a config file. The syntax for +the command is: + + --extra-opts=[section][@file] + +Some examples: + +* Read `special_opts` section of default config file: + + ./check_stuff --extra-opts=special_opts + +* Read `special_opts` section of `/etc/myconfig.ini`: + + ./check_stuff --extra-opts=special_opts@/etc/myconfig.ini + +* Read `check_stuff` section of `/etc/myconfig.ini`: + + ./check_stuff --extra-opts=@/etc/myconfig.ini + +* Read `check_stuff` section of default config file and use additional + arguments along with the other specified arguments (*extra-opts* arguments + are always processed first no matter where `--extra-opts` appears on the + command line): + + ./check_stuff --extra-opts -jk --some-other-opt + +The default nagios plugins file is used if no explicit filename is given. The +current standard locations checked are: + +* `/etc/nagios/plugins.ini` +* `/usr/local/nagios/etc/plugins.ini` +* `/usr/local/etc/nagios/plugins.ini` +* `/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 (this is a colon-separated list +just like `PATH`). The first `plugins.ini` or `nagios-plugins.ini` file found +in these directories will be used. + +To specify an option without parameter, you can use a key without value, but +the equal sign must remain, for example: + + allow-regex= + +Also note that repeated keys are allowed within sections just like you can +repeat arguments on the command line. + +The basic theory is that options specified in the configuration files are +substituted at the beginning of the command line. + +The initial use case for this functionality is for hiding passwords, so you do +not have to define sensitive credentials in the Nagios configuration and these +options won't appear in the command line. + + -- cgit v0.10-9-g596f