diff options
author | Holger Weiss <holger@zedat.fu-berlin.de> | 2013-09-29 22:39:30 (GMT) |
---|---|---|
committer | Holger Weiss <holger@zedat.fu-berlin.de> | 2013-09-29 22:39:30 (GMT) |
commit | 42b94f45905d7545b93c86308403ce3a6c285faa (patch) | |
tree | 938919e533d82656017dd748b2e4c17017e3c095 | |
parent | 1227b5ad906d875448a3bf4f4c25b5df2ca4f492 (diff) | |
download | site-42b94f45905d7545b93c86308403ce3a6c285faa.tar.gz |
Add extra-opts documentation
Import the --extra-opts documentation from our old site. The --help
output of plugins refers to <http://nagiosplugins.org/extra-opts>.
-rw-r--r-- | etc/nginx/site.conf | 2 | ||||
-rw-r--r-- | web/content/doc/extra-opts.md | 72 |
2 files changed, 73 insertions, 1 deletions
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 { | |||
61 | location ^~ /snapshot { | 61 | location ^~ /snapshot { |
62 | return 301 /download$request_uri; | 62 | return 301 /download$request_uri; |
63 | } | 63 | } |
64 | location ~ ^/(?:man|guidelines$) { | 64 | location ~ ^/(?:man|guidelines|extra-opts$) { |
65 | return 301 /doc$request_uri.html; | 65 | return 301 /doc$request_uri.html; |
66 | } | 66 | } |
67 | } | 67 | } |
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 @@ | |||
1 | title: Extra-Opts | ||
2 | parent: Documentation | ||
3 | --- | ||
4 | |||
5 | # Extra-Opts | ||
6 | |||
7 | Starting with the 1.4.12 release, Nagios C plugins support reading | ||
8 | configuration options from a configuration file. This needs to be enabled at | ||
9 | compile-time for now (`--enable-extra-opts`) and will be enabled by default in | ||
10 | the future. Perl plugins using the Nagios::Plugin module have this support | ||
11 | since version 0.16. | ||
12 | |||
13 | You can easily know if a plugin supports *extra-opts* by checking the `--help` | ||
14 | output for the `--extra-opts` option. Once compiled in, the `--extra-opts` | ||
15 | plugin option allows reading extra options from a config file. The syntax for | ||
16 | the command is: | ||
17 | |||
18 | --extra-opts=[section][@file] | ||
19 | |||
20 | Some examples: | ||
21 | |||
22 | * Read `special_opts` section of default config file: | ||
23 | |||
24 | ./check_stuff --extra-opts=special_opts | ||
25 | |||
26 | * Read `special_opts` section of `/etc/myconfig.ini`: | ||
27 | |||
28 | ./check_stuff --extra-opts=special_opts@/etc/myconfig.ini | ||
29 | |||
30 | * Read `check_stuff` section of `/etc/myconfig.ini`: | ||
31 | |||
32 | ./check_stuff --extra-opts=@/etc/myconfig.ini | ||
33 | |||
34 | * Read `check_stuff` section of default config file and use additional | ||
35 | arguments along with the other specified arguments (*extra-opts* arguments | ||
36 | are always processed first no matter where `--extra-opts` appears on the | ||
37 | command line): | ||
38 | |||
39 | ./check_stuff --extra-opts -jk --some-other-opt | ||
40 | |||
41 | The default nagios plugins file is used if no explicit filename is given. The | ||
42 | current standard locations checked are: | ||
43 | |||
44 | * `/etc/nagios/plugins.ini` | ||
45 | * `/usr/local/nagios/etc/plugins.ini` | ||
46 | * `/usr/local/etc/nagios/plugins.ini` | ||
47 | * `/etc/opt/nagios/plugins.ini` | ||
48 | * `/etc/nagios-plugins.ini` | ||
49 | * `/usr/local/etc/nagios-plugins.ini` | ||
50 | * `/etc/opt/nagios-plugins.ini` | ||
51 | |||
52 | To use a custom location, set a `NAGIOS_CONFIG_PATH` environment variable to | ||
53 | the set of directories that should be checked (this is a colon-separated list | ||
54 | just like `PATH`). The first `plugins.ini` or `nagios-plugins.ini` file found | ||
55 | in these directories will be used. | ||
56 | |||
57 | To specify an option without parameter, you can use a key without value, but | ||
58 | the equal sign must remain, for example: | ||
59 | |||
60 | allow-regex= | ||
61 | |||
62 | Also note that repeated keys are allowed within sections just like you can | ||
63 | repeat arguments on the command line. | ||
64 | |||
65 | The basic theory is that options specified in the configuration files are | ||
66 | substituted at the beginning of the command line. | ||
67 | |||
68 | The initial use case for this functionality is for hiding passwords, so you do | ||
69 | not have to define sensitive credentials in the Nagios configuration and these | ||
70 | options won't appear in the command line. | ||
71 | |||
72 | <!--% # vim:set filetype=markdown textwidth=78 joinspaces: # %--> | ||