diff --git a/src/apache.c b/src/apache.c
index 0bf52d3158ace12554ae436c1a2bde3ce1c4946b..5156ff66de6d91b080b010e2c7b221f85712ad88 100644 (file)
--- a/src/apache.c
+++ b/src/apache.c
/**
* collectd - src/apache.c
* Copyright (C) 2006 Florian octo Forster
+ * Copyright (C) 2007 Florent EppO Monbillard
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
*
* Authors:
* Florian octo Forster <octo at verplant.org>
+ * Florent EppO Monbillard <eppo at darox.net>
+ * - connections/lighttpd extension
**/
#include "collectd.h"
"apache_scoreboard", 1, apache_scoreboard_dsrc
};
+static data_source_t apache_connections_dsrc[1] =
+{
+ {"count", DS_TYPE_GAUGE, 0, 65535.0},
+};
+
+static data_set_t apache_connections_ds =
+{
+ "apache_connections", 1, apache_connections_dsrc
+};
+
#if APACHE_HAVE_READ
static char *url = NULL;
static char *user = NULL;
strcpy (vl.host, hostname);
strcpy (vl.plugin, "apache");
strcpy (vl.plugin_instance, "");
- strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
+
+ if (type_instance != NULL)
+ strncpy (vl.type_instance, type_instance,
+ sizeof (vl.type_instance));
plugin_dispatch_values (type, &vl);
} /* void submit_counter */
{
if (strcmp (fields[0], "Scoreboard:") == 0)
submit_scoreboard (fields[1]);
+ else if (strcmp (fields[0], "BusyServers:") == 0)
+ submit_gauge ("apache_connections", NULL, atol (fields[1]));
}
}
plugin_register_data_set (&apache_bytes_ds);
plugin_register_data_set (&apache_requests_ds);
plugin_register_data_set (&apache_scoreboard_ds);
+ plugin_register_data_set (&apache_connections_ds);
#if APACHE_HAVE_READ
plugin_register_config ("apache", config,