Complex Server Manager [In-Progress]

Status
Not open for further replies.

ryuma

Member
May 30, 2016
36
1
43
Hi,
I want to share a simple monitoring system.
the first pass the script changes the name of the server and welcome message
the second execution of the script if the server name has changed, the server is turned off.
in the third script execution if the server is lagged behind the AFK, it is removed.
Create a file in the root of your script and add it to the cron
PHP:
<html>
<?php

    require_once(__DIR__.'/libs/TeamSpeak3/TeamSpeak3.php');
    require_once(__DIR__.'/configs/settingsts3.php');
    $tslist = TeamSpeak3::factory("serverquery://".$ts3_user.":".$ts3_pass."@".$ts3_ip.":".$ts3_queryport."");
    $afkName = 'AFK SYSTEM I-VOICE';
    $afkMessage = 'Здравствуйте, во избежание отключения TeamSpeak3 сервера, измените название сервера установленнное системой мониторинга';
    
    foreach ($tslist->serverList() as $serverID => $serverNAME)
    {
        if(strcasecmp($serverNAME->virtualserver_status,'online') == 0 )
            {
                
                
                if ($serverNAME->virtualserver_maxclients <= 50)
                    {
                        if(strcasecmp($serverNAME, $afkName) == 0 )
                        {
                            $server_aurostartoff = $serverNAME->virtualserver_autostart = 0;
                            $server_stop = $tslist->serverStop($serverID);
                            echo 'Сервер ID - ' .$serverID. ': Порт - ' .$serverPORT. ' : Отключен<br>';
                            
                        }
                        else
                        {   
                            $serverPORT = $serverNAME->virtualserver_port;
                            $modifServer = $serverNAME->modify(array(
                                 "virtualserver_name" => $afkName,
                                 "virtualserver_welcomemessage" => $afkMessage,
                                
                                 ));
                            echo 'Сервер ID - ' .$serverID. ': Порт - ' .$serverPORT. ' : Переименован ' .$serverNAME. '<br>';     
                        }
                    }
                    usleep(200000);
            }
        elseif (strcasecmp($serverNAME->virtualserver_status,'offline') == 0 )
            {
                if(strcasecmp($serverNAME, $afkName) == 0 )
                    {                       
                        $serverPORT = $serverNAME->virtualserver_port;
                        $server_del = $tslist->serverDelete($serverID);
                        echo 'Сервер: ID - ' .$serverID. ': Порт - ' .$serverPORT. ' : Удален по причине ' .$serverNAME. '<br>';
                    }
                    usleep(200000);
            }
        else {echo 'Нет серверов для редактирования';}
                                        
    }
    
?>   
</html>
 

ryuma

Member
May 30, 2016
36
1
43
spam message for all server

PHP:
<?php

    require_once(__DIR__.'/libs/TeamSpeak3/TeamSpeak3.php');
    require_once(__DIR__.'/configs/settingsts3.php');
    $tslist = TeamSpeak3::factory("serverquery://".$ts3_user.":".$ts3_pass."@".$ts3_ip.":".$ts3_queryport."");
    $rand = mt_rand(1, 3);
    
    if ($rand == 1)
        {
        $message = '
                                Добро пожаловать на [B]I-VOICE[/B] © 2016 [B]TEAMSPEAK 3 VIRTUAL HOSTING[/B]
                                Вы используете бесплатный базовый аккаунт. При подключении расширенных пакетов BasePlus и Extandet вы получаете расширенные возможности по управлению Вашим сервером.
                                Установка собственного баннера, кнопки сервера, подключение прямого адреса для севрера, отключение рекламы.
                                [url=https://i-voice.xyz/complexserver/]Панель управления[/url] сервером, официальный сайт [url=https://i-voice.xyz/]I-VOICE[/url], группа [url=https://vk.com/i_voice]VK[/url]';
            
        }
    if ($rand == 2)
        {
        $message = '
                                ©[B][url=https://shneider-host.ru/u1043]Шнайдер-хост[/url][/B] 2007–2016 надежный и качественный хостинг для твоего сайта с поддержкой php и mysql по умеренным ценам.
                                Еженедельное резервное копирование, высокий аптайм, высокая скорость загрузки страниц сайтов, версия PHP на ваш выбор, подключение SSL-сертификата от Lets encrypt';
            
        }
    if ($rand == 3)
        {
        $message = '
                                [B][url=https://wotshop.net/]WOTSHOP.NET[/url][/B], магазин случайных игровых предметов, валюты и премиум аккаунтов для [B]World of Tanks[/B].
                                Еженедельные розыгрыши на сайте и группе Вконтакте, возможность получить игровое золото, премиум дни и премиум машины по смешным ценам. Испытай свою удачу на [B][url=https://wotshop.net/]WOTSHOP.NET[/url][/B]';
            
        }       
    foreach ($tslist->serverList() as $serverID => $serverNAME)
    {
        $server_status = $serverNAME->virtualserver_status;
        if(strcasecmp($server_status ,'online') == 0 )
            {
                $slots = $serverNAME->virtualserver_maxclients;
                if ($slots <= 50)
                    {
                        $serverNAME->message($message);
                    }
                    usleep(100000);
            }
                                                                        
    }
 

ryuma

Member
May 30, 2016
36
1
43
if the server meksimum number of slots is greater than or equal to this parameter it falls within the range of the script.
Code:
//AFK system
if ($serverNAME->virtualserver_maxclients <= 50)
spam system
if ($slots <= 50)
 

BIOS

Knowledge Seeker
VIP
Oct 10, 2015
447
848
208
how i can fix it that new registrated accounts have no admin or vip rights?
and how can i fix that creation off new accounts gets an random portnumber on teamspeak creation?
 
Last edited:

akzmeister

Member
Apr 10, 2016
32
4
43
how i can fix it that new registrated accounts have no admin or vip rights?
and how can i fix that creation off new accounts gets an random portnumber on teamspeak creation?
Set 0 in the fields of admin and vip in the database :)
 
Sep 29, 2016
1
0
33
Don't work for me :( When i try to login, that show me that: *LINK REMOVED*

Sorry for language, it's in french.
Thanks in advance.

MOD EDIT: Hide your private ip address.
 
Last edited by a moderator:

Najsr

Moderator
TeamSpeak Developer
Apr 23, 2016
483
249
167
I think we won't see this project finished. Well, I might start on something similar but with framework not from scratch, lul.
 

flickerjunky

First perm VIP!? Furries4Life?! #CutenessOverload
VIP
Mar 16, 2016
69
58
56
I think we won't see this project finished. Well, I might start on something similar but with framework not from scratch, lul.
would really like it now that this script is stuck
 
Status
Not open for further replies.
Top