From: Leon de Rooij Date: Tue, 21 Apr 2009 11:03:55 +0000 (+0200) Subject: freeswitch plugin: Added channels to types.db and modified freeswitch.c a bit to... X-Git-Url: https://git.octo.it/?p=collectd.git;a=commitdiff_plain;h=e385fef2ccc5619574898505da446f2ea23cfd3d freeswitch plugin: Added channels to types.db and modified freeswitch.c a bit to send types --- diff --git a/src/freeswitch.c b/src/freeswitch.c index 52b7a1d5..dc013fe5 100644 --- a/src/freeswitch.c +++ b/src/freeswitch.c @@ -51,7 +51,7 @@ static char *freeswitch_host = NULL; static char freeswitch_port[16]; static char *freeswitch_password = NULL; -static void freeswitch_submit (const char *type_instance, gauge_t inbound, gauge_t outbound) +static void freeswitch_submit (const char *profile, const char *type, gauge_t inbound, gauge_t outbound) { value_t values[2]; value_list_t vl = VALUE_LIST_INIT; @@ -63,8 +63,8 @@ static void freeswitch_submit (const char *type_instance, gauge_t inbound, gauge vl.values_len = 2; sstrncpy (vl.host, hostname_g, sizeof (vl.host)); sstrncpy (vl.plugin, "freeswitch", sizeof (vl.plugin)); - sstrncpy (vl.type, "freeswitch", sizeof (vl.type)); - sstrncpy (vl.type_instance, type_instance, sizeof (vl.type_instance)); + sstrncpy (vl.type, type, sizeof (vl.type)); + sstrncpy (vl.type_instance, profile, sizeof (vl.type_instance)); plugin_dispatch_values (&vl); } /* void freeswitch_submit */ @@ -100,7 +100,7 @@ static int freeswitch_read (void) esl_disconnect(&handle); */ - freeswitch_submit ("profilename", 0, 0); + freeswitch_submit ("res-public", "channels", 3, 5); return (0); } /* int freeswitch_read */ diff --git a/src/types.db b/src/types.db index 1acdaf67..04292e9f 100644 --- a/src/types.db +++ b/src/types.db @@ -7,6 +7,7 @@ bitrate value:GAUGE:0:4294967295 bytes value:GAUGE:0:U cache_result value:COUNTER:0:4294967295 cache_size value:GAUGE:0:4294967295 +channels inbound:GAUGE:0:U, outbound:GAUGE:0:U charge value:GAUGE:0:U compression_ratio value:GAUGE:0:2 connections value:COUNTER:0:U