diff options
Diffstat (limited to 'doc/developer-guidelines.sgml')
-rw-r--r-- | doc/developer-guidelines.sgml | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/doc/developer-guidelines.sgml b/doc/developer-guidelines.sgml index 28674e0..37c963e 100644 --- a/doc/developer-guidelines.sgml +++ b/doc/developer-guidelines.sgml | |||
@@ -31,7 +31,7 @@ | |||
31 | 31 | ||
32 | <preface id="preface"><title>Preface</title> | 32 | <preface id="preface"><title>Preface</title> |
33 | <para>The purpose of this guidelines is to provide a reference for | 33 | <para>The purpose of this guidelines is to provide a reference for |
34 | the plugin developers and encourage the standarization of the | 34 | the plugin developers and encourage the standardization of the |
35 | different kind of plugins: C, shell, perl, python, etc.</para> | 35 | different kind of plugins: C, shell, perl, python, etc.</para> |
36 | 36 | ||
37 | <para>Monitoring Plugins Development Guidelines Copyright (C) 2000-2013 | 37 | <para>Monitoring Plugins Development Guidelines Copyright (C) 2000-2013 |
@@ -374,7 +374,7 @@ | |||
374 | <listitem><para>s - seconds (also us, ms)</para></listitem> | 374 | <listitem><para>s - seconds (also us, ms)</para></listitem> |
375 | <listitem><para>% - percentage</para></listitem> | 375 | <listitem><para>% - percentage</para></listitem> |
376 | <listitem><para>B - bytes (also KB, MB, TB)</para></listitem> | 376 | <listitem><para>B - bytes (also KB, MB, TB)</para></listitem> |
377 | <listitem><para>c - a continous counter (such as bytes | 377 | <listitem><para>c - a continuous counter (such as bytes |
378 | transmitted on an interface)</para></listitem> | 378 | transmitted on an interface)</para></listitem> |
379 | </orderedlist> | 379 | </orderedlist> |
380 | </listitem> | 380 | </listitem> |
@@ -397,7 +397,7 @@ | |||
397 | <section><title>Don't execute system commands without specifying their | 397 | <section><title>Don't execute system commands without specifying their |
398 | full path</title> | 398 | full path</title> |
399 | <para>Don't use exec(), popen(), etc. to execute external | 399 | <para>Don't use exec(), popen(), etc. to execute external |
400 | commands without explicity using the full path of the external | 400 | commands without explicitly using the full path of the external |
401 | program.</para> | 401 | program.</para> |
402 | 402 | ||
403 | <para>Doing otherwise makes the plugin vulnerable to hijacking | 403 | <para>Doing otherwise makes the plugin vulnerable to hijacking |
@@ -655,7 +655,7 @@ | |||
655 | <para>If possible when writing lists, use tokens to make the | 655 | <para>If possible when writing lists, use tokens to make the |
656 | list easy to remember and non-order dependent - so | 656 | list easy to remember and non-order dependent - so |
657 | check_disk uses '-c 10000,10%' so that it is clear which is | 657 | check_disk uses '-c 10000,10%' so that it is clear which is |
658 | the precentage and which is the KB values (note that due to | 658 | the percentage and which is the KB values (note that due to |
659 | my own lack of foresight, that used to be '-c 10000:10%' but | 659 | my own lack of foresight, that used to be '-c 10000:10%' but |
660 | such constructs should all be changed for consistency, | 660 | such constructs should all be changed for consistency, |
661 | though providing reverse compatibility is fairly | 661 | though providing reverse compatibility is fairly |
@@ -686,7 +686,7 @@ all the current tests and report an overall success rate. | |||
686 | <para>These use perl's Test::More. To do a one time test, run "cd plugins && perl t/check_disk.t". | 686 | <para>These use perl's Test::More. To do a one time test, run "cd plugins && perl t/check_disk.t". |
687 | </para> | 687 | </para> |
688 | 688 | ||
689 | <para>There will somtimes be failures seen in this output which are known failures that | 689 | <para>There will sometimes be failures seen in this output which are known failures that |
690 | need to be fixed. As long as the return code is 0, it will be reported as "test pass". | 690 | need to be fixed. As long as the return code is 0, it will be reported as "test pass". |
691 | (If you have a fix so that the specific test passes, that will be gratefully received!) | 691 | (If you have a fix so that the specific test passes, that will be gratefully received!) |
692 | </para> | 692 | </para> |
@@ -733,12 +733,9 @@ setup the tests. Run "make test" to run all the tests. | |||
733 | <para>Variables should be declared at the beginning of code blocks and | 733 | <para>Variables should be declared at the beginning of code blocks and |
734 | not inline because of portability with older compilers.</para> | 734 | not inline because of portability with older compilers.</para> |
735 | 735 | ||
736 | <para>You should use /* */ for comments and not // as some compilers | 736 | <para>You should use the type "bool" and its values |
737 | do not handle the latter form.</para> | 737 | "true" and "false" instead of the "int" type for booleans. |
738 | 738 | </para> | |
739 | <para>You should also avoid using the type "bool" and its values | ||
740 | "true" and "false". Instead use the "int" type and the plugins' own | ||
741 | "TRUE"/"FALSE" values to keep the code uniformly.</para> | ||
742 | </section> | 739 | </section> |
743 | 740 | ||
744 | <section><title>Crediting sources</title> | 741 | <section><title>Crediting sources</title> |
@@ -846,7 +843,7 @@ setup the tests. Run "make test" to run all the tests. | |||
846 | <para>It is determined to be not redundant (for instance, we would not | 843 | <para>It is determined to be not redundant (for instance, we would not |
847 | add a new version of check_disk just because someone had provide | 844 | add a new version of check_disk just because someone had provide |
848 | a plugin that had perf checking - we would incorporate the features | 845 | a plugin that had perf checking - we would incorporate the features |
849 | into an exisiting plugin)</para> | 846 | into an existing plugin)</para> |
850 | </listitem> | 847 | </listitem> |
851 | <listitem> | 848 | <listitem> |
852 | <para>One of the developers has had the time to audit the code and declare | 849 | <para>One of the developers has had the time to audit the code and declare |