changing markdown to rst; updating docs; adding docs build dir to gitignore; adding docs to release export

This commit is contained in:
Pepijn Over 2014-04-10 18:29:53 +02:00
parent f1139abf13
commit 52923336f3
13 changed files with 127 additions and 164 deletions

2
.gitattributes vendored
View File

@ -1,3 +1,3 @@
.gitignore export-ignore .gitignore export-ignore
.gitattributes export-ignore .gitattributes export-ignore
Makefile export-ignore ./Makefile export-ignore

1
.gitignore vendored
View File

@ -2,3 +2,4 @@
/nbproject /nbproject
/config.php /config.php
/build /build
/docs/_build

View File

@ -1,25 +1,27 @@
# PHP Server Monitor Changelog
=========
## Changelog not yet released
----------------
### v3.1.0 (not yet released) * Added Chinese translation.
* Sphinx is now used for documentation <http://sphinx.pocoo.org/>.
* Added Chinese translation
### v3.0.0 (released April 6, 2014) v3.0.0 (released April 6, 2014)
-------------------------------
* New module structure (not backwards compatible). * New module structure (not backwards compatible).
* Added user login system with 2 user levels (administrator and regular user). * Added user login system with 2 user levels (administrator and regular user).
* Added warning threshold option (set number of failed checks before server goes offline). * Added warning threshold option (set number of failed checks before server goes offline).
* Added SMTP support. * Added SMTP support.
* Adding Bulgarian language file (thanks to Plamen Vasilev). * Adding Bulgarian language file.
* Added history tracking of server uptime. * Added history tracking of server uptime.
* Added history graphs of server uptime and latency (thanks to Jérôme Cabanis). * Added history graphs of server uptime and latency.
* Added user profile page. * Added user profile page.
* Status page is now default homepage. * Status page is now default homepage.
* Updated translations. * Updated translations.
* Date and time formats are taken from language file and localized per language (thanks to Jérôme Cabanis). * Date and time formats are taken from language file and localized per language.
* When checking a website, the updater will now follow 302 Location headers. * When checking a website, the updater will now follow 302 Location headers.
* String/pattern search on websites did not work for websites with compression turned on. * String/pattern search on websites did not work for websites with compression turned on.
* The monitor now uses a custom user agent so it can be identified in access logs (Mozilla/5.0 (compatible; phpservermon/version; +http://www.phpservermonitor.org)). * The monitor now uses a custom user agent so it can be identified in access logs (Mozilla/5.0 (compatible; phpservermon/version; +http://www.phpservermonitor.org)).
@ -31,36 +33,39 @@
* Project website updated to <http://www.phpservermonitor.org> * Project website updated to <http://www.phpservermonitor.org>
### v2.1.0 (released February 8, 2014) v2.1.0 (released February 8, 2014)
----------------------------------
* PHP 5.3+ required * PHP 5.3+ required
* Merged PHP Server Monitor Plus project by Luiz Alberto S. Ribeiro (<https://github.com/madeinnordeste/PHP-Server-Monitor-Plus>). * Merged PHP Server Monitor Plus project by Luiz Alberto S. Ribeiro (<https://github.com/madeinnordeste/PHP-Server-Monitor-Plus>).
* New layout (thanks to twitter bootstrap) * New layout
* New install module. * New install module.
* Regex search on website has been added by Paul Feakins. * Regex search on website has been added.
* Support for mosms provider by Andreas Ek. * Support for mosms provider.
* Support for Textmarketer provider by Perri Vardy-Mason. * Support for Textmarketer provider.
* Language files are now automatically detected, instead of a hardcoded list. * Language files are now automatically detected, instead of a hardcoded list.
* Adding Korean language file (thanks to Ik-Jun). * Adding Korean language file.
* Adding Portuguese / Brazilian language file (thanks to Luiz Alberto S. Ribeiro). * Adding Portuguese / Brazilian language file.
* Large status page by Michael Greenhill. * Large status page.
* New config file (see install instructions in README). * New config file (see install instructions in README).
* Cronjob will be prevented from running multiple times at the same time (with a 10 mins timeout). * Cronjob will be prevented from running multiple times at the same time (with a 10 mins timeout).
### v2.0.1 (released October 29, 2011) v2.0.1 (released October 29, 2011)
----------------------------------
* Adding German language file (thanks to Brunbaur Herbert). * Adding German language file.
* Adding French language file (thanks to David Ribeiro). * Adding French language file.
* classes/sm/smUpdaterStatus.class.php: the curl option CURLOPT_CUSTOMREQUEST has been changed to CURLOPT_NOBODY. * classes/sm/smUpdaterStatus.class.php: the curl option CURLOPT_CUSTOMREQUEST has been changed to CURLOPT_NOBODY.
* Servers page: auto refresh can be configured at the config page. * Servers page: auto refresh can be configured at the config page.
* Servers page: if the server is a website, the "Domain/Ip" field will be a link to the website. * Servers page: if the server is a website, the "Domain/Ip" field will be a link to the website.
* New text message gateway: Clickatell.com (thanks to Simon). * New text message gateway: Clickatell.com.
* If cURL is not installed, the install.php script will throw an error. * If cURL is not installed, the install.php script will throw an error.
* HTTP status codes 5xx will also be treated as error. * HTTP status codes 5xx will also be treated as error.
### v2.0.0 (released October 19, 2009) v2.0.0 (released October 19, 2009)
----------------------------------
* Server type ("service" or "website"). * Server type ("service" or "website").
* Different types of notification. * Different types of notification.
@ -70,8 +75,15 @@
* Check for updates function. * Check for updates function.
### v1.0.1 (released September 18, 2008) v1.0.1 (released September 18, 2008)
------------------------------------
* log.php * log.php
* tpl/log.tpl.html * tpl/log.tpl.html
* Select order by clause used datetime field after DATE_FORMAT had been performed, resulting in a wrong list of log entries shown. * Select order by clause used datetime field after DATE_FORMAT had been performed, resulting in a wrong list of log entries shown.
v1.0.0 (released July 16, 2008)
-------------------------------
* Initial release

17
CREDITS
View File

@ -1,17 +0,0 @@
Credits
=======
* Main development - Pepijn Over
* History page, localisation & more - Jérôme Cabanis
* Bugfixes & features - Perri Vardy-Mason
* PHP Mailer - Brent R. Matzelle
* German translation - Brunbaur Herbert
* French translation - David Ribeiro
* Korean translation - Ik-Jun
* Brazilian translation - Luiz Alberto S. Ribeiro
* Bulgarian translation - Plamen Vasilev
* Bootstrap implementation - Luiz Alberto S. Ribeiro
* Mosms implementation - Andreas Ek
* Status page - Michael Greenhill
* Javascript charts - jqPlot <http://www.jqplot.com>
* Bootstrap layout - Twitter Bootstrap <http://getbootstrap.com>

View File

@ -1,79 +0,0 @@
# PHP Server Monitor
## Install
### 1. Upload files
The first step is to upload your files to your webserver where you can reach them.
You can rename the folder of the server monitor without any problems.
### 2. Run install.php
You can now run the install.php script located in the root dir.
The install script will guide you through setting up your configuration file and create the required database tables.
If for some reason you can not generate your configuration file, you can do it manually using the steps below.
Rename the config.php.sample file to config.php, then open the config.php file with a plain text editor such as Notepad.
In this file you need to change the database information, which is stored using php's define() function.
To change these values correctly, only update the second parameter of the function.
define('PSM_DB_HOST', 'db_host');
define('PSM_DB_NAME', 'db_name');
define('PSM_DB_USER', 'db_user');
define('PSM_DB_PASS', 'db_user_password');
For example: to change your username you should ONLY change the 'db\_user' part.
Do NOT remove the quotes around your username as that will result in an error.
After you have created the config.php, run the install.php again to create the database structure.
### 3. Configure your installation
Open the main page of the server monitor, by simply navigating to index.php. In the menu on the top find "Config",
it will open a page where you can change the necessary information for your tool.
## Upgrade
For a regular upgrade, follow these steps:
* Replace all files except(!) config.php
* Navigate to install.php
* Follow the steps
* Enjoy
### From 2.0
The structure of the project has changed quite a bit since 2.0, but if you have not made any local changes the upgrade is quite easy.
The best thing to do is to replace all your current files with the new release, except for the config.inc.php file.
The config file has actually been renamed since 2.0, but if you keep it there while upgrading the install script will use it to prefill your database information.
The rest of the steps are identical to a regular upgrade (see above), except that you can remove the old config.inc.php file afterwards.
### From 2.1
One of the new features introduced in 3.0 is a user authentication system. Because the users in previous versions do not have a password, after upgrading you would not be able to login.
For that reason the upgrade script will ask you to create a new account during the upgrade, which you can then use to change the password for the existing accounts.
If, for whatever reason this does not work, the upgrade script automatically changes the username of all existing users to their email addresses, which you could use for the forgot password screen.
## Setting up a cronjob
In order to keep the server monitor up to date, the status updater has to run regularly.
If you're running this on a linux machine, the easiest way is to add a cronjob.
If it is your own server or you have shell access and permission to open the crontab, locate the "crontab" file
(usually in /etc/crontab, but depends on distro). Open the file (vi /etc/crontab), and add the following
(change the paths to match your installation directories) to run it every 15 minutes:
*/15 * * * * root /usr/bin/php /var/www/html/phpservermon/cron/status.cron.php
As you can see, this line will run the status.cron.php script every 15 minutes. Change the line to suit your needs.
If you do not have shell access, ask your web hosting provider to set it up for you.
The update script has been designed to prevent itself from running multiple times. It has a maximum timeout of 10 minutes.
After that the script is assumed dead and the cronjob will run again.
If you want to change the 10 minutes timeout, find the constant "PSM_CRON_TIMEOUT" in src/includes/psmconfig.inc.php.
## Troubleshooting
If you have problems setting up or accessing your monitor and do not know why, enable debug mode to turn on error reporting.
To enable debug mode, add the following line to your config.php file:
define('PSM_DEBUG', true);

View File

@ -7,12 +7,21 @@ help:
export: export:
@echo 'Building release for tag $(tag) ' @echo 'Building release for tag $(tag) '
mkdir -p ./build ./build/phpservermon mkdir -p ./build ./build/phpservermon
rm -rf ./build/phpservermon/*
git archive $(tag) | tar -xf - -C ./build/phpservermon/ git archive $(tag) | tar -xf - -C ./build/phpservermon/
@echo 'Testing on syntax errors (thats all the automated testing your are going to get for now..) ' @echo 'Testing on syntax errors (thats all the automated testing your are going to get for now..) '
find ./build/phpservermon -name "*.php" | xargs -I file php -l file find ./build/phpservermon -name "*.php" | xargs -I file php -l file
find ./build/phpservermon -name "*.php" -exec sed -i "" "s/@package_version@/$(tag)/" {} \; find ./build/phpservermon -name "*.php" -exec sed -i "" "s/@package_version@/$(tag)/" {} \;
@echo 'Building HTML documentation'
cd ./build/phpservermon/docs; make BUILDDIR=. html; cd ../../../;
@echo 'Cleaning up docs dir'
rm -f ./build/phpservermon/docs/Makefile
rm -f ./build/phpservermon/docs/make.bat
rm -f ./build/phpservermon/docs/conf.py
@echo 'Setting folder and file permissions'
find ./build/phpservermon -type f | xargs chmod 0644 find ./build/phpservermon -type f | xargs chmod 0644
find ./build/phpservermon -type d | xargs chmod 0755 find ./build/phpservermon -type d | xargs chmod 0755
@echo 'Creating archives'
cd ./build; zip -rq phpservermon-$(tag).zip ./phpservermon; cd ../; cd ./build; zip -rq phpservermon-$(tag).zip ./phpservermon; cd ../;
cd ./build; tar -pczf phpservermon-$(tag).tar.gz ./phpservermon; cd ../; cd ./build; tar -pczf phpservermon-$(tag).tar.gz ./phpservermon; cd ../;
rm -rf ./build/phpservermon rm -rf ./build/phpservermon

View File

@ -1,4 +1,5 @@
# PHP Server Monitor PHP Server Monitor
==================
Version 3.1.0-dev Version 3.1.0-dev
@ -6,7 +7,9 @@ PHP Server Monitor is a script that checks whether your websites and servers are
It comes with a web based user interface where you can manage your services and websites, It comes with a web based user interface where you can manage your services and websites,
and you can manage users for each server with a mobile number and email address. and you can manage users for each server with a mobile number and email address.
Features: Features:
---------
* Monitor services and websites (see below). * Monitor services and websites (see below).
* Email and SMS notifications. * Email and SMS notifications.
@ -45,52 +48,36 @@ The following SMS gateways are currently available:
Please note: for these gateways you will need an account with sufficient credits. Please note: for these gateways you will need an account with sufficient credits.
## Download Download
--------
The latest version can be downloaded from <http://www.phpservermonitor.org/>. The latest version can be downloaded from http://www.phpservermonitor.org/.
## Requirements Requirements
------------
* Web server
* MySQL database
* PHP 5.3.7+ * PHP 5.3.7+
* PHP cURL package * PHP cURL package
* PHP PDO mysql driver * PHP PDO mysql driver
## Install Install
-------
See INSTALL.md file. Please see docs/install.rst.
In a nutshell: unzip, upload, run install.php, enjoy.
## Contributing Documentation
-------------
The code is available from <https://github.com/phpservermon/phpservermon>. The documentation is available in the docs folder or http://docs.phpservermonitor.org.
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.
### Changing the email or text message License
-------
Go to the folder "src/lang", open the language file that corresponds to the selected language
(default is English ("en_US.lang.php")). Scroll all the way to the bottom until you spot this line:
'notifications' => array(
After that you will see the lines that hold the notification messages. For example:
'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
* %ERROR% This one only works for the off_* messages and contains the error returned by the monitor
## License
PHP Server Monitor is free software: you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -103,4 +90,4 @@ The second part is the actual message. There are a few variables you can use in
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with PHP Server Monitor. If not, see <http://www.gnu.org/licenses/>. along with PHP Server Monitor. If not, see http://www.gnu.org/licenses/.

View File

@ -31,7 +31,7 @@ import os
extensions = [] extensions = []
# Add any paths that contain templates here, relative to this directory. # Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates'] templates_path = []
# The suffix of source filenames. # The suffix of source filenames.
source_suffix = '.rst' source_suffix = '.rst'
@ -84,6 +84,9 @@ exclude_patterns = ['_build', 'html', 'doctrees']
# output. They are ignored by default. # output. They are ignored by default.
#show_authors = False #show_authors = False
# Default highlighting language
highlight_language = 'php'
# The name of the Pygments (syntax highlighting) style to use. # The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx' pygments_style = 'sphinx'
@ -127,7 +130,7 @@ html_theme = 'default'
# Add any paths that contain custom static files (such as style sheets) here, # Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files, # relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css". # so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static'] html_static_path = []
# Add any extra paths that contain custom files (such as robots.txt or # Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied # .htaccess) here, relative to this directory. These files are copied

View File

@ -11,12 +11,12 @@ The following people have contributed to the development of phpservermon:
* Pepijn Over <pep\_at\_neanderthal-technology.com> * Pepijn Over <pep\_at\_neanderthal-technology.com>
* creator and project maintainer * Creator and project maintainer
* Jérôme Cabanis * Jérôme Cabanis
* History graphs * History graphs
* Date localisation * Date localization
* Mobile compatibility * Mobile compatibility
* Various fixes and improvements * Various fixes and improvements
@ -38,10 +38,15 @@ The following people have contributed to the development of phpservermon:
* Mosms SMS gateway * Mosms SMS gateway
* Paul Feakins
* Website pattern / regular expression search
Translators Translators
+++++++++++ +++++++++++
The following people have contributed to the translation of phpservermon: The following people have contributed to the translation of PHP Server Monitor:
* German * German
@ -68,8 +73,8 @@ The following people have contributed to the translation of phpservermon:
Vendors Vendors
+++++++++ +++++++++
The following libraries are being used by phpservermon: The following libraries are being used by PHP Server Monitor:
* jqPlot <http://www.jqplot.com> * jqPlot - http://www.jqplot.com
* Twitter Bootstrap <http://getbootstrap.com> * Twitter Bootstrap - http://getbootstrap.com
* PHP Mailer - Brent R. Matzelle * PHP Mailer - https://github.com/PHPMailer/PHPMailer

11
docs/developers.rst Normal file
View File

@ -0,0 +1,11 @@
.. _developers:
Developers
==========
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.
More information can be found in the wiki at https://github.com/phpservermon/phpservermon/wiki.

27
docs/faq.rst Normal file
View File

@ -0,0 +1,27 @@
.. _faq:
Frequently Asked Questions
==========================
Configuration
+++++++++++++
How can I change the text of the email / SMS?
---------------------------------------------
Go to the folder "src/lang", open the language file that corresponds to the selected language
(default is English ("en_US.lang.php")). Scroll all the way to the bottom until you spot this line::
'notifications' => array(
After that you will see the lines that hold the notification messages. For example::
'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
* %ERROR% - This one only works for the off_* messages and contains the error returned by the monitor

View File

@ -4,7 +4,7 @@
contain the root `toctree` directive. contain the root `toctree` directive.
Welcome to the PHP Server Monitor documentation! Welcome to the PHP Server Monitor documentation!
======================================== ================================================
Contents: Contents:
@ -14,6 +14,8 @@ Contents:
intro intro
requirements requirements
install install
faq
developers
credits credits
copyright copyright

View File

@ -21,6 +21,7 @@ Features
* Logs of connection errors, outgoing emails and text messages. * Logs of connection errors, outgoing emails and text messages.
* Easy cronjob implementation to automatically check your servers. * Easy cronjob implementation to automatically check your servers.
Servers Servers
------- -------
There are two different ways to monitor a server: There are two different ways to monitor a server:
@ -39,6 +40,7 @@ There are two different ways to monitor a server:
If the regular expression returns no matches, the website is considered down. If the regular expression returns no matches, the website is considered down.
In both cases the script will return a "status offline", and will start sending out notifications. In both cases the script will return a "status offline", and will start sending out notifications.
Notifications Notifications
------------- -------------
Each server has its own settings regarding notification. Each server has its own settings regarding notification.