1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-23 06:35:42 +00:00

now works with the new Teamspeak 3.0.0-beta29

This commit is contained in:
- 2010-10-02 15:49:40 +02:00 committed by Steve Schnepp
parent b0cc68872d
commit d92232de0c

View file

@ -15,6 +15,8 @@
# www.wulkau.de
#
#######################################################
# 02.10.10 - v0.3
# -now works again with 3.0.0-beta29
#
# 18.04.10 - v0.2
# -transfer mode added
@ -31,7 +33,7 @@ use strict;
use Net::Telnet;
# CONFIG HERE!
my $hostname = $ENV{host} || "localhost"; # serveraddress
my $hostname = $ENV{host} || "188.40.110.119"; # serveraddress
my $port = $ENV{port} || 10011; # querryport
my $filename = "ts3v2_";
@ -60,7 +62,7 @@ if ($argument eq "overview" or $argument eq "transfer" or $ARGV[0] eq "suggest"
} elsif($argument eq "transfer") {
$mode = "t";
}
$telnet->waitfor("/TS3/");
$telnet->waitfor("/Welcome/");
$telnet->cmd("serverlist");
my $line = $telnet->getline(Timeout=>1);
my @servers = split(/\|/, $line);
@ -93,7 +95,7 @@ if (exists $ARGV[0] and $ARGV[0] eq "autoconf") {
} elsif (exists $ARGV[0] and $ARGV[0] eq "config") {
if ($mode eq "s") {
#single server mode
$telnet->waitfor("/TS3/");
$telnet->waitfor("/Welcome/");
$telnet->cmd("use sid=".$server);
$telnet->waitfor("/error id=0 msg=ok/");
$telnet->cmd("serverinfo");
@ -129,7 +131,7 @@ if (exists $ARGV[0] and $ARGV[0] eq "autoconf") {
print "graph_info This graph shows the number of connected users on a Teamspeak3 server\n";
foreach (@num) {
$telnet->waitfor("/TS3/");
$telnet->waitfor("/Welcome/");
$telnet->cmd("use sid=".$_);
$telnet->waitfor("/error id=0 msg=ok/");
$telnet->cmd("serverinfo");
@ -161,7 +163,7 @@ if (exists $ARGV[0] and $ARGV[0] eq "autoconf") {
#go go magic, go!
if ($mode eq "s") {
#single mode
$telnet->waitfor("/TS3/");
$telnet->waitfor("/Welcome/");
$telnet->cmd("use sid=".$server);
$telnet->waitfor("/error id=0 msg=ok/");
$telnet->cmd("serverinfo");
@ -176,7 +178,7 @@ if (exists $ARGV[0] and $ARGV[0] eq "autoconf") {
} elsif ($mode eq "o") {
#overview mode
for (@num) {
$telnet->waitfor("/TS3/");
$telnet->waitfor("/Welcome/");
$telnet->cmd("use sid=".$_);
$telnet->waitfor("/error id=0 msg=ok/");
$telnet->cmd("serverinfo");
@ -190,7 +192,7 @@ if (exists $ARGV[0] and $ARGV[0] eq "autoconf") {
$telnet->waitfor("/error id=0 msg=ok/");
}
} elsif ($mode eq "t") {
$telnet->waitfor("/TS3/");
$telnet->waitfor("/Welcome/");
$telnet->cmd("hostinfo");
my @tsave;
my $line = $telnet->getline(Timeout=>1);