On the forums of one of my current hosting companies, I came across someone (Doug Robbins) who has written some pretty nice scripts to help administer and monitor a VPS or dedicated server. Below is a list of those scripts as well as others I have come across elsewhere:
- loadavg: lightweight load, memory & transfer monitoring – loadavg is a simple and lightweight method of monitoring load, memory usage and transfer throughput on a Linux server. Every method of monitoring has an impact on the system being monitored — loadavg is designed to keep that impact as low as possible. It generates HTML & CSS charts, thereby shifting much of the work from the server to the client — your web browser. While designed for use on a Linux Virtuozzo or OpenVZ VPS (Virtual Private Server), loadavg also works fine on a dedicated server.
- vpsinfo is a Linux server monitoring script, written in PHP, that provides web access to system status information. It gathers the output from several common Linux commands into one web page, providing a quick overview of the system’s current state. While designed for use on a Linux Virtuozzo or OpenVZ VPS (Virtual Private Server), vpsinfo also works fine on a dedicated server. When installed on a dedicated machine VPS-specific information is automatically excluded. (Note: requires some other scripts to do certain reports, namely mysqlreport, vnstat, and mytop)
- bwstat – bwstat is a PHP CLI application that logs & displays bandwidth usage. It is intended as a substitute for vnstat, for users having problems with vnstat running with newer Virtuozzo kernels. bwstat mimics the output of vnstat and supports a few (not all) of the same command line options and stores data in plain text files in its ‘data’ directory. No database is required, and the text files are tiny. bwstat can be installed anywhere. Data is gathered by running the bwlog.php script as a cronjob. The suggested installation runs this cronjob as root every 5 minutes.
- stat.php – a basic script that provides server and MySQL statistics. I think that most of this is covered better with the vpsinfo (assuming you also use mysqlreport or mytop) but this might be a simpler alternative for some.
- Mytoolkit – MySql and Server Helper Scripts
- PHP Security Check Script – I must admit I haven’t tried this script yet, but it seems promising and the feedback on the forum where I first learned about it was positive.
Note: if you use the mysql report option, you may want to check out The Guide To Understanding mysqlreport, which discusses the all sections of the report, what the values mean, and what is generally indicative of good and bad performance.
bwstat.php in your text editor and adjust (if necessary) the path to PHP at the top of each script. The supplied path is “
Check ownership and permissions. They should look like this:
-rwx------ 1 root root 3112 Aug 21 11:48 bwlog.php
-rwxr-xr-x 1 root root 7188 Aug 22 08:39 bwstat.php
-rw-r--r-- 1 root root 111 Aug 21 12:50 conf.php
drwxr-xr-x 2 root root 1024 Aug 22 09:20 data
– Everything should be owned by root.
bwlog.php should be executable only by root – chmod 700
bwstat.php should be executable by everyone – chmod 755
conf.php should be readable by everyone, writable only by root – chmod 644
data/ should be readable by everyone, writable only by root – chmod 755
conf.php in your text editor and change any configuration options. They should be self-explanatory, except maybe “
$monthstart“. This is an option added that is not in vnstat. You can use it to align your bwstat monthly data with your host’s bandwidth billing period. For example if your billing period starts on the 20th of the month, set “
$monthstart = 20“.
Subject: Configuring and Administering Your Server
Click to Add the First »