whoisrich Posted July 2, 2010 Share Posted July 2, 2010 Greetings, I am the creator of a server monitoring script called LGSL, which seems to be popular with various TCAdmin users, and I was asked to create a script that puts TCAdmin servers into LGSL. The script is now finished and tested as working, so I am sharing it here for everyone else, feedback is welcomed Technical: - It requires PHP 5.1 or newer, the settings are at the top of the code, along with some helpful information. - The script is independant of TCAdmin and LGSL, it can run on a completely separate host, it just needs a connection to both databases. - Remember that if a database is on a different host, you need to have the database and firewall setup to allow remote access. - During tests it was found some server owners had set the wrong query port in TCAdmin, so query port correction was added. To enable, place a copy of the lgsl_protocol.php ( found within LGSL ) into the same folder as this script. If the host has a firewall, queries need to be allowed. Download: http://www.greycube.com/help/lgsl_other/tcadmin_to_lgsl_v1.2.zip Link to comment Share on other sites More sharing options...
DougK94 Posted July 2, 2010 Share Posted July 2, 2010 Thank you, I am sure this will make some people here very happy Link to comment Share on other sites More sharing options...
Flightwatch Posted July 2, 2010 Share Posted July 2, 2010 Great. Will give it a try. Thanks Link to comment Share on other sites More sharing options...
trancemode Posted July 2, 2010 Share Posted July 2, 2010 woot! thanks! Link to comment Share on other sites More sharing options...
whoisrich Posted July 3, 2010 Author Share Posted July 3, 2010 The script password goes in the URL /tcadmin_to_lgsl.php?password=FOOBAR Please note, the script password should be kept simple, it is purely to prevent any chance of a webcrawler running it. If you start putting symbols in the password it may not work as they can conflict with the URL. Your remote DB password however should be very secure for obvious reasons. Link to comment Share on other sites More sharing options...
CobbyJUK Posted July 3, 2010 Share Posted July 3, 2010 Transfer started. lgsl_protocol.php was found - query port checking enabled. TCAdmin database connection failed: SQLSTATE[HY000] [2003] Can't connect to MySQL server on '213.229.97.226' (110) anyone know the problem Link to comment Share on other sites More sharing options...
whoisrich Posted July 3, 2010 Author Share Posted July 3, 2010 I would check that remote access is enabled for the database. Also doing a quick google search on 'SQLSTATE[HY000] [2003]' says in the first result it may be SELinux, and gives a command to fix the problem. Link to comment Share on other sites More sharing options...
CobbyJUK Posted July 3, 2010 Share Posted July 3, 2010 ok thanks rich, i have allowed the firewall and to be accsesd by remote, i will have a search for the sqlstate later on, the server TCAdmin server is running on windows as well. Link to comment Share on other sites More sharing options...
CobbyJUK Posted July 3, 2010 Share Posted July 3, 2010 these are some screenshots, maybe im doing somthing wrong? http://img804.imageshack.us/img804/4003/61234560.jpg http://img12.imageshack.us/img12/7881/90295385.jpg and i also tried the command in a post about the sqlstate setsebool -P httpd_can_network_connect=1 didnt seem to do anything Chris Link to comment Share on other sites More sharing options...
trancemode Posted July 3, 2010 Share Posted July 3, 2010 anyone has a live version up? Link to comment Share on other sites More sharing options...
whoisrich Posted July 3, 2010 Author Share Posted July 3, 2010 To allow the script to access the TCAdmin database on from a different host, you need to grant access within MySQL itself. http://dev.mysql.com/doc/refman/5.1/en/grant.html If you have combined PHP and ASP.NET on the TCAdmin server, then you can use phpMyAdmin for the permissions: http://www.greycube.com/help/lgsl_other/tcadmin_to_lgsl_remote_mysql.png If not, you can use the MySQL command line, or any tool that allows you to run MySQL commands. Here is what to type, do not miss off the end semi-colons. - Command Prompt, Navigate to the MySQL bin folder. - Type: mysql.exe -u root -p password - Type: CREATE USER 'root'@'123.123.123.123' IDENTIFIED BY 'password'; - Type: GRANT ALL PRIVILEGES ON *.* TO 'root'@'123.123.123.123'; - Type: FLUSH PRIVILEGES; - Type: SELECT User,Host FROM mysql.user; - Type: QUIT ( change 123.123.123.123 to script host IP, and password to the actual password ) Link to comment Share on other sites More sharing options...
CobbyJUK Posted July 3, 2010 Share Posted July 3, 2010 mission to install fastcgi then phpmyadmin and getting php to work, i give up on it Link to comment Share on other sites More sharing options...
whoisrich Posted July 4, 2010 Author Share Posted July 4, 2010 Cobby, I have updated the above post with instructions on how to do the permissions from the command prompt, give them ago Link to comment Share on other sites More sharing options...
kuzmi4 Posted July 4, 2010 Share Posted July 4, 2010 nice working. thx Link to comment Share on other sites More sharing options...
CobbyJUK Posted July 4, 2010 Share Posted July 4, 2010 still no luck for me still getting Transfer started. lgsl_protocol.php was found - query port checking enabled. TCAdmin database connection failed: SQLSTATE[HY000] [2003] Can't connect to MySQL server on '213.229.97.226' (110) do you have any messenger or any other IM contact rich? Link to comment Share on other sites More sharing options...
CobbyJUK Posted July 4, 2010 Share Posted July 4, 2010 sorted the probem. allowed the default MySQL port (3306) to accept both outbound/inbound TCP traffic on my web server, worked fine after that. thanks for all your help Link to comment Share on other sites More sharing options...
CprlRst Posted July 27, 2010 Share Posted July 27, 2010 We Have this running over at our site http://www.clan-hosts.org.uk. I have found several issues but are easily fixable in the script such as tc id's being set differently Link to comment Share on other sites More sharing options...
Shaman777 Posted August 15, 2010 Share Posted August 15, 2010 I have this error: Transfer started. lgsl_protocol.php was found - query port checking enabled. TCAdmin database connection failed: could not find driver Running this script on the freebsd 8.0 box with php 5.2 support and all php 5.2 extensions compiled. //update. found the solution. Need to install databases/php5-pdo_mysql port Link to comment Share on other sites More sharing options...
whoisrich Posted August 15, 2010 Author Share Posted August 15, 2010 Happy to see you got it working Link to comment Share on other sites More sharing options...
CoZmicShReddeR Posted August 24, 2010 Share Posted August 24, 2010 Wow nice to see you here Rich! One word of caution if you are already using LGSL prior to using TCadmin this will wipe your current set of configured servers and replace it with your TCADMIN list! I just found that out the hard way luckily I always back up my databases! Link to comment Share on other sites More sharing options...
CobbyJUK Posted September 13, 2010 Share Posted September 13, 2010 im getting a PDO error on the script Transfer started. lgsl_protocol.php was found - query port checking enabled. Fatal error: Class 'PDO' not found in /home/user/public_html/tcalgsl/tcadmin_to_lgsl.php on line 126 any idea on a way round? Link to comment Share on other sites More sharing options...
TheHeartSmasher Posted September 16, 2010 Share Posted September 16, 2010 Install the LGSL package in addition tcalgsl package. Link to comment Share on other sites More sharing options...
whoisrich Posted September 16, 2010 Author Share Posted September 16, 2010 TCAdmin To LGSL requires PDO. This comes as standard with PHP 5.1 or newer. You may need to enable PDO in your PHP.ini by uncommenting or adding lines. Windows: extension=pdo.dll extension=pdo_mysql.dll Linux: extension=pdo.so extension=pdo_mysql.so Link to comment Share on other sites More sharing options...
kroko Posted November 9, 2012 Share Posted November 9, 2012 this might be a necro post. but do anyone know if this works for tca2 too? Link to comment Share on other sites More sharing options...
LFA Posted November 10, 2012 Share Posted November 10, 2012 The table structures in v2 are different so you might need to change the query for the script to work correctly. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.