diff options
author | Holger Weiss <holger@zedat.fu-berlin.de> | 2014-01-11 16:38:18 (GMT) |
---|---|---|
committer | Holger Weiss <holger@zedat.fu-berlin.de> | 2014-01-11 16:38:18 (GMT) |
commit | 7b0fa5d642466e7cdd0d326658c3c06c27f8a1ec (patch) | |
tree | 1bd1fe366d4063f29ed6930b0750c6bd7a72b7e9 /web/input/doc/faq/nptest.md | |
parent | 16bf58546355690e0d9cf4e7d181255aac73b5c6 (diff) | |
download | site-7b0fa5d642466e7cdd0d326658c3c06c27f8a1ec.tar.gz |
Import most FAQ items from old web site
Import most of the FAQ entries from our old web site. A few outdated
questions have been omitted, many of the imported ones were updated in
one way or another, and the order of the development-related questions
has been changed. Also, the phrasing of some questions has been
modified (just to make the headings shorter).
For the record, this is the original list of questions from the old web
site:
General
-------
* Who controls the Nagios Plugins project?
* What license is Nagios Plugins distributed under?
* Who owns the copyright for the Nagios Plugin code?
* Can I submit a patch to this project?
* Do you accept donations?
Compiling
---------
* ./configure appears to hang
* check_ldap, check_radius or check_pgsql don't compile even though
configure output says the required libraries are present
* How come check_http/check_tcp doesn't work with --ssl?
* How do I compile the Nagios::Plugin perl module?
* I can't compile check_mysql on solaris
* I get '":types" is not exported by the Params::Validate module' when
running tests
* Why does Solaris use pst3 for check_procs?
Installing
----------
* Some of the root plugins (check_dhcp and check_icmp) haven't been
installed. What's happening?
* Why aren't my plugins installed as the nagios user? And what about
root plugins?
Development
-----------
* How do I use Git?
* Can I add extra tests to the C routines?
* Can I use the Nagios Plugins in my own project?
* How can I find out more about writing a plugin?
* How do I make changes on nagiosmib?
* How do I prove the C routines work?
* How do I use and update Gnulib?
* How do I use the Nagios::Plugin perl module?
* How do the test parameters in NPTest.pm work?
* Private C APIs
Diffstat (limited to 'web/input/doc/faq/nptest.md')
-rw-r--r-- | web/input/doc/faq/nptest.md | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/web/input/doc/faq/nptest.md b/web/input/doc/faq/nptest.md new file mode 100644 index 0000000..71fda44 --- /dev/null +++ b/web/input/doc/faq/nptest.md | |||
@@ -0,0 +1,42 @@ | |||
1 | title: NPTest | ||
2 | parent: FAQ | ||
3 | --- | ||
4 | |||
5 | # How do the NPTest parameters work? | ||
6 | |||
7 | NPTest.pm is a perl module, originally written by Peter Bray, and provides | ||
8 | some basic functions for testing the plugins. It has two main helpers: | ||
9 | `getTestParameter` and `testCmd`. | ||
10 | |||
11 | ## getTestParameter | ||
12 | |||
13 | Used to get parameters given in previous test runs. Use the 3 parameter | ||
14 | version (the 4 parameter version is deprecated). | ||
15 | |||
16 | Saved parameters are put in `/var/tmp/NPTest.cache`. Unfortunately, there is | ||
17 | no easy way of altering this - you will have to manually change this file to | ||
18 | edit existing parameters. | ||
19 | |||
20 | If you are adding new parameters, there are three values for the parameters | ||
21 | that you need to be aware of: | ||
22 | |||
23 | * default value | ||
24 | * the value that you check against in the test script | ||
25 | * an empty string, which is returned by getTestParameter when the test is run | ||
26 | via automated testing (technically, when no terminal is associated to the | ||
27 | test run) | ||
28 | |||
29 | You should try and ensure current tests are not affected when a new parameter | ||
30 | is added. So it may be better to say `NP_INTERNET_ACCESS`, with information | ||
31 | like *default "yes", disable with "no"* and check for | ||
32 | `NP_INTERNET_ACCESS == "no"` to skip the tests. | ||
33 | |||
34 | ## testCmd | ||
35 | |||
36 | This runs a command and returns an NPTest object back. You can combine | ||
37 | Test::More routines with the object to get the return code, output or perf | ||
38 | data to test against expected values. | ||
39 | |||
40 | See `plugins/t/check_disk.t` as an example test script. | ||
41 | |||
42 | <!--% # vim:set filetype=markdown textwidth=78 joinspaces: # %--> | ||