Merge branch 'collectd-4.2' into collectd-4.3
[collectd.git] / src / collectd.c
index 70223b7..4e521f9 100644 (file)
 
 #include "plugin.h"
 #include "configfile.h"
-#include "types_list.h"
+
+#if HAVE_STATGRAB_H
+# include <statgrab.h>
+#endif
 
 /*
  * Global variables
@@ -88,7 +91,11 @@ static int init_hostname (void)
        status = getaddrinfo (hostname_g, NULL, &ai_hints, &ai_list);
        if (status != 0)
        {
-               ERROR ("getaddrinfo failed.");
+               ERROR ("Looking up \"%s\" failed. You have set the "
+                               "\"FQDNLookup\" option, but I cannot resolve "
+                               "my hostname to a fully qualified domain "
+                               "name. Please fix you network "
+                               "configuration.", hostname_g);
                return (-1);
        }
 
@@ -216,7 +223,7 @@ static void update_kstat (void)
 /* TODO
  * Remove all settings but `-f' and `-C'
  */
-static void exit_usage (char *name)
+static void exit_usage (void)
 {
        printf ("Usage: "PACKAGE" [OPTIONS]\n\n"
                        
@@ -260,7 +267,6 @@ static int do_init (void)
        }
 #endif
 
-       read_types_list ();
        plugin_init_all ();
 
        return (0);
@@ -290,7 +296,7 @@ static int do_loop (void)
 #endif
 
                /* Issue all plugins */
-               plugin_read_all (&loop);
+               plugin_read_all ();
 
                if (gettimeofday (&tv_now, NULL) < 0)
                {
@@ -406,7 +412,7 @@ int main (int argc, char **argv)
 #endif /* COLLECT_DAEMON */
                        case 'h':
                        default:
-                               exit_usage (argv[0]);
+                               exit_usage ();
                } /* switch (c) */
        } /* while (1) */