Code

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