summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 86a8603)
raw | patch | inline | side by side (parent: 86a8603)
author | Rodolphe Quiédevillel <rquiedeville@bearstech.com> | |
Thu, 23 Apr 2009 07:16:08 +0000 (09:16 +0200) | ||
committer | Florian Forster <octo@huhu.verplant.org> | |
Thu, 23 Apr 2009 07:18:01 +0000 (09:18 +0200) |
Hi,
We evaluate collectd for internal use in our global monitoring system. For that
we need to monitor mysql locks, so as collectd doesn't do this I wrote a little
patch. This patch is based on 4.6.2 version and modify only src/mysql.c, hope
you'll find it usefull. If this patch is acceptable please feel free to
integrate it in your next release.
Regards,
--
Rodolphe Quiedeville
www.bearstech.com
We evaluate collectd for internal use in our global monitoring system. For that
we need to monitor mysql locks, so as collectd doesn't do this I wrote a little
patch. This patch is based on 4.6.2 version and modify only src/mysql.c, hope
you'll find it usefull. If this patch is acceptable please feel free to
integrate it in your next release.
Regards,
--
Rodolphe Quiedeville
www.bearstech.com
src/mysql.c | patch | blob | history | |
src/types.db | patch | blob | history |
diff --git a/src/mysql.c b/src/mysql.c
index ca5c525dcd8d1b0c2c47def7ef0fa6a1120d05ac..ca364b6c5f2fc67af4c24dcd265cf5c1c6ef4074 100644 (file)
--- a/src/mysql.c
+++ b/src/mysql.c
* Copyright (C) 2008 Mirko Buffoni
* Copyright (C) 2009 Doug MacEachern
* Copyright (C) 2009 Sebastian tokkee Harl
+ * Copyright (C) 2009 Rodolphe Quiédeville
*
* 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
* Mirko Buffoni <briareos at eswat.org>
* Doug MacEachern <dougm at hyperic.com>
* Sebastian tokkee Harl <sh at tokkee.org>
+ * Rodolphe Quiédevillel <rquiedeville at bearstech.com>
**/
#include "collectd.h"
else if (strcmp (key, "Threads_created") == 0)
threads_created = val;
}
+ else if (strncmp (key, "Table_locks_", 12) == 0)
+ {
+ if (val == 0ULL)
+ continue;
+
+ counter_submit ("mysql_locks", key + 12, val, db);
+ }
}
mysql_free_result (res); res = NULL;
diff --git a/src/types.db b/src/types.db
index e07329c2df9b1a6191f341436991b99766773ba2..f8b2f81f2e9b2b422910bde96ff6e4bcda8b6d0b 100644 (file)
--- a/src/types.db
+++ b/src/types.db
multimeter value:GAUGE:U:U
mysql_commands value:COUNTER:0:U
mysql_handler value:COUNTER:0:U
+mysql_locks value:COUNTER:0:U
mysql_log_position value:COUNTER:0:4294967295
mysql_octets rx:COUNTER:0:4294967295, tx:COUNTER:0:4294967295
mysql_qcache hits:COUNTER:0:U, inserts:COUNTER:0:U, not_cached:COUNTER:0:U, lowmem_prunes:COUNTER:0:U, queries_in_cache:GAUGE:0:U