prudens Posted August 15, 2009 Share Posted August 15, 2009 What's the best way to store statistics of say 100 different servers? Just basic statistics like how many users are online on each server. Quote Link to comment https://forums.phpfreaks.com/topic/170356-best-way-to-store-server-statistics/ Share on other sites More sharing options...
trq Posted August 15, 2009 Share Posted August 15, 2009 Depends entirely on what your planning on doing with these statistics. Quote Link to comment https://forums.phpfreaks.com/topic/170356-best-way-to-store-server-statistics/#findComment-898647 Share on other sites More sharing options...
prudens Posted August 15, 2009 Author Share Posted August 15, 2009 hmm, something like otlist.eu How should I store my statistics? Quote Link to comment https://forums.phpfreaks.com/topic/170356-best-way-to-store-server-statistics/#findComment-899065 Share on other sites More sharing options...
roopurt18 Posted August 15, 2009 Share Posted August 15, 2009 otslist.eu appears to be a single statistics page that receives updates from many servers. In that case otslist.eu probably has a web services or other page that allows each server to periodically post data about it's status. The stats themselves are probably stored in a database or flat file. What you're trying to accomplish is really simple in principle. 1) Create your site, such as mystats.com 2) Create a PHP file: mystats.com/receive_stats.php This script receives a POST submission of stats data from any of the reporting servers and adds it to the database. 3) Create a PHP file: mystats.com/display_stats.php This page displays the stored stats. 4) Create a PHP file: send_stats.php This is a PHP script that is installed on each server and scheduled as a cron entry. The job of this script is to query the server statistics and then POST them (using cURL or HttpRequest) to mystats.com/receive_stats.php This is exactly the same as creating a form handling script except you don't actually need an HTML form and instead of users submitting the data it's automated scripts. It's also a good idea to store a unique name-key pair for each server so they can identify themselves and not mangle other servers in the stats listing. Quote Link to comment https://forums.phpfreaks.com/topic/170356-best-way-to-store-server-statistics/#findComment-899109 Share on other sites More sharing options...
prudens Posted August 16, 2009 Author Share Posted August 16, 2009 Wow thank you for that comprehensive guide. Do you know where I can find a script that uses GD to graph the statistics? Quote Link to comment https://forums.phpfreaks.com/topic/170356-best-way-to-store-server-statistics/#findComment-899441 Share on other sites More sharing options...
roopurt18 Posted August 16, 2009 Share Posted August 16, 2009 I know there are a number of solutions out there, but I've not produced any graphs myself. Depending on the level of complexity you're willing to deal with and the amount of control you have over the server generating the graph images, you can also look into Java solutions. There are ways to make PHP and Java play nicely together. I would really only attempt that as a last resort though as it can cause quite a few headaches. Quote Link to comment https://forums.phpfreaks.com/topic/170356-best-way-to-store-server-statistics/#findComment-899591 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.