/**
* collectd - src/apache.c
- * Copyright (C) 2006 Florian octo Forster
+ * Copyright (C) 2006,2007 Florian octo Forster
* Copyright (C) 2007 Florent EppO Monbillard
*
* This program is free software; you can redistribute it and/or modify it
#include "plugin.h"
#include "configfile.h"
-#if HAVE_LIBCURL && HAVE_CURL_CURL_H
-# define APACHE_HAVE_READ 1
-# include <curl/curl.h>
-#else
-# define APACHE_HAVE_READ 0
-#endif
+#include <curl/curl.h>
-#if APACHE_HAVE_READ
static char *url = NULL;
static char *user = NULL;
static char *pass = NULL;
{
static char credentials[1024];
+ if (url == NULL)
+ return (0);
+
if (curl != NULL)
{
curl_easy_cleanup (curl);
curl_easy_setopt (curl, CURLOPT_USERPWD, credentials);
}
- if (url != NULL)
- {
- curl_easy_setopt (curl, CURLOPT_URL, url);
- }
+ curl_easy_setopt (curl, CURLOPT_URL, url);
if (cacert != NULL)
{
return (0);
} /* int apache_read */
-#endif /* APACHE_HAVE_READ */
void module_register (void)
{
-#if APACHE_HAVE_READ
plugin_register_config ("apache", config,
config_keys, config_keys_num);
plugin_register_init ("apache", init);
plugin_register_read ("apache", apache_read);
-#endif
} /* void module_register */