6d5c813c166d5a15ac1a31e23ee8629c36ea6e0c
1 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V4.1//EN" >
2 <book>
3 <title>Nagios Plug-in Developer Guidelines</title>
5 <bookinfo>
6 <authorgroup>
7 <author>
8 <affiliation>
9 <orgname>Nagios Plugins Development Team</orgname>
10 </affiliation>
11 </author>
12 </authorgroup>
14 <pubdate>2006</pubdate>
15 <title>Nagios plug-in development guidelines</title>
17 <revhistory>
18 <revision>
19 <revnumber>$Revision$</revnumber>
20 <date>$Date$</date>
21 </revision>
22 </revhistory>
24 <copyright>
25 <year>2000 - 2006</year>
26 <holder>Nagios Plugins Development Team</holder>
27 </copyright>
29 </bookinfo>
32 <preface id="preface"><title>Preface</title>
33 <para>The purpose of this guidelines is to provide a reference for
34 the plug-in developers and encourage the standarization of the
35 different kind of plug-ins: C, shell, perl, python, etc.</para>
37 <para>Nagios Plug-in Development Guidelines Copyright (C) 2000-2006
38 (Nagios Plugins Team)</para>
40 <para>Permission is granted to make and distribute verbatim
41 copies of this manual provided the copyright notice and this
42 permission notice are preserved on all copies.</para>
44 <para>The plugins themselves are copyrighted by their respective
45 authors.</para>
46 </preface>
48 <article>
49 <section id="DevRequirements"><title>Development platform requirements</title>
50 <para>
51 Nagios plugins are developed to the GNU standard, so any OS which is supported by GNU
52 should run the plugins. While the requirements for compiling the Nagios plugins release
53 is very small, to develop from CVS needs additional software to be installed. These are the
54 minimum levels of software required:
56 <literallayout>
57 gnu make 3.79
58 automake 1.8.3
59 autoconf 2.58
60 gnu libtool 1.5.6
61 </literallayout>
63 To compile from CVS, after you have checked out the code, run:
64 <literallayout>
65 tools/setup
66 ./configure
67 make
68 make install
69 </literallayout>
70 </para>
72 <para>Note: gettext is no longer a developer platform requirement. A lot of the files in lib/ and m4/
73 are synced with the coreutils project and we use the same levels of gettext that they
74 distribute.
75 </para>
76 </section>
78 <section id="PlugOutput"><title>Plugin Output for Nagios</title>
80 <para>You should always print something to STDOUT that tells if the
81 service is working or why it is failing. Try to keep the output short -
82 probably less that 80 characters. Remember that you ideally would like
83 the entire output to appear in a pager message, which will get chopped
84 off after a certain length.</para>
86 <section><title>Print only one line of text</title>
87 <para>Nagios will only grab the first line of text from STDOUT
88 when it notifies contacts about potential problems. If you print
89 multiple lines, you're out of luck. Remember, keep it short and
90 to the point.</para>
92 <para>Output should be in the format:</para>
93 <literallayout>
94 SERVICE STATUS: Information text
95 </literallayout>
96 <para>However, note that this is not a requirement of the API, so you cannot depend on this
97 being an accurate reflection of the status of the service - the status should always
98 be determined by the return code.</para>
99 </section>
101 <section><title>Verbose output</title>
102 <para>Use the -v flag for verbose output. You should allow multiple
103 -v options for additional verbosity, up to a maximum of 3. The standard
104 type of output should be:</para>
106 <table id="verboselevels"><title>Verbose output levels</title>
107 <tgroup cols="2">
108 <thead>
109 <row>
110 <entry><para>Verbosity level</para></entry>
111 <entry><para>Type of output</para></entry>
112 </row>
113 </thead>
114 <tbody>
115 <row>
116 <entry align="center"><para>0</para></entry>
117 <entry><para>Single line, minimal output. Summary</para></entry>
118 </row>
119 <row>
120 <entry align="center"><para>1</para></entry>
121 <entry><para>Single line, additional information (eg list processes that fail)</para></entry>
122 </row>
123 <row>
124 <entry align="center"><para>2</para></entry>
125 <entry><para>Multi line, configuration debug output (eg ps command used)</para></entry>
126 </row>
127 <row>
128 <entry align="center"><para>3</para></entry>
129 <entry><para>Lots of detail for plugin problem diagnosis</para></entry>
130 </row>
131 </tbody>
132 </tgroup>
133 </table>
134 </section>
136 <section><title>Screen Output</title>
137 <para>The plug-in should print the diagnostic and just the
138 synopsis part of the help message. A well written plugin would
139 then have --help as a way to get the verbose help.</para>
140 <para>Code and output should try to respect the 80x25 size of a
141 crt (remember when fixing stuff in the server room!)</para>
142 </section>
144 <section><title>Plugin Return Codes</title>
145 <para>The return codes below are based on the POSIX spec of returning
146 a positive value. Netsaint prior to v0.0.7 supported non-POSIX
147 compliant return code of "-1" for unknown. Nagios supports POSIX return
148 codes by default.</para>
150 <para>Note: Some plugins will on occasion print on STDOUT that an error
151 occurred and error code is 138 or 255 or some such number. These
152 are usually caused by plugins using system commands and having not
153 enough checks to catch unexpected output. Developers should include a
154 default catch-all for system command output that returns an UNKNOWN
155 return code.</para>
157 <table id="ReturnCodes"><title>Plugin Return Codes</title>
158 <tgroup cols="3">
159 <thead>
160 <row>
161 <entry><para>Numeric Value</para></entry>
162 <entry><para>Service Status</para></entry>
163 <entry><para>Status Description</para></entry>
164 </row>
165 </thead>
166 <tbody>
167 <row>
168 <entry align="center"><para>0</para></entry>
169 <entry valign="middle"><para>OK</para></entry>
170 <entry><para>The plugin was able to check the service and it
171 appeared to be functioning properly</para></entry>
172 </row>
173 <row>
174 <entry align="center"><para>1</para></entry>
175 <entry valign="middle"><para>Warning</para></entry>
176 <entry><para>The plugin was able to check the service, but it
177 appeared to be above some "warning" threshold or did not appear
178 to be working properly</para></entry>
179 </row>
180 <row>
181 <entry align="center"><para>2</para></entry>
182 <entry valign="middle"><para>Critical</para></entry>
183 <entry><para>The plugin detected that either the service was not
184 running or it was above some "critical" threshold</para></entry>
185 </row>
186 <row>
187 <entry align="center"><para>3</para></entry>
188 <entry valign="middle"><para>Unknown</para></entry>
189 <entry><para>Invalid command line arguments were supplied to the
190 plugin or low-level failures internal to the plugin (such as unable to fork,
191 or open a tcp socket) that prevent it from performing the specified
192 operation. Higher-level errors (such as name resolution errors,
193 socket timeouts, etc) are outside of the control of plugins and should
194 generally NOT be reported as UNKNOWN states.
195 </para></entry>
196 </row>
197 </tbody>
198 </tgroup>
199 </table>
202 </section>
204 <section id="thresholdformat"><title>Threshold and ranges</title>
205 <para>A range is defined as a start and end point (inclusive) on a numeric scale (possibly
206 negative or positive infinity).
207 </para>
208 <para>A threshold is a range with an alert level (either warning or critical). Use the
209 set_thresholds(thresholds *, char *, char *) function to set the thresholds.
210 </para>
211 <para>The theory is that the plugin will do some sort of check which returns
212 back a numerical value, or metric, which is then compared to the warning and
213 critical thresholds. Use the get_status(double, thresholds *) function to
214 compare the value against the thresholds.</para>
215 <para>This is the generalised format for ranges:</para>
217 <literallayout>
218 [@]start:end
219 </literallayout>
221 <para>Notes:</para>
222 <orderedlist>
223 <listitem><para>start ≤ end</para>
224 </listitem>
225 <listitem><para>start and ":" is not required if start=0</para>
226 </listitem>
227 <listitem><para>if range is of format "start:" and end is not specified,
228 assume end is infinity</para>
229 </listitem>
230 <listitem><para>to specify negative infinity, use "~"</para>
231 </listitem>
232 <listitem><para>alert is raised if metric is outside start and end range
233 (inclusive of endpoints)</para>
234 </listitem>
235 <listitem><para>if range starts with "@", then alert if inside this range
236 (inclusive of endpoints)</para>
237 </listitem>
238 </orderedlist>
240 <para>Note: Not all plugins are coded to expect ranges in this format yet.
241 There will be some work in providing multiple metrics.</para>
242 </section>
244 <section><title>Performance data</title>
245 <para>Performance data is defined by Nagios as "everything after the | of the plugin output" -
246 please refer to Nagios documentation for information on capturing this data to logfiles.
247 However, it is the responsibility of the plugin writer to ensure the
248 performance data is in a "Nagios plugins" format.
249 This is the expected format:</para>
251 <literallayout>
252 'label'=value[UOM];[warn];[crit];[min];[max]
253 </literallayout>
255 <para>Notes:</para>
256 <orderedlist>
257 <listitem><para>space separated list of label/value pairs</para>
258 </listitem>
259 <listitem><para>label can contain any characters</para>
260 </listitem>
261 <listitem><para>the single quotes for the label are optional. Required if
262 spaces, = or ' are in the label</para>
263 </listitem>
264 <listitem><para>label length is arbitrary, but ideally the first 19 characters
265 are unique (due to a limitation in RRD). Be aware of a limitation in the
266 amount of data that NRPE returns to Nagios</para>
267 </listitem>
268 <listitem><para>to specify a quote character, use two single quotes</para>
269 </listitem>
270 <listitem><para>warn, crit, min or max may be null (for example, if the threshold is
271 not defined or min and max do not apply). Trailing unfilled semicolons can be
272 dropped</para>
273 </listitem>
274 <listitem><para>min and max are not required if UOM=%</para>
275 </listitem>
276 <listitem><para>value, min and max in class [-0-9.]. Must all be the
277 same UOM</para>
278 </listitem>
279 <listitem><para>warn and crit are in the range format (see
280 <xref linkend="thresholdformat">). Must be the same UOM</para>
281 </listitem>
282 <listitem><para>UOM (unit of measurement) is one of:</para>
283 <orderedlist>
284 <listitem><para>no unit specified - assume a number (int or float)
285 of things (eg, users, processes, load averages)</para>
286 </listitem>
287 <listitem><para>s - seconds (also us, ms)</para></listitem>
288 <listitem><para>% - percentage</para></listitem>
289 <listitem><para>B - bytes (also KB, MB, TB)</para></listitem>
290 <listitem><para>c - a continous counter (such as bytes
291 transmitted on an interface)</para></listitem>
292 </orderedlist>
293 </listitem>
294 </orderedlist>
296 <para>It is up to third party programs to convert the Nagios plugins
297 performance data into graphs.</para>
298 </section>
300 <section><title>Translations</title>
301 <para>If possible, use translation tools for all output to respect the user's language
302 settings. See <xref linkend="translationsdevelopers"> for guidelines
303 for the core plugins.
304 </para>
305 </section>
306 </section>
308 <section id="SysCmdAuxFiles"><title>System Commands and Auxiliary Files</title>
310 <section><title>Don't execute system commands without specifying their
311 full path</title>
312 <para>Don't use exec(), popen(), etc. to execute external
313 commands without explicity using the full path of the external
314 program.</para>
316 <para>Doing otherwise makes the plugin vulnerable to hijacking
317 by a trojan horse earlier in the search path. See the main
318 plugin distribution for examples on how this is done.</para>
319 </section>
321 <section><title>Use spopen() if external commands must be executed</title>
323 <para>If you have to execute external commands from within your
324 plugin and you're writing it in C, use the spopen() function
325 that Karl DeBisschop has written.</para>
327 <para>The code for spopen() and spclose() is included with the
328 core plugin distribution.</para>
329 </section>
331 <section><title>Don't make temp files unless absolutely required</title>
333 <para>If temp files are needed, make sure that the plugin will
334 fail cleanly if the file can't be written (e.g., too few file
335 handles, out of disk space, incorrect permissions, etc.) and
336 delete the temp file when processing is complete.</para>
337 </section>
339 <section><title>Don't be tricked into following symlinks</title>
341 <para>If your plugin opens any files, take steps to ensure that
342 you are not following a symlink to another location on the
343 system.</para>
344 </section>
346 <section><title>Validate all input</title>
348 <para>use routines in utils.c or utils.pm and write more as needed</para>
349 </section>
351 </section>
356 <section id="PerlPlugin"><title>Perl Plugins</title>
358 <para>Perl plugins are coded a little more defensively than other
359 plugins because of embedded Perl. When configured as such, embedded
360 Perl Nagios (ePN) requires stricter use of the some of Perl's features.
361 This section outlines some of the steps needed to use ePN
362 effectively.</para>
364 <orderedlist>
366 <listitem><para> Do not use BEGIN and END blocks since they will be called
367 only once (when Nagios starts and shuts down) with Embedded Perl (ePN). In
368 particular, do not use BEGIN blocks to initialize variables.</para>
369 </listitem>
371 <listitem><para>To use utils.pm, you need to provide a full path to the
372 module in order for it to work.</para>
374 <literallayout>
375 e.g.
376 use lib "/usr/local/nagios/libexec";
377 use utils qw(...);
378 </literallayout>
379 </listitem>
381 <listitem><para>Perl scripts should be called with "-w"</para>
382 </listitem>
384 <listitem><para>All Perl plugins must compile cleanly under "use strict" - i.e. at
385 least explicitly package names as in "$main::x" or predeclare every
386 variable. </para>
389 <para>Explicitly initialize each variable in use. Otherwise with
390 caching enabled, the plugin will not be recompiled each time, and
391 therefore Perl will not reinitialize all the variables. All old
392 variable values will still be in effect.</para>
393 </listitem>
395 <listitem><para>Do not use >DATA< handles (these simply do not compile under ePN).</para>
396 </listitem>
398 <listitem><para>Do not use global variables in named subroutines. This is bad practise anyway, but with ePN the
399 compiler will report an error "<global_var> will not stay shared ..". Values used by
400 subroutines should be passed in the argument list.</para>
401 </listitem>
403 <listitem><para>If writing to a file (perhaps recording
404 performance data) explicitly close close it. The plugin never
405 calls <emphasis role="strong">exit</emphasis>; that is caught by
406 p1.pl, so output streams are never closed.</para>
407 </listitem>
409 <listitem><para>As in <xref linkend="runtime"> all plugins need
410 to monitor their runtime, specially if they are using network
411 resources. Use of the <emphasis>alarm</emphasis> is recommended
412 noting that some Perl modules (eg LWP) manage timers, so that an alarm
413 set by a plugin using such a module is overwritten by the module.
414 (workarounds are cunning (TM) or using the module timer)
415 Plugins may import a default time out ($TIMEOUT) from utils.pm.
416 </para>
417 </listitem>
419 <listitem><para>Perl plugins should import %ERRORS from utils.pm
420 and then "exit $ERRORS{'OK'}" rather than "exit 0"
421 </para>
422 </listitem>
424 </orderedlist>
426 </section>
428 <section id="runtime"><title>Runtime Timeouts</title>
430 <para>Plugins have a very limited runtime - typically 10 sec.
431 As a result, it is very important for plugins to maintain internal
432 code to exit if runtime exceeds a threshold. </para>
434 <para>All plugins should timeout gracefully, not just networking
435 plugins. For instance, df may lock if you have automounted
436 drives and your network fails - but on first glance, who'd think
437 df could lock up like that. Plus, it should just be more error
438 resistant to be able to time out rather than consume
439 resources.</para>
441 <section><title>Use DEFAULT_SOCKET_TIMEOUT</title>
443 <para>All network plugins should use DEFAULT_SOCKET_TIMEOUT to timeout</para>
445 </section>
448 <section><title>Add alarms to network plugins</title>
450 <para>If you write a plugin which communicates with another
451 networked host, you should make sure to set an alarm() in your
452 code that prevents the plugin from hanging due to abnormal
453 socket closures, etc. Nagios takes steps to protect itself
454 against unruly plugins that timeout, but any plugins you create
455 should be well behaved on their own.</para>
457 </section>
461 </section>
463 <section id="PlugOptions"><title>Plugin Options</title>
465 <para>A well written plugin should have --help as a way to get
466 verbose help. Code and output should try to respect the 80x25 size of a
467 crt (remember when fixing stuff in the server room!)</para>
469 <section><title>Option Processing</title>
471 <para>For plugins written in C, we recommend the C standard
472 getopt library for short options. Getopt_long is always available.
473 </para>
475 <para>For plugins written in Perl, we recommend Getopt::Long module.</para>
477 <para>Positional arguments are strongly discouraged.</para>
479 <para>There are a few reserved options that should not be used
480 for other purposes:</para>
482 <literallayout>
483 -V version (--version)
484 -h help (--help)
485 -t timeout (--timeout)
486 -w warning threshold (--warning)
487 -c critical threshold (--critical)
488 -H hostname (--hostname)
489 -v verbose (--verbose)
490 </literallayout>
492 <para>In addition to the reserved options above, some other standard options are:</para>
494 <literallayout>
495 -C SNMP community (--community)
496 -a authentication password (--authentication)
497 -l login name (--logname)
498 -p port or password (--port or --passwd/--password)monitors operational
499 -u url or username (--url or --username)
500 </literallayout>
502 <para>Look at check_pgsql and check_procs to see how I currently
503 think this can work. Standard options are:</para>
506 <para>The option -V or --version should be present in all
507 plugins. For C plugins it should result in a call to print_revision, a
508 function in utils.c which takes two character arguments, the
509 command name and the plugin revision.</para>
511 <para>The -? option, or any other unparsable set of options,
512 should print out a short usage statement. Character width should
513 be 80 and less and no more that 23 lines should be printed (it
514 should display cleanly on a dumb terminal in a server
515 room).</para>
517 <para>The option -h or --help should be present in all plugins.
518 In C plugins, it should result in a call to print_help (or
519 equivalent). The function print_help should call print_revision,
520 then print_usage, then should provide detailed
521 help. Help text should fit on an 80-character width display, but
522 may run as many lines as needed.</para>
524 <para>The option -v or --verbose should be present in all plugins.
525 The user should be allowed to specify -v multiple times to increase
526 the verbosity level, as described in <xref linkend="verboselevels">.</para>
527 </section>
529 <section>
530 <title>Plugins with more than one type of threshold, or with
531 threshold ranges</title>
533 <para>Old style was to do things like -ct for critical time and
534 -cv for critical value. That goes out the window with POSIX
535 getopt. The allowable alternatives are:</para>
537 <orderedlist>
538 <listitem>
539 <para>long options like -critical-time (or -ct and -cv, I
540 suppose).</para>
541 </listitem>
543 <listitem>
544 <para>repeated options like `check_load -w 10 -w 6 -w 4 -c
545 16 -c 10 -c 10`</para>
546 </listitem>
548 <listitem>
549 <para>for brevity, the above can be expressed as `check_load
550 -w 10,6,4 -c 16,10,10`</para>
551 </listitem>
553 <listitem>
554 <para>ranges are expressed with colons as in `check_procs -C
555 httpd -w 1:20 -c 1:30` which will warn above 20 instances,
556 and critical at 0 and above 30</para>
557 </listitem>
559 <listitem>
560 <para>lists are expressed with commas, so Jacob's check_nmap
561 uses constructs like '-p 1000,1010,1050:1060,2000'</para>
562 </listitem>
564 <listitem>
565 <para>If possible when writing lists, use tokens to make the
566 list easy to remember and non-order dependent - so
567 check_disk uses '-c 10000,10%' so that it is clear which is
568 the precentage and which is the KB values (note that due to
569 my own lack of foresight, that used to be '-c 10000:10%' but
570 such constructs should all be changed for consistency,
571 though providing reverse compatibility is fairly
572 easy).</para>
573 </listitem>
575 </orderedlist>
577 <para>As always, comments are welcome - making this consistent
578 without a host of long options was quite a hassle, and I would
579 suspect that there are flaws in this strategy.
580 </para>
581 </section>
582 </section>
584 <section id="Testcases"><title>Test cases</title>
585 <para>
586 Tests are the best way of knowing if the plugins work as expected. Please
587 create and update test cases where possible.
588 </para>
590 <para>
591 To run a test, from the top level directory, run "make test". This will run
592 all the current tests and report an overall success rate.
593 </para>
595 <para>
596 See the <ulink url="http://tinderbox.altinity.org">Nagios Plugins Tinderbox server</ulink>
597 for the daily test results.
598 </para>
600 <section><title>Test cases for plugins</title>
601 <para>These use perl's Test::More. To do a one time test, run "cd plugins && perl t/check_disk.t".
602 </para>
604 <para>There will somtimes be failures seen in this output which are known failures that
605 need to be fixed. As long as the return code is 0, it will be reported as "test pass".
606 (If you have a fix so that the specific test passes, that will be gratefully received!)
607 </para>
609 <para>
610 If you want a summary test, run: "cd plugins && prove t/check_disk.t".
611 This runs the test in a summary format.
612 </para>
614 <para>
615 For a good and amusing tutorial on using Test::More, see this
616 <ulink url="http://search.cpan.org/~mschwern/Test-Simple-0.62/lib/Test/Tutorial.pod">
617 link</ulink>
618 </para>
620 </section>
622 <section><title>Testing the C library functions</title>
623 <para>
624 We use <ulink url="http://jc.ngo.org.uk/trac-bin/trac.cgi/wiki/LibTap">the libtap library</ulink>, which gives
625 perl's TAP
626 (Test Anything Protocol) output. This is used by the FreeBSD team for their regression testing.
627 </para>
629 <para>
630 To run tests using the libtap library, download the latest tar ball and extract.
631 There is a problem with tap-1.01 where
632 <ulink url="http://jc.ngo.org.uk/trac-bin/trac.cgi/ticket/25">pthread support doesn't appear to work</ulink>
633 properly on non-FreeBSD systems. Install with 'CPPFLAGS="-UHAVE_LIBPTHREAD" ./configure && make && make check && make install'.
634 </para>
636 <para>
637 When you run Nagios Plugins' configure, it will look for the tap library and will automatically
638 setup the tests. Run "make test" to run all the tests.
639 </para>
640 </section>
642 </section>
643 <section id="CodingGuidelines"><title>Coding guidelines</title>
644 <para>See <ulink url="http://www.gnu.org/prep/standards_toc.html">GNU
645 Coding standards</ulink> for general guidelines.</para>
646 <section><title>C coding</title>
648 <para>Variables should be declared at the beginning of code blocks and
649 not inline because of portability with older compilers.</para>
651 <para>You should use /* */ for comments and not // as some compilers
652 do not handle the latter form.</para>
653 </section>
655 <section><title>Crediting sources</title>
656 <para>If you have copied a routine from another source, make sure the licence
657 from your source allows this. Add a comment referencing the ACKNOWLEDGEMENTS
658 file, where you can put more detail about the source.</para>
659 <para>For contributed code, do not add any named credits in the source code
660 - contributors should be added into the THANKS.in file instead.
661 </para>
662 </section>
664 <section><title>CVS comments</title>
665 <para>When adding CVS comments at commit time, you can use the following prefixes:
666 <variablelist>
667 <varlistentry><term>- comment</term>
668 <listitem>
669 <para>for a comment that can be removed from the Changelog</para>
670 </listitem>
671 </varlistentry>
672 <varlistentry><term>* comment</term>
673 <listitem>
674 <para>for an important amendment to be included into a features list</para>
675 </listitem>
676 </varlistentry>
677 </variablelist>
678 </para>
679 <para>If the change is due to a contribution, please quote the contributor's name
680 and, if applicable, add the SourceForge Tracker number. Don't forget to
681 update the THANKS.in file.</para>
682 </section>
684 <section id="translationsdevelopers"><title>Translations for developers</title>
685 <para>To make the job easier for translators, please follow these guidelines:</para>
686 <orderedlist>
687 <listitem><para>
688 Before creating new strings, check the po/nagios-plugins.pot file to
689 see if a similar string
690 already exists
691 </para></listitem>
692 <listitem><para>
693 For help texts, break into individual options so that these can be reused
694 between plugins
695 </para></listitem>
696 <listitem><para>Try to avoid linefeeds unless you are working on a block of text</para></listitem>
697 <listitem><para>Short help is not translated</para></listitem>
698 <listitem><para>Long help has options in English language, but text translated</para></listitem>
699 <listitem><para>"Copyright" kept in English</para></listitem>
700 <listitem><para>Copyright holder names kept in original text</para></listitem>
701 <listitem><para>Debugging output does not need to be translated</para></listitem>
702 </orderedlist>
703 </section>
705 <section><title>Translations for translators</title>
706 <para>To create an up to date list of translatable strings, run: tools/gen_locale.sh</para>
707 </section>
709 </section>
711 <section id="SubmittingChanges"><title>Submission of new plugins and patches</title>
713 <section id="Patches"><title>Patches</title>
714 <para>If you have a bug patch, please supply a unified or context diff against the
715 version you are using. For new features, please supply a diff against
716 the CVS HEAD version.</para>
718 <para>Patches should be submitted via
719 <ulink url="http://sourceforge.net/tracker/?group_id=29880&atid=397599">SourceForge's
720 tracker system for Nagiosplug patches</ulink>
721 and be announced to the nagiosplug-devel mailing list.</para>
723 <para>Submission of a patch implies that the submmitter acknowledges that they
724 are the author of the code (or have permission from the author to release the code)
725 and agree that the code can be released under the GPL. The copyright for the changes will
726 then revert to the Nagios Plugin Development Team - this is required so that any copyright
727 infringements can be investigated quickly without contacting a huge list of copyright holders.
728 Credit will always be given for any patches through a THANKS file in the distribution.</para>
729 </section>
731 <section id="Newplugins"><title>New plugins</title>
733 <para>If you would like others to use your plugins, please add it to
734 the official 3rd party plugin repository,
735 <ulink url="http://www.nagiosexchange.org">NagiosExchange</ulink>.
736 </para>
738 <para>We are not accepting requests for inclusion of plugins into
739 our distribution at the moment, but when we do, these are the minimum
740 requirements:
741 </para>
743 <orderedlist>
744 <listitem>
745 <para>Include copyright and license information in all files</para>
746 </listitem>
747 <listitem>
748 <para>The standard command options are supported (--help, --version,
749 --timeout, --warning, --critical)</para>
750 </listitem>
751 <listitem>
752 <para>It is determined to be not redundant (for instance, we would not
753 add a new version of check_disk just because someone had provide
754 a plugin that had perf checking - we would incorporate the features
755 into an exisiting plugin)</para>
756 </listitem>
757 <listitem>
758 <para>One of the developers has had the time to audit the code and declare
759 it ready for core</para>
760 </listitem>
761 <listitem>
762 <para>It should also follow code format guidelines, and use functions from
763 utils (perl or c or sh) rather than using its own</para>
764 </listitem>
765 <listitem>
766 <para>Includes patches to configure.in if required (via the EXTRAS list if
767 it will only work on some platforms)</para>
768 </listitem>
769 <listitem>
770 <para>If possible, please submit a test harness. Documentation on sample
771 tests coming soon</para>
772 </listitem>
773 </orderedlist>
775 </section>
777 </section>
778 </article>
780 </book>