Code

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