From e385fef2ccc5619574898505da446f2ea23cfd3d Mon Sep 17 00:00:00 2001 From: Leon de Rooij Date: Tue, 21 Apr 2009 13:03:55 +0200 Subject: [PATCH] freeswitch plugin: Added channels to types.db and modified freeswitch.c a bit to send types --- src/freeswitch.c | 8 ++++---- src/types.db | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) 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 -- 2.11.0