summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a099e23)
raw | patch | inline | side by side (parent: a099e23)
author | Florent EppO Monbillard <eppo@darox.net> | |
Wed, 14 Feb 2007 11:25:22 +0000 (12:25 +0100) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Wed, 14 Feb 2007 11:27:09 +0000 (12:27 +0100) |
ChangeLog | patch | blob | history | |
src/apache.c | patch | blob | history |
diff --git a/ChangeLog b/ChangeLog
index ef413585ddd1ec7a273981da9afe2fd7bc176f1e..66c1fc1dcb6ddc732a79bfcf196a5eeb606c288f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
+ * apache plugin: Support for lighttpd's `BusyServers' (aka.
+ connections) field was added by Florent Monbillard.
+
2007-02-11, Version 3.11.2
* plugin: Catch NULL-pointer and try to fix them. Otherwise the
NULL-pointer may have been passed to `printf' which causes a
diff --git a/src/apache.c b/src/apache.c
index 530481be3f802b88bb4582a14dd9aef84612eef5..7c48f085bcd02924354115a342bd29f6ffeb8b7d 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"
};
static int scoreboard_ds_num = 1;
+/* for lighttpd; Limit to 65536 active connections */
+static char *connections_file = "apache/apache_connections.rrd";
+static char *connections_ds_def[] =
+{
+ "DS:connections:GAUGE:"COLLECTD_HEARTBEAT":0:65536",
+ NULL
+};
+static int connections_ds_num = 1;
+
static char *config_keys[] =
{
"URL",
rrd_update_file (host, buf, val, scoreboard_ds_def, scoreboard_ds_num);
}
+static void connections_write (char *host, char *inst, char *val)
+{
+ rrd_update_file (host, connections_file, val, connections_ds_def,
+ connections_ds_num);
+}
+
#if APACHE_HAVE_READ
static void submit (char *type, char *inst, long long value)
{
{
if (strcmp (fields[0], "Scoreboard:") == 0)
submit_scoreboard (fields[1]);
+ else if (strcmp (fields[0], "BusyServers:") == 0)
+ submit ("apache_connections", NULL, atol (fields[1]));
}
}
plugin_register ("apache_requests", NULL, NULL, requests_write);
plugin_register ("apache_bytes", NULL, NULL, bytes_write);
plugin_register ("apache_scoreboard", NULL, NULL, scoreboard_write);
+ plugin_register ("apache_connections", NULL, NULL, connections_write);
cf_register (MODULE_NAME, config, config_keys, config_keys_num);
}