developer-guidelines.sgml 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685
  1. <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V4.1//EN" >
  2. <book>
  3. <title>Nagios Plug-in Developer Guidelines</title>
  4. <bookinfo>
  5. <authorgroup>
  6. <author>
  7. <affiliation>
  8. <orgname>Nagios Plugins Development Team</orgname>
  9. </affiliation>
  10. </author>
  11. </authorgroup>
  12. <pubdate>2005</pubdate>
  13. <title>Nagios plug-in development guidelines</title>
  14. <revhistory>
  15. <revision>
  16. <revnumber>$Revision$</revnumber>
  17. <date>$Date$</date>
  18. </revision>
  19. </revhistory>
  20. <copyright>
  21. <year>2000 - 2005</year>
  22. <holder>Nagios Plugins Development Team</holder>
  23. </copyright>
  24. </bookinfo>
  25. <preface id="preface"><title>Preface</title>
  26. <para>The purpose of this guidelines is to provide a reference for
  27. the plug-in developers and encourage the standarization of the
  28. different kind of plug-ins: C, shell, perl, python, etc.</para>
  29. <para>Nagios Plug-in Development Guidelines Copyright (C) 2000-2005
  30. (Nagios Plugins Team)</para>
  31. <para>Permission is granted to make and distribute verbatim
  32. copies of this manual provided the copyright notice and this
  33. permission notice are preserved on all copies.</para>
  34. <para>The plugins themselves are copyrighted by their respective
  35. authors.</para>
  36. </preface>
  37. <article>
  38. <section id="DevRequirements"><title>Development platform requirements</title>
  39. <para>
  40. Nagios plugins are developed to the GNU standard, so any OS which is supported by GNU
  41. should run the plugins. While the requirements for compiling the Nagios plugins release
  42. is very small, to develop from CVS needs additional software to be installed. These are the
  43. minimum levels of software required:
  44. <literallayout>
  45. gnu make 3.79
  46. automake 1.8
  47. autoconf 2.58
  48. gettext 0.11.5
  49. </literallayout>
  50. To compile from CVS, after you have checked out the code, run:
  51. <literallayout>
  52. tools/setup
  53. ./configure
  54. make
  55. make install
  56. </literallayout>
  57. </para>
  58. </section>
  59. <section id="PlugOutput"><title>Plugin Output for Nagios</title>
  60. <para>You should always print something to STDOUT that tells if the
  61. service is working or why it is failing. Try to keep the output short -
  62. probably less that 80 characters. Remember that you ideally would like
  63. the entire output to appear in a pager message, which will get chopped
  64. off after a certain length.</para>
  65. <section><title>Print only one line of text</title>
  66. <para>Nagios will only grab the first line of text from STDOUT
  67. when it notifies contacts about potential problems. If you print
  68. multiple lines, you're out of luck. Remember, keep it short and
  69. to the point.</para>
  70. <para>Output should be in the format:</para>
  71. <literallayout>
  72. METRIC STATUS: Information text
  73. </literallayout>
  74. <para>However, note that this is not a requirement of the API, so you cannot depend on this
  75. being an accurate reflection of the status of the service - the status should always
  76. be determined by the return code.</para>
  77. </section>
  78. <section><title>Verbose output</title>
  79. <para>Use the -v flag for verbose output. You should allow multiple
  80. -v options for additional verbosity, up to a maximum of 3. The standard
  81. type of output should be:</para>
  82. <table id="verboselevels"><title>Verbose output levels</title>
  83. <tgroup cols="2">
  84. <thead>
  85. <row>
  86. <entry><para>Verbosity level</para></entry>
  87. <entry><para>Type of output</para></entry>
  88. </row>
  89. </thead>
  90. <tbody>
  91. <row>
  92. <entry align="center"><para>0</para></entry>
  93. <entry><para>Single line, minimal output. Summary</para></entry>
  94. </row>
  95. <row>
  96. <entry align="center"><para>1</para></entry>
  97. <entry><para>Single line, additional information (eg list processes that fail)</para></entry>
  98. </row>
  99. <row>
  100. <entry align="center"><para>2</para></entry>
  101. <entry><para>Multi line, configuration debug output (eg ps command used)</para></entry>
  102. </row>
  103. <row>
  104. <entry align="center"><para>3</para></entry>
  105. <entry><para>Lots of detail for plugin problem diagnosis</para></entry>
  106. </row>
  107. </tbody>
  108. </tgroup>
  109. </table>
  110. </section>
  111. <section><title>Screen Output</title>
  112. <para>The plug-in should print the diagnostic and just the
  113. synopsis part of the help message. A well written plugin would
  114. then have --help as a way to get the verbose help.</para>
  115. <para>Code and output should try to respect the 80x25 size of a
  116. crt (remember when fixing stuff in the server room!)</para>
  117. </section>
  118. <section><title>Return the proper status code</title>
  119. <para>See <xref linkend="ReturnCodes"> below
  120. for the numeric values of status codes and their
  121. description. Remember to return an UNKNOWN state if bogus or
  122. invalid command line arguments are supplied or it you are unable
  123. to check the service.</para>
  124. </section>
  125. <section><title>Plugin Return Codes</title>
  126. <para>The return codes below are based on the POSIX spec of returning
  127. a positive value. Netsaint prior to v0.0.7 supported non-POSIX
  128. compliant return code of "-1" for unknown. Nagios supports POSIX return
  129. codes by default.</para>
  130. <para>Note: Some plugins will on occasion print on STDOUT that an error
  131. occurred and error code is 138 or 255 or some such number. These
  132. are usually caused by plugins using system commands and having not
  133. enough checks to catch unexpected output. Developers should include a
  134. default catch-all for system command output that returns an UNKNOWN
  135. return code.</para>
  136. <table id="ReturnCodes"><title>Plugin Return Codes</title>
  137. <tgroup cols="3">
  138. <thead>
  139. <row>
  140. <entry><para>Numeric Value</para></entry>
  141. <entry><para>Service Status</para></entry>
  142. <entry><para>Status Description</para></entry>
  143. </row>
  144. </thead>
  145. <tbody>
  146. <row>
  147. <entry align="center"><para>0</para></entry>
  148. <entry valign="middle"><para>OK</para></entry>
  149. <entry><para>The plugin was able to check the service and it
  150. appeared to be functioning properly</para></entry>
  151. </row>
  152. <row>
  153. <entry align="center"><para>1</para></entry>
  154. <entry valign="middle"><para>Warning</para></entry>
  155. <entry><para>The plugin was able to check the service, but it
  156. appeared to be above some "warning" threshold or did not appear
  157. to be working properly</para></entry>
  158. </row>
  159. <row>
  160. <entry align="center"><para>2</para></entry>
  161. <entry valign="middle"><para>Critical</para></entry>
  162. <entry><para>The plugin detected that either the service was not
  163. running or it was above some "critical" threshold</para></entry>
  164. </row>
  165. <row>
  166. <entry align="center"><para>3</para></entry>
  167. <entry valign="middle"><para>Unknown</para></entry>
  168. <entry><para>Invalid command line arguments were supplied to the
  169. plugin or the plugin was unable to check the status of the given
  170. hosts/service</para></entry>
  171. </row>
  172. </tbody>
  173. </tgroup>
  174. </table>
  175. </section>
  176. <section id="thresholdformat"><title>Threshold range format</title>
  177. <para>Thresholds ranges define the warning and critical levels for plugins to
  178. alert on. The theory is that the plugin will do some sort of check which returns
  179. back a numerical value, or metric, which is then compared to the warning and
  180. critical thresholds.
  181. This is the generalised format for threshold ranges:</para>
  182. <literallayout>
  183. [@]start:end
  184. </literallayout>
  185. <para>Notes:</para>
  186. <orderedlist>
  187. <listitem><para>start &gt; end</para>
  188. </listitem>
  189. <listitem><para>start and ":" is not required if start=0</para>
  190. </listitem>
  191. <listitem><para>if range is of format "start:" and end is not specified,
  192. assume end is infinity</para>
  193. </listitem>
  194. <listitem><para>to specify negative infinity, use "~"</para>
  195. </listitem>
  196. <listitem><para>alert is raised if metric is outside start and end range
  197. (inclusive of endpoints)</para>
  198. </listitem>
  199. <listitem><para>if range starts with "@", then alert if inside this range
  200. (inclusive of endpoints)</para>
  201. </listitem>
  202. </orderedlist>
  203. <para>Note: Not all plugins are coded to expect ranges in this format. It is
  204. planned for a future release to
  205. provide standard libraries to parse and compare metrics against ranges. There
  206. will also be some work in providing multiple metrics.</para>
  207. </section>
  208. <section><title>Performance data</title>
  209. <para>Performance data is defined by Nagios as "everything after the | of the plugin output" -
  210. please refer to Nagios documentation for information on capturing this data to logfiles.
  211. However, it is the responsibility of the plugin writer to ensure the
  212. performance data is in a "Nagios plugins" format.
  213. This is the expected format:</para>
  214. <literallayout>
  215. 'label'=value[UOM];[warn];[crit];[min];[max]
  216. </literallayout>
  217. <para>Notes:</para>
  218. <orderedlist>
  219. <listitem><para>space separated list of label/value pairs</para>
  220. </listitem>
  221. <listitem><para>label can contain any characters</para>
  222. </listitem>
  223. <listitem><para>the single quotes for the label are optional. Required if
  224. spaces, = or ' are in the label</para>
  225. </listitem>
  226. <listitem><para>label length is arbitrary, but ideally the first 19 characters
  227. are unique (due to a limitation in RRD). Be aware of a limitation in the
  228. amount of data that NRPE returns to Nagios</para>
  229. </listitem>
  230. <listitem><para>to specify a quote character, use two single quotes</para>
  231. </listitem>
  232. <listitem><para>warn, crit, min or max may be null (for example, if the threshold is
  233. not defined or min and max do not apply). Trailing unfilled semicolons can be
  234. dropped</para>
  235. </listitem>
  236. <listitem><para>min and max are not required if UOM=%</para>
  237. </listitem>
  238. <listitem><para>value, min and max in class [-0-9.]. Must all be the
  239. same UOM</para>
  240. </listitem>
  241. <listitem><para>warn and crit are in the range format (see
  242. <xref linkend="thresholdformat">). Must be the same UOM</para>
  243. </listitem>
  244. <listitem><para>UOM (unit of measurement) is one of:</para>
  245. <orderedlist>
  246. <listitem><para>no unit specified - assume a number (int or float)
  247. of things (eg, users, processes, load averages)</para>
  248. </listitem>
  249. <listitem><para>s - seconds (also us, ms)</para></listitem>
  250. <listitem><para>% - percentage</para></listitem>
  251. <listitem><para>B - bytes (also KB, MB, TB)</para></listitem>
  252. <listitem><para>c - a continous counter (such as bytes
  253. transmitted on an interface)</para></listitem>
  254. </orderedlist>
  255. </listitem>
  256. </orderedlist>
  257. <para>It is up to third party programs to convert the Nagios plugins
  258. performance data into graphs.</para>
  259. </section>
  260. <section><title>Translations</title>
  261. <para>If possible, use translation tools for all output. Currently, most of the core C plugins
  262. use gettext for translation. General guidelines are:</para>
  263. <orderedlist>
  264. <listitem><para>short help is not translated</para></listitem>
  265. <listitem><para>long help has options in English language, but text translated</para></listitem>
  266. <listitem><para>"Copyright" kept in English</para></listitem>
  267. <listitem><para>copyright holder names kept in original text</para></listitem>
  268. </orderedlist>
  269. </section>
  270. </section>
  271. <section id="SysCmdAuxFiles"><title>System Commands and Auxiliary Files</title>
  272. <section><title>Don't execute system commands without specifying their
  273. full path</title>
  274. <para>Don't use exec(), popen(), etc. to execute external
  275. commands without explicity using the full path of the external
  276. program.</para>
  277. <para>Doing otherwise makes the plugin vulnerable to hijacking
  278. by a trojan horse earlier in the search path. See the main
  279. plugin distribution for examples on how this is done.</para>
  280. </section>
  281. <section><title>Use spopen() if external commands must be executed</title>
  282. <para>If you have to execute external commands from within your
  283. plugin and you're writing it in C, use the spopen() function
  284. that Karl DeBisschop has written.</para>
  285. <para>The code for spopen() and spclose() is included with the
  286. core plugin distribution.</para>
  287. </section>
  288. <section><title>Don't make temp files unless absolutely required</title>
  289. <para>If temp files are needed, make sure that the plugin will
  290. fail cleanly if the file can't be written (e.g., too few file
  291. handles, out of disk space, incorrect permissions, etc.) and
  292. delete the temp file when processing is complete.</para>
  293. </section>
  294. <section><title>Don't be tricked into following symlinks</title>
  295. <para>If your plugin opens any files, take steps to ensure that
  296. you are not following a symlink to another location on the
  297. system.</para>
  298. </section>
  299. <section><title>Validate all input</title>
  300. <para>use routines in utils.c or utils.pm and write more as needed</para>
  301. </section>
  302. </section>
  303. <section id="PerlPlugin"><title>Perl Plugins</title>
  304. <para>Perl plugins are coded a little more defensively than other
  305. plugins because of embedded Perl. When configured as such, embedded
  306. Perl Nagios (ePN) requires stricter use of the some of Perl's features.
  307. This section outlines some of the steps needed to use ePN
  308. effectively.</para>
  309. <orderedlist>
  310. <listitem><para> Do not use BEGIN and END blocks since they will be called
  311. only once (when Nagios starts and shuts down) with Embedded Perl (ePN). In
  312. particular, do not use BEGIN blocks to initialize variables.</para>
  313. </listitem>
  314. <listitem><para>To use utils.pm, you need to provide a full path to the
  315. module in order for it to work.</para>
  316. <literallayout>
  317. e.g.
  318. use lib "/usr/local/nagios/libexec";
  319. use utils qw(...);
  320. </literallayout>
  321. </listitem>
  322. <listitem><para>Perl scripts should be called with "-w"</para>
  323. </listitem>
  324. <listitem><para>All Perl plugins must compile cleanly under "use strict" - i.e. at
  325. least explicitly package names as in "$main::x" or predeclare every
  326. variable. </para>
  327. <para>Explicitly initialize each variable in use. Otherwise with
  328. caching enabled, the plugin will not be recompiled each time, and
  329. therefore Perl will not reinitialize all the variables. All old
  330. variable values will still be in effect.</para>
  331. </listitem>
  332. <listitem><para>Do not use &gt;DATA&lt; handles (these simply do not compile under ePN).</para>
  333. </listitem>
  334. <listitem><para>Do not use global variables in named subroutines. This is bad practise anyway, but with ePN the
  335. compiler will report an error "&lt;global_var&gt; will not stay shared ..". Values used by
  336. subroutines should be passed in the argument list.</para>
  337. </listitem>
  338. <listitem><para>If writing to a file (perhaps recording
  339. performance data) explicitly close close it. The plugin never
  340. calls <emphasis role="strong">exit</emphasis>; that is caught by
  341. p1.pl, so output streams are never closed.</para>
  342. </listitem>
  343. <listitem><para>As in <xref linkend="runtime"> all plugins need
  344. to monitor their runtime, specially if they are using network
  345. resources. Use of the <emphasis>alarm</emphasis> is recommended
  346. noting that some Perl modules (eg LWP) manage timers, so that an alarm
  347. set by a plugin using such a module is overwritten by the module.
  348. (workarounds are cunning (TM) or using the module timer)
  349. Plugins may import a default time out ($TIMEOUT) from utils.pm.
  350. </para>
  351. </listitem>
  352. <listitem><para>Perl plugins should import %ERRORS from utils.pm
  353. and then "exit $ERRORS{'OK'}" rather than "exit 0"
  354. </para>
  355. </listitem>
  356. </orderedlist>
  357. </section>
  358. <section id="runtime"><title>Runtime Timeouts</title>
  359. <para>Plugins have a very limited runtime - typically 10 sec.
  360. As a result, it is very important for plugins to maintain internal
  361. code to exit if runtime exceeds a threshold. </para>
  362. <para>All plugins should timeout gracefully, not just networking
  363. plugins. For instance, df may lock if you have automounted
  364. drives and your network fails - but on first glance, who'd think
  365. df could lock up like that. Plus, it should just be more error
  366. resistant to be able to time out rather than consume
  367. resources.</para>
  368. <section><title>Use DEFAULT_SOCKET_TIMEOUT</title>
  369. <para>All network plugins should use DEFAULT_SOCKET_TIMEOUT to timeout</para>
  370. </section>
  371. <section><title>Add alarms to network plugins</title>
  372. <para>If you write a plugin which communicates with another
  373. networked host, you should make sure to set an alarm() in your
  374. code that prevents the plugin from hanging due to abnormal
  375. socket closures, etc. Nagios takes steps to protect itself
  376. against unruly plugins that timeout, but any plugins you create
  377. should be well behaved on their own.</para>
  378. </section>
  379. </section>
  380. <section id="PlugOptions"><title>Plugin Options</title>
  381. <para>A well written plugin should have --help as a way to get
  382. verbose help. Code and output should try to respect the 80x25 size of a
  383. crt (remember when fixing stuff in the server room!)</para>
  384. <section><title>Option Processing</title>
  385. <para>For plugins written in C, we recommend the C standard
  386. getopt library for short options. Getopt_long is always available.
  387. </para>
  388. <para>For plugins written in Perl, we recommend Getopt::Long module.</para>
  389. <para>Positional arguments are strongly discouraged.</para>
  390. <para>There are a few reserved options that should not be used
  391. for other purposes:</para>
  392. <literallayout>
  393. -V version (--version)
  394. -h help (--help)
  395. -t timeout (--timeout)
  396. -w warning threshold (--warning)
  397. -c critical threshold (--critical)
  398. -H hostname (--hostname)
  399. -v verbose (--verbose)
  400. </literallayout>
  401. <para>In addition to the reserved options above, some other standard options are:</para>
  402. <literallayout>
  403. -C SNMP community (--community)
  404. -a authentication password (--authentication)
  405. -l login name (--logname)
  406. -p port or password (--port or --passwd/--password)monitors operational
  407. -u url or username (--url or --username)
  408. </literallayout>
  409. <para>Look at check_pgsql and check_procs to see how I currently
  410. think this can work. Standard options are:</para>
  411. <para>The option -V or --version should be present in all
  412. plugins. For C plugins it should result in a call to print_revision, a
  413. function in utils.c which takes two character arguments, the
  414. command name and the plugin revision.</para>
  415. <para>The -? option, or any other unparsable set of options,
  416. should print out a short usage statement. Character width should
  417. be 80 and less and no more that 23 lines should be printed (it
  418. should display cleanly on a dumb terminal in a server
  419. room).</para>
  420. <para>The option -h or --help should be present in all plugins.
  421. In C plugins, it should result in a call to print_help (or
  422. equivalent). The function print_help should call print_revision,
  423. then print_usage, then should provide detailed
  424. help. Help text should fit on an 80-character width display, but
  425. may run as many lines as needed.</para>
  426. <para>The option -v or --verbose should be present in all plugins.
  427. The user should be allowed to specify -v multiple times to increase
  428. the verbosity level, as described in <xref linkend="verboselevels">.</para>
  429. </section>
  430. <section>
  431. <title>Plugins with more than one type of threshold, or with
  432. threshold ranges</title>
  433. <para>Old style was to do things like -ct for critical time and
  434. -cv for critical value. That goes out the window with POSIX
  435. getopt. The allowable alternatives are:</para>
  436. <orderedlist>
  437. <listitem>
  438. <para>long options like -critical-time (or -ct and -cv, I
  439. suppose).</para>
  440. </listitem>
  441. <listitem>
  442. <para>repeated options like `check_load -w 10 -w 6 -w 4 -c
  443. 16 -c 10 -c 10`</para>
  444. </listitem>
  445. <listitem>
  446. <para>for brevity, the above can be expressed as `check_load
  447. -w 10,6,4 -c 16,10,10`</para>
  448. </listitem>
  449. <listitem>
  450. <para>ranges are expressed with colons as in `check_procs -C
  451. httpd -w 1:20 -c 1:30` which will warn above 20 instances,
  452. and critical at 0 and above 30</para>
  453. </listitem>
  454. <listitem>
  455. <para>lists are expressed with commas, so Jacob's check_nmap
  456. uses constructs like '-p 1000,1010,1050:1060,2000'</para>
  457. </listitem>
  458. <listitem>
  459. <para>If possible when writing lists, use tokens to make the
  460. list easy to remember and non-order dependent - so
  461. check_disk uses '-c 10000,10%' so that it is clear which is
  462. the precentage and which is the KB values (note that due to
  463. my own lack of foresight, that used to be '-c 10000:10%' but
  464. such constructs should all be changed for consistency,
  465. though providing reverse compatibility is fairly
  466. easy).</para>
  467. </listitem>
  468. </orderedlist>
  469. <para>As always, comments are welcome - making this consistent
  470. without a host of long options was quite a hassle, and I would
  471. suspect that there are flaws in this strategy.
  472. </para>
  473. </section>
  474. </section>
  475. <section id="CodingGuidelines"><title>Coding guidelines</title>
  476. <para>See <ulink url="http://www.gnu.org/prep/standards_toc.html">GNU
  477. Coding standards</ulink> for general guidelines.</para>
  478. <section><title>Comments</title>
  479. <para>You should use /* */ for comments and not // as some compilers
  480. do not handle the latter form.</para>
  481. <para>If you have copied a routine from another source, make sure the licence
  482. from your source allows this. Add a comment referencing the ACKNOWLEDGEMENTS
  483. file, where you can put more detail about the source.</para>
  484. <para>For contributed code, do not add any named credits in the source code
  485. - contributors should be added into the THANKS.in file instead.
  486. </para>
  487. </section>
  488. <section><title>CVS comments</title>
  489. <para>When adding CVS comments at commit time, you can use the following prefixes:
  490. <variablelist>
  491. <varlistentry><term>- comment</term>
  492. <listitem>
  493. <para>for a comment that can be removed from the Changelog</para>
  494. </listitem>
  495. </varlistentry>
  496. <varlistentry><term>* comment</term>
  497. <listitem>
  498. <para>for an important amendment to be included into a features list</para>
  499. </listitem>
  500. </varlistentry>
  501. </variablelist>
  502. </para>
  503. <para>If the change is due to a contribution, please quote the contributor's name
  504. and, if applicable, add the SourceForge Tracker number. Don't forget to
  505. update the THANKS.in file.</para>
  506. </section>
  507. </section>
  508. <section id="SubmittingChanges"><title>Submission of new plugins and patches</title>
  509. <section id="Patches"><title>Patches</title>
  510. <para>If you have a bug patch, please supply a unified or context diff against the
  511. version you are using. For new features, please supply a diff against
  512. the CVS HEAD version.</para>
  513. <para>Patches should be submitted via
  514. <ulink url="http://sourceforge.net/tracker/?group_id=29880&amp;atid=397599">SourceForge's
  515. tracker system for Nagiosplug patches</ulink>
  516. and be announced to the nagiosplug-devel mailing list.</para>
  517. <para>Submission of a patch implies that the submmitter acknowledges that they
  518. are the author of the code (or have permission from the author to release the code)
  519. and agree that the code can be released under the GPL. The copyright for the changes will
  520. then revert to the Nagios Plugin Development Team - this is required so that any copyright
  521. infringements can be investigated quickly without contacting a huge list of copyright holders.
  522. Credit will always be given for any patches through a THANKS file in the distribution.</para>
  523. </section>
  524. <section id="Newplugins"><title>New plugins</title>
  525. <para>If you would like others to use your plugins, please add it to
  526. the official 3rd party plugin repository,
  527. <ulink url="http://www.nagiosexchange.org">NagiosExchange</ulink>.
  528. </para>
  529. <para>We are not accepting requests for inclusion of plugins into
  530. our distribution at the moment, but when we do, these are the minimum
  531. requirements:
  532. </para>
  533. <orderedlist>
  534. <listitem>
  535. <para>The standard command options are supported (--help, --version,
  536. --timeout, --warning, --critical)</para>
  537. </listitem>
  538. <listitem>
  539. <para>It is determined to be not redundant (for instance, we would not
  540. add a new version of check_disk just because someone had provide
  541. a plugin that had perf checking - we would incorporate the features
  542. into an exisiting plugin)</para>
  543. </listitem>
  544. <listitem>
  545. <para>One of the developers has had the time to audit the code and declare
  546. it ready for core</para>
  547. </listitem>
  548. <listitem>
  549. <para>It should also follow code format guidelines, and use functions from
  550. utils (perl or c or sh) rather than using its own</para>
  551. </listitem>
  552. <listitem>
  553. <para>Includes patches to configure.in if required (via the EXTRAS list if
  554. it will only work on some platforms)</para>
  555. </listitem>
  556. <listitem>
  557. <para>If possible, please submit a test harness. Documentation on sample
  558. tests coming soon</para>
  559. </listitem>
  560. </orderedlist>
  561. </section>
  562. </section>
  563. </article>
  564. </book>