[Nagiosplug-devel] Fix for minor defect in check_load plugin

Laurence P Dawson larry.dawson at vanderbilt.edu
Thu Mar 24 06:14:08 CET 2005


There is a minor problem in the check_load.c plugin. It checks for
is_intnonneg for the values of parameters that are supposed to be
floats. 
There is a definite advantage for us in allowing float values, as using
a value like 1.9 instead of 2 reduces notifications due to 'flapping'.

Patch against cvs:

diff -c check_load.c.orig check_load.c 


*** check_load.c.orig   2005-03-24 08:02:06.643753343 -0600
--- check_load.c        2005-03-23 15:44:01.000000000 -0600
***************
*** 186,192 ****

                switch (c) {
                case 'w':                                                                       /* warning time threshold */
!                       if (is_intnonneg (optarg)) {
                                wload1 = atof (optarg);
                                wload5 = atof (optarg);
                                wload15 = atof (optarg);
--- 186,192 ----

                switch (c) {
                case 'w':                                                                       /* warning time threshold */
!                       if (is_numeric (optarg)) {
                                wload1 = atof (optarg);
                                wload5 = atof (optarg);
                                wload15 = atof (optarg);
***************
*** 202,208 ****
                                usage (_("Warning threshold must be float or float triplet!\n"));
                        break;
                case 'c':                                                                       /* critical time threshold */
!                       if (is_intnonneg (optarg)) {
                                cload1 = atof (optarg);
                                cload5 = atof (optarg);
                                cload15 = atof (optarg);
--- 202,208 ----
                                usage (_("Warning threshold must be float or float triplet!\n"));
                        break;
                case 'c':                                                                       /* critical time threshold */
!                       if (is_numeric (optarg)) {
                                cload1 = atof (optarg);
                                cload5 = atof (optarg);
                                cload15 = atof (optarg);






More information about the Devel mailing list