[collectd] TeamSpeak2 plugin

Florian Forster octo at verplant.org
Sun Apr 13 11:15:02 CEST 2008


Hi Stefan,

On Fri, Apr 11, 2008 at 09:41:56PM +0200, Stefan Hacker wrote:
> as I'm not really sure how to answer to a mailingslist correctly with
> thunderbird I'll just answer to you. Sry.

no problem ;) Just add the mailing list address <collectd at
verplant.org> to the Cc: (Carbon Copy) field of the reply (or use
``Reply to all'' which automates that).

> I tested your changes (or should I say your rewrite^^), most of it
> works. I added a few more comments so I could understand it better ;-)

Yeah, I changed quite a bit, sorry :/ I just renamed some variables
while reading the code, then I wanted to correct the communication
handling (mixing buffered input (using fgets(3)) and unbuffered output
using read(2) may lead to very strange effects) and consolidate some
duplicate code, but one thing lead to another..

> The only real Problem I found is that you forgot to flush the outgoing
> buffer after using fputs so nothing got sent. I added the fflush but
> now I'm not really sure what would happen if sending failed....

If I see correctly you're (f)flushing after `fputs' and after its return
status has been checked, to this should be fine. If sending fails the
buffer is closed and flushed automatically (if possible).

One of your changes uses `strncasecmp' to check for "ERROR", but the
check for "OK" still uses `strncmp'. Is that on purpose?

> I added another interesting gauge to the sets of values which get
> fetched. The average package loss in percent.

Okay, I'll take a look :)

> I used the percent type from types.db...not really intuitive when
> looking at the folders but it works.

I think for packet loss we should add an extra type. I'll do that..

> I also tried to add something to the manpage...but I wasn't able to
> test it because the manpages just don't install with make install...

Looks okay.. Why don't the manpages install? They cannot be (re-)created
without having `perldoc' installed, but they should be installed in any
case, since ``precompiled'' versions come shipped with the tarball.

> I'll have to take some time too look at git so I don't keep providing
> ugly full diffs to old code.

Once you get used to the whole branching/merging business you won't want
to use SVN any longer because it seems so limiting ;) Anyway, Git can
handle the full-diffs, it can even break up that one big patch into
multiple commits :) Which I have done.

> If you want to test my/your source just try any public teamspeak2
> server. Most of them have their query ports exposed. I tested it with
> a big public server of the teamspeak makers, ...

Oh, nifty :) If that was my server, I'd close that port. But they'll
know what they're doing - I hope ;)

Taking a look at the values provided by the server, it looks like there
are more interesting values available. What about these:?
- Number of (virtual) servers
- Number of channels

Also, do you by any chance know what
- bwoutlastmin,
- bwoutlastsec,
- bwinlastmin, and
- bwinlastsec
mean? Is that simply the bandwidth used over the last seconds and
minute? The values seem to math the ones calculated from bytes sent/
received pretty good.

I have pushed the plugin (lacking support for `gapl' for now) to the
master branch of the Git repository, if you want to give it a try :) I
can send you a patch against 4.3 too, if you like..

Regards and thanks again for your code, time and effort :)
-octo
-- 
Florian octo Forster
Hacker in training
GnuPG: 0x91523C3D
http://verplant.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20080413/050672ea/attachment.pgp 


More information about the collectd mailing list