Strictly System Check is a Wordpress plugin that is designed to allow webmasters to monitor their site at regular intervals throughout the day and to be notified if the site goes down or experiences database problems or high server loads.
This plugin was not designed to be a replacement for professional server monitoring tools however it is a nice easy to use system that can aid webmasters in monitoring their Wordpress site as well as notifying the right person whenever the site is down or running into performance problems. You might find that it also rescues your site from corrupt database tables before you even realise there has been a problem and that has got to be a good idea in anyone's books.
I created this plugin initially for my own use as on one of my sites I regularly import content from XML feeds and I noticed that occasionally after a large update my site would suffer problems such as:
- The Error establishing a database connection error message appearing whenever a page on the site was accessed even though the database configuration was correct.
- All my articles and other content disappearing from the site.
I soon realised that this was down to one or more of the MyISAM database tables in the MySQL database becoming corrupted especially the wp_posts or wp_options tables.
Running a REPAIR statement on these tables always fixed the problem but as I wasn't always around to catch this problem when it occurred I wanted to be able to automate the diagnosis and fix. This was the primary reason behind the plugin but it was soon extended to check for server loads and database connections and has become a valuable tool in ensuring that my site stays up and running.
How it works
- A CRON / WebCron job initiates an HTTP request to check whether the site can be accessed.
- The system will check for the Error establishing a database connection error message as well as searching for an optional piece of text which can help indicate whether the page has loaded correctly.
- If the error is found or the text cannot be found then a connection to the database is attempted.
- If successful a CHECK and REPAIR is carried out on any tables that maybe corrupted.
- An option exists to also check for fragmented tables and an OPTIMIZE command is carried out to fix any found.
- An SQL report is carried out to report on some key performance indicators such as the number of connections, queries, reads, writes and more.
- A report is carried out on the webserver to look at the current load average and if it's above a specified threshold a report to the site administrator can be triggered.
- A similar check is carried out on the database to ensure that there are no slow running queries or the connection limit hasn't been reached.
- If problems are found an email is then sent to the site administrator with details of the report.
An example of the report that is emailed out can be found below. This report is also accessible within the admin area of the plugin.
The HTTP request to http://www.mysite.com took 3 second(s) to respond and returned a status code of 200
The specified search text horse racing was found within the HTTP response
The server load is currently 0.43
The server load is okay
MySQL has been running for: 69 days 21 hours 34 mins 38 secs
Total Connections: 2014093 - Aborted: 0 - Connections Per Hour 1200
Total Queries: 102647557 - Queries / Per Hour 61187
Joins without indexes: 1 - Joins without indexes Per Hour 0
Total Reads: 17541055 (88%) - Total Writes 2338786 (12%)
The system did not need to check the REPAIR status of tables.
The system is currently configured to accept a maximum of 25 database connections
At the time of reporting the database was running 2 queries
The current database load is 8%
The database load is okay
The system is not set up to OPTIMIZE the tables or the server load of 0.43 was below the threshold for an OPTIMIZE of 2.
The system report has completed all its tests successfully.
Report Completed At 2014-03-26 17:38:04
Strictly Software Plugins for Wordpress
The site administrator can specify their own threshold limits for the webserver and database loads and a report will be emailed out whenever these limits are reached or if the site is inaccessible.
If you like the plugin and make a donation then please let me know and I will add a backlink from this site to yours.
- How do I schedule the report to run every 20 minutes?
You do this by creating either a CRON job on your webserver or using one of the many free WebCron services available on the web. My plugin will provide both the exact CRON Job code you can copy and paste into your command prompt to create the job or the URL to call for a WebCron job.
- If the website is down then how will the plugin run?
The code my plugin uses when running the system report is all self contained and doesn't rely on any Wordpress functions or files at all. Therefore even if the Wordpress system is down for some reason my plugin will be able to make HTTP requests, connect to the database and run system commands.
- Why does your plugin require write permission to the website?
Because my plugins report code is self contained and doesn't rely on any Wordpress code it requires it's own configuration file to hold database connection settings and other key parameters. The plugin also requires the ability to save it's report as a text file so that it can be viewed at a later date. If the wordpress system is out of action for whatever reason then it won't be possible to save this information to the database therefore the ideal solution is to create a custom text file instead.
This section describes how to install the plugin and get it working.
- Download the plugin
- Unzip the strictly-system-check.zip file
- Upload the directory strictly-system-check to the /wp-content/plugins directory on your WordPress site
- Activate the plugin through the 'Plugins' menu in WordPress
- Configure the plugin in the admin section of Wordpress
- Use the Test Configuration button to ensure your plugin will work correctly
- Set up a CRON job or WebCron job to run the system checker at intervals of your choice. The plugin will display the correct code and URL's to use for any CRON job. If you don't have a CRON job facility or cannot access your server to set one up then you should use a service like EasyCron which allows you to set up your own cron jobs to run at scheduled times to URLS of your choice.
Download Strictly System Check for Wordpress
The plugin is hosted on the Wordpress Subversion repository and if you are looking for the most up to date version you should check there first to access the individual files in the trunk.
If you want the most up to date stable version all zipped up then you should use the Wordpress download link.
If for whatever reason the Wordpress server is unavailble then you can download a version from my own server here: Strictly System Check version 1.0.6
Your donations help keep my work freely available. Please consider a small donation of any amount to show your appreciation if you like this plugin.
I am sure that the peace of mind that comes with knowing that your site is running okay is worth at least £10 or more and if my plugin automatically fixes your site without you even lifting a finger then I am sure that is worth even more!