contrib/exec-nagios.px: Implement the "NRPEConfig" option.
[collectd.git] / src / collectd-nagios.c
index 8f4a410..45162bd 100644 (file)
  *   Florian octo Forster <octo at verplant.org>
  **/
 
-/* Set to C99 and POSIX code */
-#ifndef _ISOC99_SOURCE
-# define _ISOC99_SOURCE
-#endif
-#ifndef _POSIX_SOURCE
-# define _POSIX_SOURCE
-#endif
-#ifndef _POSIX_C_SOURCE
-# define _POSIX_C_SOURCE 200112L
-#endif
-#ifndef _REENTRANT
-# define _REENTRANT
-#endif
-
-/* Disable non-standard extensions */
-#ifdef _BSD_SOURCE
-# undef _BSD_SOURCE
-#endif
-#ifdef _SVID_SOURCE
-# undef _SVID_SOURCE
-#endif
-#ifdef _GNU_SOURCE
-# undef _GNU_SOURCE
+#if HAVE_CONFIG_H
+# include "config.h"
 #endif
 
 #if !defined(__GNUC__) || !__GNUC__
 # define __attribute__(x) /**/
 #endif
 
-#include "config.h"
-
 #include <stdlib.h>
 #include <unistd.h>
 #include <stdio.h>
@@ -339,7 +316,7 @@ static int do_check_con_none (size_t values_num,
        {
                printf (" |");
                for (i = 0; i < values_num; i++)
-                       printf (" %s=%g;;;;", values_names[i], values[i]);
+                       printf (" %s=%f;;;;", values_names[i], values[i]);
        }
        printf ("\n");
 
@@ -393,7 +370,7 @@ static int do_check_con_average (size_t values_num,
 
        printf ("%s: %g average |", status_str, average);
        for (i = 0; i < values_num; i++)
-               printf (" %s=%g;;;;", values_names[i], values[i]);
+               printf (" %s=%f;;;;", values_names[i], values[i]);
        printf ("\n");
 
        return (status_code);
@@ -443,7 +420,7 @@ static int do_check_con_sum (size_t values_num,
 
        printf ("%s: %g sum |", status_str, total);
        for (i = 0; i < values_num; i++)
-               printf (" %s=%g;;;;", values_names[i], values[i]);
+               printf (" %s=%f;;;;", values_names[i], values[i]);
        printf ("\n");
 
        return (status_code);