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