return (0);
}
-int check_create_dir (const char *file_orig)
+static int check_create_dir (const char *file_orig)
{
struct stat statbuf;
return (0);
}
-int log_create_file (char *filename, char **ds_def, int ds_num)
+static int log_create_file (char *filename, char **ds_def, int ds_num)
{
FILE *log;
int i;
return 0;
}
-int log_update_file (char *host, char *file, char *values,
+static int log_update_file (char *host, char *file, char *values,
char **ds_def, int ds_num)
{
char *tmp;
return (0);
} /* int log_update_file */
-int rrd_create_file (char *filename, char **ds_def, int ds_num)
+#if HAVE_LIBRRD
+static int rrd_create_file (char *filename, char **ds_def, int ds_num)
{
-#ifdef HAVE_LIBRRD
char **argv;
int argc;
int i, j;
free (argv);
return (status);
-#else
- return (1);
-#endif /* HAVE_LIBRRD */
}
+#endif /* HAVE_LIBRRD */
int rrd_update_file (char *host, char *file, char *values,
char **ds_def, int ds_num)
{
+#if HAVE_LIBRRD
struct stat statbuf;
char full_file[1024];
char *argv[4] = { "update", full_file, values, NULL };
+#endif /* HAVE_LIBRRD */
/* I'd rather have a function `common_update_file' to make this
* decission, but for that we'd need to touch all plugins.. */
return (log_update_file (host, file, values,
ds_def, ds_num));
+#if HAVE_LIBRRD
/* host == NULL => local mode */
if (host != NULL)
{
return (-1);
}
-#ifdef HAVE_LIBRRD
optind = 0; /* bug in librrd? */
rrd_clear_error ();
if (rrd_update (3, argv) == -1)
syslog (LOG_WARNING, "rrd_update failed: %s: %s", full_file, rrd_get_error ());
return (-1);
}
-#endif /* HAVE_LIBRRD */
return (0);
+/* #endif HAVE_LIBRRD */
+
+#else
+ syslog (LOG_ERR, "`rrd_update_file' was called, but collectd isn't linked against librrd!");
+ return (-1);
+#endif
}
#ifdef HAVE_LIBKSTAT
void *extra)
{
DBG ("shortvar = %s, var = %s, arguments = %s, value = %s, ...",
- shortvar, var, (arguments) ? arguments : "<NULL>",
- (value) ? value : "?");
+ shortvar, var, arguments, value);
if (strcasecmp (value, "Client") == 0)
operating_mode = MODE_CLIENT;
void *extra)
{
DBG ("shortvar = %s, var = %s, arguments = %s, value = %s, ...",
- shortvar, var, (arguments) ? arguments : "<NULL>",
- (value) ? value : "?");
+ shortvar, var, arguments, value);
plugin_set_dir (value);
cf_mode_item_t *item;
DBG ("shortvar = %s, var = %s, arguments = %s, value = %s, ...",
- shortvar, var, (arguments) ? arguments : "<NULL>",
- (value) ? value : "?");
+ shortvar, var, arguments, value);
if (extra == NULL)
{
void *extra)
{
DBG ("shortvar = %s, var = %s, arguments = %s, value = %s, ...",
- shortvar, var, (arguments) ? arguments : "<NULL>",
- (value) ? value : "?");
+ shortvar, var, arguments, value);
if (plugin_load (value))
syslog (LOG_ERR, "plugin_load (%s): failed to load plugin", value);
char *service = NET_DEFAULT_PORT;
DBG ("shortvar = %s, var = %s, arguments = %s, value = %s, ...",
- shortvar, var, (arguments) ? arguments : "<NULL>",
- (value) ? value : "?");
+ shortvar, var, arguments, value);
buffer = strdup (value);
if (buffer == NULL)
void *extra)
{
DBG ("shortvar = %s, var = %s, arguments = %s, value = %s, ...",
- shortvar, var, (arguments) ? arguments : "<NULL>",
- (value) ? value : "?");
+ shortvar, var, arguments, value);
if (flags == LC_FLAGS_SECTIONSTART)
{
void *extra)
{
DBG ("shortvar = %s, var = %s, arguments = %s, value = %s, ...",
- shortvar, var, (arguments) ? arguments : "<NULL>",
- (value) ? value : "?");
+ shortvar, var, arguments, value);
if ((nesting_depth == 0) || (current_module == NULL))
{