2014-01-07 20:20:43 +00:00
|
|
|
# PHP Server Monitor
|
2014-01-07 19:24:48 +00:00
|
|
|
|
2014-03-13 19:21:18 +00:00
|
|
|
## Summary
|
2014-01-07 19:24:48 +00:00
|
|
|
|
2014-02-10 22:57:40 +00:00
|
|
|
PHP Server Monitor is a script that checks whether your websites and servers are up and running.
|
2014-04-05 13:18:28 +00:00
|
|
|
It comes with a web based user interface where you can manage your services and websites,
|
2014-01-07 19:24:48 +00:00
|
|
|
and you can manage users for each server with a mobile number and email address.
|
|
|
|
|
2014-04-05 13:18:28 +00:00
|
|
|
Features:
|
|
|
|
|
|
|
|
* Monitor services and websites (see below).
|
|
|
|
* Email and SMS notifications.
|
|
|
|
* View history graphs of uptime and latency.
|
|
|
|
* User authentication with 2 levels (administrator and regular user).
|
|
|
|
* Logs of connection errors, outgoing emails and text messages.
|
|
|
|
* Easy cronjob implementation to automatically check your servers.
|
|
|
|
|
2014-02-10 22:57:40 +00:00
|
|
|
There are two different ways to monitor a server:
|
2014-01-07 20:20:43 +00:00
|
|
|
|
|
|
|
* Service
|
|
|
|
|
|
|
|
A connection will be made to the entered ip or domain, on the given port.
|
|
|
|
This way you can check if certain services on your machine are still running.
|
|
|
|
To check your IMAP service for example, enter port 143.
|
|
|
|
|
|
|
|
* Website
|
|
|
|
|
2014-02-10 22:57:40 +00:00
|
|
|
You can enter a link to a website, it will then use cURL to open the website and check the HTTP status code.
|
2014-01-12 13:30:48 +00:00
|
|
|
If the HTTP status code is in the 4xx range, it means an error occurred and the website is not accessible to the public.
|
2014-02-10 22:57:40 +00:00
|
|
|
You can also set a regular expression to match for content on the page itself.
|
|
|
|
If the regular expression returns no matches, the website is considered down.
|
2014-02-08 19:14:49 +00:00
|
|
|
In both cases the script will return a "status offline", and will start sending out notifications.
|
2014-01-07 19:24:48 +00:00
|
|
|
|
|
|
|
Each server has it's own settings regarding notification.
|
2014-02-08 18:36:17 +00:00
|
|
|
You can choose for email notification or text message (SMS).
|
|
|
|
The following SMS gateways are currently available:
|
2014-01-07 20:20:43 +00:00
|
|
|
|
|
|
|
* Mollie - <http://www.mollie.nl>
|
|
|
|
* Spryng - <http://www.spryng.nl>
|
|
|
|
* Inetworx - <http://www.inetworx.ch>
|
2014-01-07 22:32:57 +00:00
|
|
|
* Clickatell - <https://www.clickatell.com>
|
2014-01-10 10:32:15 +00:00
|
|
|
* Mosms - <http://www.mosms.com>
|
2014-01-21 22:09:51 +00:00
|
|
|
* Textmarketer - <http://www.textmarketer.co.uk>
|
2014-01-07 20:20:43 +00:00
|
|
|
|
2014-04-05 13:18:28 +00:00
|
|
|
Please note: for these gateways you will need an account with sufficient credits.
|
2014-01-07 19:24:48 +00:00
|
|
|
|
2014-02-08 18:36:17 +00:00
|
|
|
|
2014-03-13 19:21:18 +00:00
|
|
|
## Download
|
2014-01-07 19:24:48 +00:00
|
|
|
|
2014-03-13 19:16:31 +00:00
|
|
|
The latest version can be downloaded from <http://www.phpservermonitor.org/>.
|
2014-01-07 19:24:48 +00:00
|
|
|
|
|
|
|
|
2014-03-13 19:21:18 +00:00
|
|
|
## Requirements
|
2014-01-07 19:24:48 +00:00
|
|
|
|
2014-02-08 18:36:17 +00:00
|
|
|
* PHP 5.3+
|
2014-02-11 15:15:12 +00:00
|
|
|
* PHP cURL package
|
|
|
|
* PHP PDO mysql driver
|
2014-01-07 19:24:48 +00:00
|
|
|
|
|
|
|
|
2014-03-13 19:21:18 +00:00
|
|
|
## Install
|
2014-01-07 19:24:48 +00:00
|
|
|
|
2014-03-29 14:53:31 +00:00
|
|
|
See INSTALL.md file.
|
2014-02-08 20:16:41 +00:00
|
|
|
|
2014-01-07 20:20:43 +00:00
|
|
|
|
2014-03-13 19:21:18 +00:00
|
|
|
## Contributing
|
2014-01-07 20:20:43 +00:00
|
|
|
|
2014-03-13 19:16:31 +00:00
|
|
|
The code is available from <https://github.com/phpservermon/phpservermon>.
|
|
|
|
There is a master branch, which is stable and always reflects the latest release.
|
|
|
|
The develop branch is used for ongoing development and should not be considered stable.
|
|
|
|
If you would like to contribute a patch or feature, please fork the develop branch and send a pull request.
|
2014-01-07 20:20:43 +00:00
|
|
|
|
|
|
|
|
2014-03-13 19:16:31 +00:00
|
|
|
### Changing the email or text message
|
2014-01-07 20:20:43 +00:00
|
|
|
|
2014-03-13 19:16:31 +00:00
|
|
|
Go to the folder "src/lang", open the language file that corresponds to the selected language
|
2014-03-27 21:31:39 +00:00
|
|
|
(default is English ("en_US.lang.php")). Scroll all the way to the bottom until you spot this line:
|
2014-01-07 20:20:43 +00:00
|
|
|
|
|
|
|
'notifications' => array(
|
|
|
|
|
2014-03-13 19:16:31 +00:00
|
|
|
After that you will see the lines that hold the notification messages. For example:
|
2014-01-07 20:20:43 +00:00
|
|
|
|
|
|
|
'off_sms' => 'Server \'%LABEL%\' is DOWN: ip=%IP%, port=%PORT%. Error=%ERROR%',
|
|
|
|
|
|
|
|
The first part of this line, 'off_sms', is the name of the notification. You should not change this.
|
|
|
|
The second part is the actual message. There are a few variables you can use in your message:
|
|
|
|
|
|
|
|
* %LABEL% The name of the server
|
|
|
|
* %IP% The ip of the server
|
|
|
|
* %PORT% The port of the server
|
2014-03-13 19:16:31 +00:00
|
|
|
* %ERROR% This one only works for the off_* messages and contains the error returned by the monitor
|
2014-01-07 20:20:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
## License
|
|
|
|
|
|
|
|
PHP Server Monitor is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
PHP Server Monitor is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
2014-03-14 20:32:09 +00:00
|
|
|
along with PHP Server Monitor. If not, see <http://www.gnu.org/licenses/>.
|