diff options
Diffstat (limited to 'web/input/doc')
24 files changed, 912 insertions, 1 deletions
diff --git a/web/input/doc/faq/build-perl-module.md b/web/input/doc/faq/build-perl-module.md new file mode 100644 index 0000000..0ec97ac --- /dev/null +++ b/web/input/doc/faq/build-perl-module.md | |||
@@ -0,0 +1,15 @@ | |||
1 | title: Building Nagios::Plugin | ||
2 | parent: FAQ | ||
3 | --- | ||
4 | |||
5 | # How do I build Nagios::Plugin? | ||
6 | |||
7 | This is currently an optional setting at configure time. You need to run: | ||
8 | |||
9 | ./configure --enable-perl-modules | ||
10 | |||
11 | Then, `make`, `make` `install`, `make` `test`, and `make` `clean` will include | ||
12 | the Perl modules that are in the `perlmods/` directory as expected. They are | ||
13 | installed into `$prefix/perl`. | ||
14 | |||
15 | <!--% # vim:set filetype=markdown textwidth=78 joinspaces: # %--> | ||
diff --git a/web/input/doc/faq/compilation.md b/web/input/doc/faq/compilation.md new file mode 100644 index 0000000..b58566a --- /dev/null +++ b/web/input/doc/faq/compilation.md | |||
@@ -0,0 +1,18 @@ | |||
1 | title: Building Nagios Plugins | ||
2 | parent: FAQ | ||
3 | --- | ||
4 | |||
5 | # How do I compile the plugins? | ||
6 | |||
7 | To compile version `1.x` of the plugins, you run: | ||
8 | |||
9 | gzip -dc nagios-plugins-1.x.tar.gz | tar -xf - | ||
10 | cd nagios-plugins-1.x | ||
11 | ./configure | ||
12 | make | ||
13 | |||
14 | You can then [install the plugins][installation]. | ||
15 | |||
16 | [installation]: doc/faq/installation.html "Installation" | ||
17 | |||
18 | <!--% # vim:set filetype=markdown textwidth=78 joinspaces: # %--> | ||
diff --git a/web/input/doc/faq/configure-hangs.md b/web/input/doc/faq/configure-hangs.md new file mode 100644 index 0000000..7c934cd --- /dev/null +++ b/web/input/doc/faq/configure-hangs.md | |||
@@ -0,0 +1,21 @@ | |||
1 | title: Configure hangs | ||
2 | parent: FAQ | ||
3 | --- | ||
4 | |||
5 | # The configure script appears to hang | ||
6 | |||
7 | If you find that the configure script appears to hang on this line: | ||
8 | |||
9 | checking for redhat spopen problem... | ||
10 | |||
11 | Then you probably have a badly configured DNS server. This part of configure | ||
12 | is testing for a pthread problem in BIND that is a kernel problem on some Red | ||
13 | Hat derived versions of Linux (around kernel 2.6.9-11). It runs 10 x 100 | ||
14 | nslookup calls to see if your kernel has this problem. If it does, then at | ||
15 | least one of those calls will fail. Failure rate could be anywhere between 1% | ||
16 | and 50%. | ||
17 | |||
18 | To force the workaround and ignore the test, run `./configure` with the | ||
19 | `--enable-redhat-pthread-workaround` switch. | ||
20 | |||
21 | <!--% # vim:set filetype=markdown textwidth=78 joinspaces: # %--> | ||
diff --git a/web/input/doc/faq/contribute.md b/web/input/doc/faq/contribute.md new file mode 100644 index 0000000..fe97a80 --- /dev/null +++ b/web/input/doc/faq/contribute.md | |||
@@ -0,0 +1,26 @@ | |||
1 | title: Can I submit a patch? | ||
2 | parent: FAQ | ||
3 | --- | ||
4 | |||
5 | # Can I submit a patch? | ||
6 | |||
7 | Of course you can! This is an open source project! | ||
8 | |||
9 | Ideally, [fork][fork] our [repository][repo] and create a [pull request][pull] | ||
10 | on [GitHub][github], so your patch doesn't get lost. Then chase up via the | ||
11 | [development mailing list][list], if nothing happens. But be aware, this | ||
12 | project is run by volunteers, so there is not necessarily immediate response! | ||
13 | |||
14 | By submitting a pull request, you are stating that this is your own work or | ||
15 | you have full rights to it. If your pull request is accepted, we will (of | ||
16 | course) retain the Git author name and email address, and we'll add your name | ||
17 | to the list of contributors in the [THANKS][thanks] file. | ||
18 | |||
19 | [repo]: https://github.com/nagios-plugins/repositories "Our Repositories" | ||
20 | [fork]: https://help.github.com/articles/fork-a-repo "Fork Documentation" | ||
21 | [pull]: https://help.github.com/articles/using-pull-requests "Pull Request Documentation" | ||
22 | [github]: https://github.com/ "GitHub" | ||
23 | [list]: list/listinfo/devel/ "Development Mailing List" | ||
24 | [thanks]: repositories/nagios-plugins/plain/THANKS.in "THANKS File" | ||
25 | |||
26 | <!--% # vim:set filetype=markdown textwidth=78 joinspaces: # %--> | ||
diff --git a/web/input/doc/faq/control.md b/web/input/doc/faq/control.md new file mode 100644 index 0000000..37a811f --- /dev/null +++ b/web/input/doc/faq/control.md | |||
@@ -0,0 +1,16 @@ | |||
1 | title: Who controls the project? | ||
2 | parent: FAQ | ||
3 | --- | ||
4 | |||
5 | # Who controls the Nagios Plugins project? | ||
6 | |||
7 | [Nagios Enterprises][enterprises] own the Nagios Plugins project, hence the | ||
8 | domain names of the site belong to Nagios Enterprises. However, the [Nagios | ||
9 | Plugins Development Team][team] are responsible for the running of the | ||
10 | project. This means that decisions about the web site and the development of | ||
11 | code related to the project are handled independently by the team. | ||
12 | |||
13 | [enterprises]: http://www.nagios.com/about/company "Nagios Enterprises" | ||
14 | [team]: team.html "Nagios Plugins Development Team" | ||
15 | |||
16 | <!--% # vim:set filetype=markdown textwidth=78 joinspaces: # %--> | ||
diff --git a/web/input/doc/faq/donations.md b/web/input/doc/faq/donations.md new file mode 100644 index 0000000..0cfb7c0 --- /dev/null +++ b/web/input/doc/faq/donations.md | |||
@@ -0,0 +1,16 @@ | |||
1 | title: Do you accept donations? | ||
2 | parent: FAQ | ||
3 | --- | ||
4 | |||
5 | # Do you accept donations? | ||
6 | |||
7 | The [Nagios Plugins Development Team][team] accepts donations for the project. | ||
8 | We have a separate Paypal account that is used for donations, which is | ||
9 | administered by the team leader. | ||
10 | |||
11 | Donations go towards paying for the small administrative charges we have. We | ||
12 | might also use some of the funds for team beer when we meet up in person. | ||
13 | |||
14 | [team]: team.html "Nagios Plugins Development Team" | ||
15 | |||
16 | <!--% # vim:set filetype=markdown textwidth=78 joinspaces: # %--> | ||
diff --git a/web/input/doc/faq/extra-tests.md b/web/input/doc/faq/extra-tests.md new file mode 100644 index 0000000..b508195 --- /dev/null +++ b/web/input/doc/faq/extra-tests.md | |||
@@ -0,0 +1,26 @@ | |||
1 | title: Testing C routines | ||
2 | parent: FAQ | ||
3 | --- | ||
4 | |||
5 | # Can I add extra tests to the C routines? | ||
6 | |||
7 | The idea with the testing is to move as many functions as possible "lower | ||
8 | down"; i.e., to the `lib/utils_*.c` files. These functions can then be tested | ||
9 | using the libtap routines in the `lib/tests/test_*.c` files. It is easier to | ||
10 | do unit testing here than to try and do higher level plugin testing, because | ||
11 | you can fake data easier at this level. | ||
12 | |||
13 | The routines available via [libtap][libtap] are equivalent to Perl's | ||
14 | [Test::Simple][test-simple] ones. | ||
15 | |||
16 | The libtap tests are separated out from the plugins ones (in `plugins/t`) | ||
17 | because: | ||
18 | |||
19 | 1. They are testing the files in `lib/`, so should reside there. | ||
20 | 2. They require [compiling][compilation] to run. | ||
21 | |||
22 | [libtap]: http://jc.ngo.org.uk/trac-bin/trac.cgi/wiki/LibTap "libtap" | ||
23 | [test-simple]: http://search.cpan.org/dist/Test-Simple/lib/Test/Simple.pm "Test::Simple Module" | ||
24 | [compilation]: doc/faq/compilation.html "Compilation" | ||
25 | |||
26 | <!--% # vim:set filetype=markdown textwidth=78 joinspaces: # %--> | ||
diff --git a/web/input/doc/faq/git.md b/web/input/doc/faq/git.md new file mode 100644 index 0000000..05fd533 --- /dev/null +++ b/web/input/doc/faq/git.md | |||
@@ -0,0 +1,197 @@ | |||
1 | title: Git | ||
2 | parent: FAQ | ||
3 | --- | ||
4 | |||
5 | # How do I use Git? | ||
6 | |||
7 | After the 1.4.13 release, the [Nagios Plugins Development Team][team] moved to | ||
8 | [Git][git] for its code repositories. This document is a quick introduction | ||
9 | to Git. | ||
10 | |||
11 | ## Differences Between Git and SVN | ||
12 | |||
13 | There is one huge difference between Git and SVN: Git is a distributed SCM | ||
14 | (Source Code Management system) while SVN is a centralized one. This doesn’t | ||
15 | mean we can’t have a central shared Git repository (and we indeed have one), | ||
16 | this means distributed development can occur around that central repository. | ||
17 | Another visible difference is that Git have more stages between the working | ||
18 | directory and the repository. When you want to add files or changes, you use | ||
19 | **git add**. This adds the changes to the repository index, which can be seen | ||
20 | as a staging area. When you commit with **git commit**, only the changes in | ||
21 | the index are considered. After committing, the changes are still local. To | ||
22 | share it with others, you have to push it to a remote repository, or gave | ||
23 | someone pull from your publicly accessible repository (in most case you will | ||
24 | still have to push changes there, unless if you were running a git daemon | ||
25 | straight off your working repository). Finally you can’t miss the fact that | ||
26 | there is no more revision numbers, and the distributed nature of Git is the | ||
27 | reason for that: there is absolutely no way a single number could be tracked | ||
28 | in a distributed way. Instead Git uses SHA1 hashes to identify commits (as | ||
29 | well as other objects in the repository). Each branch and tag refer to an | ||
30 | object name (SHA1 hash), and each commits have one or more parents (commit | ||
31 | objects). Although SHA1 hashes are 40 digits long, with Git you only have to | ||
32 | type a handful of digits to reference one. | ||
33 | |||
34 | ## Cloning a Project | ||
35 | |||
36 | To work on a project you first have to clone it. This creates your own local | ||
37 | repository and until you want to distribute your change or merge changes from | ||
38 | someone else everything that follows can happen offline. If you have push | ||
39 | access, run the command: | ||
40 | |||
41 | git clone git@github.com:nagios-plugins/nagios-plugins.git | ||
42 | |||
43 | If you just want a local copy or wish to clone it to your workstation, you can | ||
44 | run this command instead: | ||
45 | |||
46 | git clone git://github.com/nagios-plugins/nagios-plugins.git | ||
47 | |||
48 | This will create a directory called `nagios-plugins` in your current directory | ||
49 | with all the `master` code and history (this is roughly equivalent to CVS/SVN | ||
50 | `HEAD`). Change directory to `nagios-plugins`. | ||
51 | |||
52 | ## Editing Files | ||
53 | |||
54 | You can edit the files in the working area. To check the status, use: | ||
55 | |||
56 | git status | ||
57 | |||
58 | This will show a list of changes in the working directory. Newly made changes | ||
59 | appear in *red*, while changes added to the index are shown in green. You can | ||
60 | use **git diff** to see changes between the current working directory and the | ||
61 | index (untracked files will not be shown). | ||
62 | |||
63 | ## Committing Files | ||
64 | |||
65 | Use **git add** to specify which new files/changes you want to commit; this | ||
66 | will add the changes to the index. You can select only partial diffs with | ||
67 | **git add -p** too. If you want to commit everything you can use **git commit | ||
68 | -a** directly. You can see the changes you are about to commit (difference | ||
69 | between HEAD and the index) with **git diff --cached**, and then commit them | ||
70 | with: | ||
71 | |||
72 | git commit | ||
73 | |||
74 | Add a comment (you have read the [Development Guidelines][guidelines], right? | ||
75 | :-)). This commit will be local (affecting only your own repository) so you | ||
76 | will have to either push your changes, or have someone to pull them from you | ||
77 | (in the latter case you will most likely still push to a publicly accessible | ||
78 | clone of your local repository). If the change is from a contributor, set the | ||
79 | author at commit time: | ||
80 | |||
81 | git commit --author="Jane Doe <jane@example.com>" | ||
82 | |||
83 | If you realize that you forgot something in your commit and haven’t pushed it | ||
84 | yet to a remote repository, you can amend your last commit with **git commit | ||
85 | --amend**. You can also amend after a push and force the next update, however | ||
86 | this will cause non-linear updates and should be done only if the developers | ||
87 | using your repository are aware of it. | ||
88 | |||
89 | ## Reverting Local Modifications | ||
90 | |||
91 | You can revert local modifications with the following steps. First, if you | ||
92 | have already staged the changes you will have to unstage them. As indicated | ||
93 | in the **git status** message you can do so with the following command: | ||
94 | |||
95 | git reset HEAD <file> | ||
96 | |||
97 | Then you can revert unstaged changes with: | ||
98 | |||
99 | git checkout <file> | ||
100 | |||
101 | If you have already committed changes locally and need to undo your commit(s), | ||
102 | you can use **git reset**. First find the commit names with **git log** and | ||
103 | then do either one of these: To keep local modifications (you can commit them | ||
104 | again, stash them, etc.) | ||
105 | |||
106 | git reset --soft <commit> | ||
107 | |||
108 | Note that for the purpose of “re-doing” the last commit, **git commit | ||
109 | --amend** will be much easier than a reset/commit with the same end result. | ||
110 | To discard local modifications (if you lose important changes with this | ||
111 | command you may be able to recover them with **git reflog** and **git checkout | ||
112 | <commit\>**): | ||
113 | |||
114 | git reset --hard <file> | ||
115 | |||
116 | Do not reset changes that have already been pushed to remote repositories as | ||
117 | this will cause non-linear updates. If you do so, developers using those | ||
118 | repositories should be aware of it. | ||
119 | |||
120 | ## Merging Remote Changes | ||
121 | |||
122 | When you work on your local repository you’ll need to keep it up to date with | ||
123 | the development tree. This is very similar to **svn update** with the | ||
124 | difference that it can’t be done if the working tree has any unmerged changes. | ||
125 | If you do, either commit them or put them aside (Tip: **git stash**). If you | ||
126 | cloned from the main Git repository, this command will do a fetch then merge | ||
127 | any new changes: | ||
128 | |||
129 | git pull | ||
130 | |||
131 | You can also merge changes from any other fork of the repository. This | ||
132 | usually happens if someone ask you to pull from his own repo for some fix or | ||
133 | enhancements. Together with **--no-commit** you will have a chance to review | ||
134 | the changes and make any relevant correction before the merge. Example: | ||
135 | |||
136 | git pull --no-commit git://example.com/path/to/repo.git master | ||
137 | |||
138 | ## Merging Back to the Main Repository | ||
139 | |||
140 | Once you’re done with your commits and after pulling from the main repository, | ||
141 | you can push you change back to it. If you cloned using the *push* url this | ||
142 | command will push the master branch: | ||
143 | |||
144 | git push | ||
145 | |||
146 | It you’re trying to push something that would generate merge conflicts, the | ||
147 | push will be rejected. You will have yo do a pull first, fix the any | ||
148 | conflicts locally and then push again. If your commits are local (you haven’t | ||
149 | pulled them from someone else or published them somewhere) you can rebase to | ||
150 | avoid a merge: | ||
151 | |||
152 | git pull --rebase | ||
153 | |||
154 | Like a merge, this may generate conflicts and let you fix them, but instead of | ||
155 | creating a merge commit on top of the others, it will undo your commits, | ||
156 | fast-forward and apply your commits again. This is cleaner but doesn’t play | ||
157 | well when it rewrites already published history. | ||
158 | |||
159 | ## Going Further | ||
160 | |||
161 | This is a very quick introduction to Git. There are a lot more useful | ||
162 | commands for manipulating changes and working with others. They are all very | ||
163 | well documented (see **git help [-a]** for a list of commands, **git help | ||
164 | <cmd\>** or **git <cmd\> --help** shows the man page). You might also want to | ||
165 | look into some of the references listed below, or into a book such as [Scott | ||
166 | Chacon][scott]'s [Pro Git][book]. | ||
167 | |||
168 | ## References | ||
169 | |||
170 | - Intro to Distributed Version Control (Illustrated) | ||
171 | <http://betterexplained.com/articles/intro-to-distributed-version-control-illustrated/> | ||
172 | - A tutorial introduction to Git | ||
173 | <https://www.kernel.org/pub/software/scm/git/docs/gittutorial.html> | ||
174 | - Everyday Git With 20 Commands Or So | ||
175 | <http://www.kernel.org/pub/software/scm/git/docs/everyday.html> | ||
176 | - Git User’s Manual | ||
177 | <http://www.kernel.org/pub/software/scm/git/docs/user-manual.html> | ||
178 | - Git - SVN Crash Course | ||
179 | <http://git.or.cz/course/svn.html> | ||
180 | - Git QuickStart | ||
181 | <http://git.or.cz/gitwiki/QuickStart> | ||
182 | - Git CheatSheet | ||
183 | <http://git.or.cz/gitwiki/GitCheatSheet> | ||
184 | - Understanding Git Conceptually | ||
185 | <http://www.eecs.harvard.edu/~cduan/technical/git/> | ||
186 | - The Git Parable | ||
187 | <http://tom.preston-werner.com/2009/05/19/the-git-parable.html> | ||
188 | - Git for Computer Scientists | ||
189 | <http://eagain.net/articles/git-for-computer-scientists/> | ||
190 | |||
191 | [team]: team.html "Nagios Plugins Development Team" | ||
192 | [guidelines]: doc/guidelines.html "Nagios Plugin Development Guidelines" | ||
193 | [git]: http://git-scm.com/ "Git" | ||
194 | [scott]: http://scottchacon.com/ "Scott Chacon" | ||
195 | [book]: http://git-scm.com/book "Pro Git" | ||
196 | |||
197 | <!--% # vim:set filetype=markdown textwidth=78 joinspaces: # %--> | ||
diff --git a/web/input/doc/faq/gnulib.md b/web/input/doc/faq/gnulib.md new file mode 100644 index 0000000..328dfeb --- /dev/null +++ b/web/input/doc/faq/gnulib.md | |||
@@ -0,0 +1,36 @@ | |||
1 | title: Gnulib | ||
2 | parent: FAQ | ||
3 | --- | ||
4 | |||
5 | # How do I use and update Gnulib? | ||
6 | |||
7 | [Gnulib][gnulib] provides replacement implementations of functions that are | ||
8 | not available on all (Unix-like) operating systems. In order to sync with the | ||
9 | latest Gnulib code, do something like: | ||
10 | |||
11 | git clone git://git.savannah.gnu.org/gnulib.git | ||
12 | cd gnulib | ||
13 | GNULIB_HEAD=$(git rev-parse --short HEAD) | ||
14 | cd .. | ||
15 | git clone git@github.com:nagios-plugins/nagios-plugins.git | ||
16 | cd nagios-plugins | ||
17 | ../gnulib/gnulib-tool --update | ||
18 | find gl -name '*~' -o -name '.gitignore' | xargs rm | ||
19 | git status | ||
20 | git add gl | ||
21 | git commit -m "Sync with latest Gnulib code ($GNULIB_HEAD)" | ||
22 | |||
23 | In order to make a given function available via Gnulib (on systems which don't | ||
24 | provide that function), the [corresponding module][modules] must be imported | ||
25 | using `gnulib-tool`, e.g. (in order to add the `strcase` module): | ||
26 | |||
27 | ../gnulib/gnulib-tool --no-vc-files --import strcase | ||
28 | find gl -name '*~' | xargs rm | ||
29 | git status | ||
30 | git add gl | ||
31 | git commit -m 'Add Gnulib module "strcase"' | ||
32 | |||
33 | [gnulib]: http://www.gnu.org/software/gnulib/ "Gnulib" | ||
34 | [modules]: http://www.gnu.org/software/gnulib/MODULES.html "Gnulib Modules" | ||
35 | |||
36 | <!--% # vim:set filetype=markdown textwidth=78 joinspaces: # %--> | ||
diff --git a/web/input/doc/faq/guidelines.md b/web/input/doc/faq/guidelines.md new file mode 100644 index 0000000..acc73f7 --- /dev/null +++ b/web/input/doc/faq/guidelines.md | |||
@@ -0,0 +1,12 @@ | |||
1 | title: Guidelines | ||
2 | parent: FAQ | ||
3 | --- | ||
4 | |||
5 | # How should a plugin be written? | ||
6 | |||
7 | The [Nagios Plugin Development Guidelines][guidelines] provide the | ||
8 | specifications for writing a plugin. | ||
9 | |||
10 | [guidelines]: doc/guidelines.html "Nagios Plugin Development Guidelines" | ||
11 | |||
12 | <!--% # vim:set filetype=markdown textwidth=78 joinspaces: # %--> | ||
diff --git a/web/input/doc/faq/index.md b/web/input/doc/faq/index.md index 18584f2..35f6e75 100644 --- a/web/input/doc/faq/index.md +++ b/web/input/doc/faq/index.md | |||
@@ -4,6 +4,66 @@ parent: Documentation | |||
4 | 4 | ||
5 | # FAQ | 5 | # FAQ |
6 | 6 | ||
7 | The list of Frequently Asked Questions (FAQ) will come back soon. | 7 | This is a list of Frequently Asked Questions (FAQ) regarding the Nagios |
8 | Plugins. | ||
9 | |||
10 | ## General | ||
11 | |||
12 | * [Who controls the Nagios Plugins project?][control] | ||
13 | * [What license is the code distributed under?][license] | ||
14 | * [Can I submit a patch?][contribute] | ||
15 | * [Do you accept donations?][donations] | ||
16 | |||
17 | ## Compiling | ||
18 | |||
19 | * [How do I compile the plugins?][compilation] | ||
20 | * [The configure script appears to hang][configure-hangs] | ||
21 | * [Why doesn't the --ssl option work?][ssl] | ||
22 | * [How do I build the Nagios::Plugin module?][build-perl-module] | ||
23 | * [Building check\_mysql fails on Solaris][mixing-compilers] | ||
24 | * [Why use pst3 for check\_procs on Solaris?][ps-on-solaris] | ||
25 | |||
26 | ## Installing | ||
27 | |||
28 | * [How do I install the plugins?][installation] | ||
29 | * [Why aren't the root plugins installed?][root-plugins] | ||
30 | * [Which user owns the installed plugins?][ownership] | ||
31 | |||
32 | ## Development | ||
33 | |||
34 | * [How do I use Git?][git] | ||
35 | * [How should a plugin be written?][guidelines] | ||
36 | * [Private C APIs][c-apis] | ||
37 | * [How do I prove the C routines work?][libtap] | ||
38 | * [Can I add extra tests to the C routines?][extra-tests] | ||
39 | * [How do the NPTest parameters work?][nptest] | ||
40 | * [How do I use and update Gnulib?][gnulib] | ||
41 | * [How do I use the Nagios::Plugin module?][use-perl-module] | ||
42 | * [How do I modify NagiosMIB?][nagiosmib] | ||
43 | * [Can I use Nagios Plugins in my project?][reuse] | ||
44 | |||
45 | [control]: doc/faq/control.html | ||
46 | [license]: doc/faq/license.html | ||
47 | [contribute]: doc/faq/contribute.html | ||
48 | [donations]: doc/faq/donations.html | ||
49 | [compilation]: doc/faq/compilation.html | ||
50 | [configure-hangs]: doc/faq/configure-hangs.html | ||
51 | [ssl]: doc/faq/ssl.html | ||
52 | [build-perl-module]: doc/faq/build-perl-module.html | ||
53 | [mixing-compilers]: doc/faq/mixing-compilers.html | ||
54 | [ps-on-solaris]: doc/faq/ps-on-solaris.html | ||
55 | [installation]: doc/faq/installation.html | ||
56 | [root-plugins]: doc/faq/root-plugins.html | ||
57 | [ownership]: doc/faq/ownership.html | ||
58 | [git]: doc/faq/git.html | ||
59 | [guidelines]: doc/faq/guidelines.html | ||
60 | [c-apis]: doc/faq/private-c-api.html | ||
61 | [libtap]: doc/faq/libtap.html | ||
62 | [extra-tests]: doc/faq/extra-tests.html | ||
63 | [nptest]: doc/faq/nptest.html | ||
64 | [gnulib]: doc/faq/gnulib.html | ||
65 | [use-perl-module]: doc/faq/use-perl-module.html | ||
66 | [nagiosmib]: doc/faq/nagiosmib.html | ||
67 | [reuse]: doc/faq/reuse.html | ||
8 | 68 | ||
9 | <!--% # vim:set filetype=markdown textwidth=78 joinspaces: # %--> | 69 | <!--% # vim:set filetype=markdown textwidth=78 joinspaces: # %--> |
diff --git a/web/input/doc/faq/installation.md b/web/input/doc/faq/installation.md new file mode 100644 index 0000000..f426f35 --- /dev/null +++ b/web/input/doc/faq/installation.md | |||
@@ -0,0 +1,14 @@ | |||
1 | title: Installing Nagios Plugins | ||
2 | parent: FAQ | ||
3 | --- | ||
4 | |||
5 | # How do I install the plugins? | ||
6 | |||
7 | After [compiling][compilation] the plugins, you can run the following command | ||
8 | to install them: | ||
9 | |||
10 | make install | ||
11 | |||
12 | [compilation]: doc/faq/compilation.html "Compilation" | ||
13 | |||
14 | <!--% # vim:set filetype=markdown textwidth=78 joinspaces: # %--> | ||
diff --git a/web/input/doc/faq/libtap.md b/web/input/doc/faq/libtap.md new file mode 100644 index 0000000..29cd357 --- /dev/null +++ b/web/input/doc/faq/libtap.md | |||
@@ -0,0 +1,26 @@ | |||
1 | title: libtap | ||
2 | parent: FAQ | ||
3 | --- | ||
4 | |||
5 | # How do I prove the C routines work? | ||
6 | |||
7 | We use [libtap][libtap] to test C routines that are in `lib/utils_*.c`. The | ||
8 | tests are in `lib/tests/test_*.c`. | ||
9 | |||
10 | The latest libtap version is currently 1.01. However, there is a bug with the | ||
11 | thread implementation. To workaround, run: | ||
12 | |||
13 | CPPFLAGS="-UHAVE_LIBPTHREAD" ./configure | ||
14 | make | ||
15 | make check | ||
16 | make install | ||
17 | |||
18 | Now when you run the Nagios Plugins `./configure` script, it should find the | ||
19 | libtap library and compile the tests and run them when you run `make` `test`. | ||
20 | |||
21 | *Update:* These days, the Nagios Plugins tarball includes a copy of libtap | ||
22 | which is used if you run `./configure` `--enable-libtap`. | ||
23 | |||
24 | [libtap]: http://jc.ngo.org.uk/trac-bin/trac.cgi/wiki/LibTap "libtap" | ||
25 | |||
26 | <!--% # vim:set filetype=markdown textwidth=78 joinspaces: # %--> | ||
diff --git a/web/input/doc/faq/license.md b/web/input/doc/faq/license.md new file mode 100644 index 0000000..d4a369c --- /dev/null +++ b/web/input/doc/faq/license.md | |||
@@ -0,0 +1,19 @@ | |||
1 | title: What license is used? | ||
2 | parent: FAQ | ||
3 | --- | ||
4 | |||
5 | # What license is the code distributed under? | ||
6 | |||
7 | The Nagios Plugins code is currently distributed using the [GNU General Public | ||
8 | License, Version 3][gpl] (GPLv3). | ||
9 | |||
10 | This is because some C code that we depend upon, from the [Gnulib][gnulib] | ||
11 | project, is distributed under the GPLv3; and therefore, some of our plugins | ||
12 | also need to be GPLv3 licensed. The team has decided, rather than having a | ||
13 | mixed license, we'll distribute all of the core Nagios Plugins code under the | ||
14 | GPLv3. | ||
15 | |||
16 | [gpl]: http://www.gnu.org/licenses/gpl.html "GPLv3" | ||
17 | [gnulib]: http://www.gnu.org/software/gnulib/ "Gnulib" | ||
18 | |||
19 | <!--% # vim:set filetype=markdown textwidth=78 joinspaces: # %--> | ||
diff --git a/web/input/doc/faq/mixing-compilers.md b/web/input/doc/faq/mixing-compilers.md new file mode 100644 index 0000000..8c7bad6 --- /dev/null +++ b/web/input/doc/faq/mixing-compilers.md | |||
@@ -0,0 +1,20 @@ | |||
1 | title: Mixing compilers | ||
2 | parent: FAQ | ||
3 | --- | ||
4 | |||
5 | # Building check\_mysql fails on Solaris | ||
6 | |||
7 | If you are using GCC and your MySQL version was compiled using Sun's C | ||
8 | compiler (or the other way round), then it is likely that the configure | ||
9 | options will fail, as the configure script will run `mysql_config` to get the | ||
10 | appropriate `CFLAGS`. | ||
11 | |||
12 | There are various options: | ||
13 | |||
14 | * Disable `check_mysql` by running `./configure` `--without-mysql`. | ||
15 | * Allow `./configure` to finish, but manually amend `plugins/Makefile` and | ||
16 | remove any non-GCC flags in `MYSQLCFLAGS`. | ||
17 | * Use Sun's C compiler to compile the plugins. | ||
18 | * Use a GCC-compiled version of MySQL. | ||
19 | |||
20 | <!--% # vim:set filetype=markdown textwidth=78 joinspaces: # %--> | ||
diff --git a/web/input/doc/faq/nagiosmib.md b/web/input/doc/faq/nagiosmib.md new file mode 100644 index 0000000..b2f34ae --- /dev/null +++ b/web/input/doc/faq/nagiosmib.md | |||
@@ -0,0 +1,45 @@ | |||
1 | title: Modifying NagiosMIB | ||
2 | parent: FAQ | ||
3 | --- | ||
4 | |||
5 | # How do I modify NagiosMIB? | ||
6 | |||
7 | Nagiosmib is a set of MIBs for Nagios to allow traps sent from Nagios to be | ||
8 | recognized by other NMSes. | ||
9 | |||
10 | To develop, the requirements are: | ||
11 | |||
12 | * make | ||
13 | * smistrip and smilint, part of the [libsmi project][libsmi] | ||
14 | |||
15 | On Debian, you'd run: | ||
16 | |||
17 | apt-get install smistrip smitools | ||
18 | |||
19 | If you get errors like: | ||
20 | |||
21 | ./MIB/NAGIOS-ROOT-MIB:4: failed to locate MIB module `SNMPv2-SMI' | ||
22 | ./MIB/NAGIOS-ROOT-MIB:6: failed to locate MIB module `SNMPv2-TC' | ||
23 | |||
24 | then you are missing some prerequisite MIBs. These need to be installed from | ||
25 | the libsmi project. | ||
26 | |||
27 | Currently there are some warnings such as: | ||
28 | |||
29 | ./MIB/NAGIOS-ROOT-MIB:35: warning: current type `NotifyType' is not referenced in this module | ||
30 | ./MIB/NAGIOS-NOTIFY-MIB:153: warning: use Integer32 instead of INTEGER in SMIv2 | ||
31 | |||
32 | These are probably okay. | ||
33 | |||
34 | To change the MIB information, update the `src-mib` directory and run `make` | ||
35 | to generate the MIBs. Run `make` `test` to check. | ||
36 | |||
37 | Update the `CHANGES` file and commit. | ||
38 | |||
39 | To release, change the version number in the `Makefile` and run `make` | ||
40 | `tarball`. Publish the tarball and md5sum. Create a news story on this site. | ||
41 | Link back to here from the tarball release. | ||
42 | |||
43 | [libsmi]: http://www.ibr.cs.tu-bs.de/projects/libsmi/ "libsmi" | ||
44 | |||
45 | <!--% # vim:set filetype=markdown textwidth=78 joinspaces: # %--> | ||
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: # %--> | ||
diff --git a/web/input/doc/faq/ownership.md b/web/input/doc/faq/ownership.md new file mode 100644 index 0000000..58bc311 --- /dev/null +++ b/web/input/doc/faq/ownership.md | |||
@@ -0,0 +1,25 @@ | |||
1 | title: Ownership | ||
2 | parent: FAQ | ||
3 | --- | ||
4 | |||
5 | # Which user owns the installed plugins? | ||
6 | |||
7 | If you run `./configure` `--with-user=nagios`, then at `make` `install` time, | ||
8 | the installation will set the ownership of the plugins to the nagios user | ||
9 | (similarly for `--with-group`). If these options are not set, the plugins | ||
10 | will be installed with the install user's owner and group permissions - it is | ||
11 | your responsibility to set other permissions, if required. | ||
12 | |||
13 | The only exception are root plugins. These are under `plugins-root/` and are | ||
14 | also installed with the install user's owner and group permissions. | ||
15 | |||
16 | If you run: | ||
17 | |||
18 | make install-root | ||
19 | |||
20 | This will set permissions to root, assuming you are either root or using | ||
21 | fakeroot. If not, the setuid bit is still set, but the plugin may not work | ||
22 | correctly. This is the behaviour used by coreutils for the `su` binary and is | ||
23 | duplicated in this project. | ||
24 | |||
25 | <!--% # vim:set filetype=markdown textwidth=78 joinspaces: # %--> | ||
diff --git a/web/input/doc/faq/private-c-api.md b/web/input/doc/faq/private-c-api.md new file mode 100644 index 0000000..585ca42 --- /dev/null +++ b/web/input/doc/faq/private-c-api.md | |||
@@ -0,0 +1,116 @@ | |||
1 | title: Private C APIs | ||
2 | parent: FAQ | ||
3 | --- | ||
4 | |||
5 | # Private C APIs | ||
6 | |||
7 | This page describes the Nagios Plugins routines that can be accessed from the | ||
8 | internal library. | ||
9 | |||
10 | This page is in development, so these are not guaranteed to be available. As | ||
11 | the API matures and is available in libraries, this information will be | ||
12 | migrated to the [Development Guidelines][guidelines]. | ||
13 | |||
14 | ## Basic Functions | ||
15 | |||
16 | ### np\_init(char \*plugin\_name, int argc, char \*\*argv) | ||
17 | |||
18 | Initialize the Nagios Plugins routines. Pass the plugin name and `argc` and | ||
19 | `argv` from `main()`. | ||
20 | |||
21 | A variable `nagios_plugin` will be created for internal use. | ||
22 | |||
23 | ### np\_set\_args(int argc, char \*\*argv) | ||
24 | |||
25 | Sets the internally held `argc` and `argv` values. | ||
26 | |||
27 | Shouldn't really need this, but due to `np_extra_opts()`, this is set after | ||
28 | that call. | ||
29 | |||
30 | ### np\_cleanup(void) | ||
31 | |||
32 | Used to clean up allocated memory by the `nagios_plugin` variable. This is | ||
33 | called by the `die()` routine before exiting. | ||
34 | |||
35 | ## State Information | ||
36 | |||
37 | Saving and restoring state allows a plugin to know the last results and thus | ||
38 | work out differences. This is especially useful when a plugin is capturing | ||
39 | counter information, which increases with every request. | ||
40 | |||
41 | This currently works by saving state information to a file, though the API | ||
42 | doesn't care what the backend implementation is. | ||
43 | |||
44 | *Note:* Binary data is not currently supported. | ||
45 | |||
46 | Some things to be aware of, if you use state information: | ||
47 | |||
48 | * There will be problems if a remote host is checked from two different Nagios | ||
49 | instances, as the state file on the remote host will be updated twice as | ||
50 | often. | ||
51 | * Binary data may not restore on a program compiled with different options | ||
52 | from the program that saved it (e.g., 32 or 64 bit). | ||
53 | * Binary data may include a structure containing a pointer. Pointer values | ||
54 | may not be used in the reading program - i.e., you need to overwrite the | ||
55 | value with something `malloc(3)`ed in the current run of the program. | ||
56 | * State files could be left lying around. We recommend you run a regular job | ||
57 | to remove unmodified state files older than 1 week. | ||
58 | |||
59 | ### np\_enable\_state(char \*keyname, int data\_version) | ||
60 | |||
61 | Enables the plugin state retention routines. Will set the filename for the | ||
62 | state file to be `.../{keyname}`. | ||
63 | |||
64 | The `keyname` will have any non alphanumerics replaced with "`_`". | ||
65 | |||
66 | If `keyname` is `NULL`, will generate an SHA1 `keyname` based on the `argv` of | ||
67 | the plugin (using the [extra-opts][extra-opts] parsed version, if applicable). | ||
68 | |||
69 | *Note:* The `keyname` should be uniquely defined for a particular service, to | ||
70 | avoid a second invocation of the plugin to use the state information from a | ||
71 | different invocation. If in doubt, set `keyname=NULL` and allow the routine | ||
72 | to calculate the `keyname`. | ||
73 | |||
74 | ### np\_state\_read(void) | ||
75 | |||
76 | Reads the state file and returns a `state_data` variable. | ||
77 | |||
78 | This routine will call `die()` with `UNKNOWN` if: | ||
79 | |||
80 | * There was a problem reading the state file. | ||
81 | |||
82 | Returns `NULL` if: | ||
83 | |||
84 | * No state file exists - this is possible on the first run. | ||
85 | * The state file format (internally held by the plugin) does not match. | ||
86 | * The state data format (passed in `np_enable_state()`) does not match. | ||
87 | |||
88 | Your plugin should always check for `NULL`. It is recommended that your | ||
89 | plugin returns `OK` on `NULL` as this is similar to a "first run". | ||
90 | |||
91 | If valid data was read, a pointer will be returned which points to a struct | ||
92 | of: | ||
93 | |||
94 | typedef struct state_data_struct { | ||
95 | time_t time; | ||
96 | void *data; | ||
97 | int length; /* Of binary data. */ | ||
98 | } state_data; | ||
99 | |||
100 | ### np\_state\_write\_string(time\_t data\_time, char \*string) | ||
101 | |||
102 | If `data_time==0`, use current time. Creates state file, with state format | ||
103 | version. Writes data version, time, and data. Creates a temporary file and | ||
104 | then renames into place. There is a possible loss of data if two things | ||
105 | writing to same key at same time, but there will not be a corrupted state | ||
106 | file. | ||
107 | |||
108 | ### np\_state\_write\_binary(time\_t data\_time, char \*start, int length) | ||
109 | |||
110 | Same as `np_state_write_string()`, but writes binary data. *Currently | ||
111 | unimplemented.* | ||
112 | |||
113 | [guidelines]: doc/guidelines.html "Nagios Plugin Development Guidelines" | ||
114 | [extra-opts]: doc/extra-opts.html "Extra-Opts" | ||
115 | |||
116 | <!--% # vim:set filetype=markdown textwidth=78 joinspaces: # %--> | ||
diff --git a/web/input/doc/faq/ps-on-solaris.md b/web/input/doc/faq/ps-on-solaris.md new file mode 100644 index 0000000..801c695 --- /dev/null +++ b/web/input/doc/faq/ps-on-solaris.md | |||
@@ -0,0 +1,38 @@ | |||
1 | title: Process listings on Solaris | ||
2 | parent: FAQ | ||
3 | --- | ||
4 | |||
5 | # Why use pst3 for check\_procs on Solaris? | ||
6 | |||
7 | Solaris systems restrict the information that is available when you run `ps`. | ||
8 | On other Unix systems, running `ps` will list you the entire arguments, but | ||
9 | Solaris restricts the arguments to the first 64 characters at the kernel. | ||
10 | |||
11 | This is a problem if you need to access the arguments to find out a specific | ||
12 | process (common for listing Java programs). | ||
13 | |||
14 | `/usr/ucb/ps` does list the full arguments, but only for your own processes. | ||
15 | If you are root, then running `/usr/ucb/ps` can get the full arguments for all | ||
16 | processes. However, the columns for `RSS` and `VSZ` merge together when the | ||
17 | values are too large and check\_procs cannot pull the value out correctly. | ||
18 | |||
19 | The chosen approach is to create our own `ps`-like command, `pst3`. This | ||
20 | outputs the required information in a known format for `check_procs` to parse. | ||
21 | This is the default if you run `./configure` on a Solaris system. | ||
22 | |||
23 | Because `pst3` needs access to some kernel structures, it needs to be compiled | ||
24 | in 32 and 64 bit modes. | ||
25 | |||
26 | If you are comfortable with the limitations, it is possible to use a Solaris | ||
27 | `ps` command by specifying these options to `./configure`: | ||
28 | |||
29 | --with-ps-command="/usr/bin/ps -eo 's uid pid ppid vsz rss pcpu etime comm args'" \ | ||
30 | --with-ps-format="%s %d %d %d %d %d %f %s %s %n" \ | ||
31 | --with-ps-cols=10 \ | ||
32 | --with-ps-varlist="procstat,&procuid,&procpid,&procppid,\ | ||
33 | &procvsz,&procrss,&procpcpu,procetime,procprog,&pos" | ||
34 | |||
35 | The `--with-ps-varlist` should be on one line - separated here for | ||
36 | readability. | ||
37 | |||
38 | <!--% # vim:set filetype=markdown textwidth=78 joinspaces: # %--> | ||
diff --git a/web/input/doc/faq/reuse.md b/web/input/doc/faq/reuse.md new file mode 100644 index 0000000..6c8e7b0 --- /dev/null +++ b/web/input/doc/faq/reuse.md | |||
@@ -0,0 +1,44 @@ | |||
1 | title: Code reuse | ||
2 | parent: FAQ | ||
3 | --- | ||
4 | |||
5 | # Can I use Nagios Plugins in my project? | ||
6 | |||
7 | Firstly, there is a distinction between a Nagios plugin and plugins from the | ||
8 | Nagios Plugins project. | ||
9 | |||
10 | Although Nagios (the system) is licensed under the GPL, plugins are executed | ||
11 | in their own environment, so they [do not fall][aggregation] under the "viral" | ||
12 | aspect of the GPL. Therefore, any plugin written for use by Nagios can be | ||
13 | under any license the copyright holder selects. | ||
14 | |||
15 | However, the plugins contained within the Nagios Plugins project are | ||
16 | distributed under the [GPL][gpl]. If you distribute an application that | ||
17 | includes the Nagios Plugins (modified or not), you are required to distribute | ||
18 | a copy of the source code for the plugins under the terms of the GPL, | ||
19 | regardless of the licensing for the rest of the application. | ||
20 | |||
21 | If you write a plugin which is a derivative work from code of the Nagios | ||
22 | Plugins project, then your plugin must also be licensed under the GPL, | ||
23 | although you own the copyright for your modified portions. | ||
24 | |||
25 | *Derivative work* usually includes: | ||
26 | |||
27 | * modified versions of the plugins | ||
28 | * other software that contains code (modified or not) copied from the plugins | ||
29 | * other software that `#include`s header files from the plugins | ||
30 | * other software that has linked against library files from the plugins | ||
31 | |||
32 | and does not usually include: | ||
33 | |||
34 | * other software that parses the output of a plugin run from the command line, | ||
35 | exit status, etc. | ||
36 | * software that provides a "wrapper" for command line execution of the plugin | ||
37 | * software that uses status codes and other values which are in the header | ||
38 | files, but also described in the documentation (though not including or | ||
39 | linking to the source) | ||
40 | |||
41 | [aggregation]: http://www.gnu.org/licenses/gpl-faq.html#MereAggregation "GPL FAQ: Mere Aggregation" | ||
42 | [gpl]: http://www.gnu.org/licenses/gpl.html "GPLv3" | ||
43 | |||
44 | <!--% # vim:set filetype=markdown textwidth=78 joinspaces: # %--> | ||
diff --git a/web/input/doc/faq/root-plugins.md b/web/input/doc/faq/root-plugins.md new file mode 100644 index 0000000..b5db74d --- /dev/null +++ b/web/input/doc/faq/root-plugins.md | |||
@@ -0,0 +1,27 @@ | |||
1 | title: Root plugins | ||
2 | parent: FAQ | ||
3 | --- | ||
4 | |||
5 | # Why aren't the root plugins installed? | ||
6 | |||
7 | There are a few plugins which require root access, namely check\_dhcp and | ||
8 | check\_icmp. These are compiled under the `plugins-root` subdirectory. A | ||
9 | `make` `install` will install them with the install user's owner and group | ||
10 | permissions. However, if you run `make` `install` without being root, this | ||
11 | message will appear: | ||
12 | |||
13 | WARNING: insufficient access; not installing setuid plugins | ||
14 | NOTE: to install setuid plugins, run 'make install-root' as root | ||
15 | |||
16 | To install, run as root: | ||
17 | |||
18 | make install-root | ||
19 | |||
20 | Even if you are not root, the plugins will still be installed. This is for | ||
21 | packagers which can then alter the permissions of the plugins before | ||
22 | packaging. | ||
23 | |||
24 | This behaviour is used by coreutils for the `su` binary and is duplicated for | ||
25 | this project. | ||
26 | |||
27 | <!--% # vim:set filetype=markdown textwidth=78 joinspaces: # %--> | ||
diff --git a/web/input/doc/faq/ssl.md b/web/input/doc/faq/ssl.md new file mode 100644 index 0000000..4f8b2cc --- /dev/null +++ b/web/input/doc/faq/ssl.md | |||
@@ -0,0 +1,15 @@ | |||
1 | title: SSL libraries | ||
2 | parent: FAQ | ||
3 | --- | ||
4 | |||
5 | # Why doesn't the --ssl option work? | ||
6 | |||
7 | To get the SSL features, you need to have the SSL libraries available. Either | ||
8 | [OpenSSL][openssl] or [GntTLS][gnutls] is suitable. | ||
9 | |||
10 | Check the `./configure` output to see if the SSL libraries have been detected. | ||
11 | |||
12 | [openssl]: http://www.openssl.org/ "OpenSSL" | ||
13 | [gnutls]: http://www.gnutls.org/ "GnuTLS" | ||
14 | |||
15 | <!--% # vim:set filetype=markdown textwidth=78 joinspaces: # %--> | ||
diff --git a/web/input/doc/faq/use-perl-module.md b/web/input/doc/faq/use-perl-module.md new file mode 100644 index 0000000..64ba18a --- /dev/null +++ b/web/input/doc/faq/use-perl-module.md | |||
@@ -0,0 +1,37 @@ | |||
1 | title: Using Nagios::Plugin | ||
2 | parent: FAQ | ||
3 | --- | ||
4 | |||
5 | # How do I use the Nagios::Plugin module? | ||
6 | |||
7 | The Nagios::Plugin Perl module can be obtained from two main locations: | ||
8 | |||
9 | * from the Nagios Plugins tarball with an | ||
10 | [extra configure option][configure-module] | ||
11 | * from [CPAN][cpan-module] | ||
12 | |||
13 | If you install from the Nagios Plugins tarball, the Perl module will be | ||
14 | installed in `$prefix/perl`. | ||
15 | |||
16 | If you install from CPAN, the Perl module will be installed into your Perl's | ||
17 | system directories by default. | ||
18 | |||
19 | To write your plugin, you should start it with: | ||
20 | |||
21 | use FindBin; | ||
22 | use lib "$FindBin::Bin/../perl/lib"; | ||
23 | use Nagios::Plugin; | ||
24 | |||
25 | This bit of code tells Perl to look for the Nagios::Plugin module in a | ||
26 | directory relative to where the plugin is executed - this is a hard | ||
27 | dependency. If Nagios::Plugin is not found there, Perl's system directories | ||
28 | will be searched. | ||
29 | |||
30 | This approach allows a system administrator to decide whether they want | ||
31 | Nagios::Plugin installed via system directories or within the `$prefix` area | ||
32 | of the plugins. | ||
33 | |||
34 | [configure-module]: doc/faq/build-perl-module.html "configure with Nagios::Plugin" | ||
35 | [cpan-module]: http://search.cpan.org/dist/Nagios-Plugin/ "Nagios::Plugin on CPAN" | ||
36 | |||
37 | <!--% # vim:set filetype=markdown textwidth=78 joinspaces: # %--> | ||