summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d07f285)
raw | patch | inline | side by side (parent: d07f285)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sun, 20 Apr 2008 08:19:40 +0000 (10:19 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Sun, 20 Apr 2008 08:19:40 +0000 (10:19 +0200) |
src/teamspeak2.c | patch | blob | history |
diff --git a/src/teamspeak2.c b/src/teamspeak2.c
index aa10742cf637923140843a2ef3fec1d8f57d5de4..3bad6b0ebabdee773f9828e26756704876d554d8 100644 (file)
--- a/src/teamspeak2.c
+++ b/src/teamspeak2.c
int status;
gauge_t users = NAN;
+ gauge_t channels = NAN;
+ gauge_t servers = NAN;
counter_t rx_octets = 0;
counter_t tx_octets = 0;
counter_t rx_packets = 0;
value++;
/* Check for known key and save the given value */
+ /* global info: users_online,
+ * server info: currentusers. */
if ((strcmp ("currentusers", key) == 0)
|| (strcmp ("users_online", key) == 0))
{
if (value != endptr)
valid |= 0x01;
}
+ /* global info: channels,
+ * server info: currentchannels. */
+ else if ((strcmp ("currentchannels", key) == 0)
+ || (strcmp ("channels", key) == 0))
+ {
+ channels = strtod (value, &endptr);
+ if (value != endptr)
+ valid |= 0x40;
+ }
+ /* global only */
+ else if (strcmp ("servers", key) == 0)
+ {
+ servers = strtod (value, &endptr);
+ if (value != endptr)
+ valid |= 0x80;
+ }
else if (strcmp ("bytesreceived", key) == 0)
{
rx_octets = strtoll (value, &endptr, 0);
if ((valid & 0x20) == 0x20)
tss2_submit_gauge (plugin_instance, "percent", "packet_loss", packet_loss);
+ if ((valid & 0x40) == 0x40)
+ tss2_submit_gauge (plugin_instance, "gauge", "channels", channels);
+
+ if ((valid & 0x80) == 0x80)
+ tss2_submit_gauge (plugin_instance, "gauge", "servers", servers);
+
if (valid == 0)
return (-1);
return (0);