diff --git a/README.rst b/README.rst
index 832f23e3..26e51041 100644
--- a/README.rst
+++ b/README.rst
@@ -5,7 +5,7 @@ PHP Server Monitor
:alt: Join the chat at https://gitter.im/erickrf/nlpnet
:target: https://gitter.im/phpservermon/phpservermon
-Version 3.5.2
+Version 3.6.0.beta2
PHP Server Monitor is a script that checks whether your websites and servers are up and running.
It comes with a web based user interface where you can manage your services and websites,
@@ -16,7 +16,7 @@ Features:
---------
* Monitor services and websites (see below).
-* Email, SMS, Pushover, Telegram and Jabber notifications.
+* Email, SMS, Discord, Pushover, Telegram and Jabber 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.
diff --git a/docs/conf.py b/docs/conf.py
index 13b77a40..826a5acf 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -51,9 +51,9 @@ copyright = u'2008-2017, Pepijn Over'
# built documents.
#
# The short X.Y version.
-version = '3.5'
+version = '3.6'
# The full version, including alpha/beta/rc tags.
-release = '3.5.2'
+release = '3.6.0.beta2'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
diff --git a/docs/credits.rst b/docs/credits.rst
index e1c89471..83ee5bf7 100644
--- a/docs/credits.rst
+++ b/docs/credits.rst
@@ -89,6 +89,10 @@ The following people have contributed to the development of PHP Server Monitor:
* SMSAPI gateway
+* Daniel Krusky - https://github.com/dkrusky
+
+ * Discord webhook support
+
Translators
+++++++++++
@@ -196,4 +200,4 @@ The following libraries are being used by PHP Server Monitor:
* PHP-Pushover - https://github.com/kryap/php-pushover
* Symfony - https://symfony.com
* Random_compat - https://github.com/paragonie/random_compat
-* Hammer.js - https://github.com/hammerjs/hammer.js
\ No newline at end of file
+* Hammer.js - https://github.com/hammerjs/hammer.js
diff --git a/src/includes/psmconfig.inc.php b/src/includes/psmconfig.inc.php
index 25d33fb8..862ccda4 100644
--- a/src/includes/psmconfig.inc.php
+++ b/src/includes/psmconfig.inc.php
@@ -30,7 +30,7 @@
/**
* Current PSM version
*/
-define('PSM_VERSION', '3.6.0.beta1');
+define('PSM_VERSION', '3.6.0.beta2');
/**
* URL to check for updates. Will not be checked if turned off on config page.
diff --git a/src/lang/en_US.lang.php b/src/lang/en_US.lang.php
index acec4425..e6c412e7 100644
--- a/src/lang/en_US.lang.php
+++ b/src/lang/en_US.lang.php
@@ -50,9 +50,7 @@ $sm_lang = array(
'no' => 'No',
'insert' => 'Insert',
'add_new' => 'Add new',
- 'update_available' => 'A new version ({version}) is available. Click here to download the update.',
+ 'update_available' => 'A new version ({version}) is available. Click here to download the update.',
'back_to_top' => 'Back to top',
'go_back' => 'Go back',
'ok' => 'OK',
@@ -108,31 +106,25 @@ $sm_lang = array(
'level' => 'Level',
'level_10' => 'Administrator',
'level_20' => 'User',
- 'level_description' => 'Administrators have full access: they can manage servers, users and edit the
- global configuration.
Users can only view and run the updater for the
- servers that have been assigned to them.',
+ 'level_description' => 'Administrators have full access: they can manage servers, users and edit the global configuration.
Users can only view and run the updater for the servers that have been assigned to them.',
'mobile' => 'Mobile',
'email' => 'Email',
'pushover' => 'Pushover',
- 'pushover_description' => 'Pushover is a service that makes it easy to get real-time notifications. See their website for more info.',
+ 'pushover_description' => 'Pushover is a service that makes it easy to get real-time notifications. See their website for more info.',
'pushover_key' => 'Pushover Key',
'pushover_device' => 'Pushover Device',
'pushover_device_description' => 'Device name to send the message to. Leave empty to send it to all devices.',
+ 'discord' => 'Discord',
+ 'discord_label' => 'Discord',
+ 'discord_description' => 'Put your webhook here.',
'telegram' => 'Telegram',
- 'telegram_description' => 'Telegram is a chat app that
- makes it easy to get real-time notifications. Visit the documentation for more
- info and an install guide.',
+ 'telegram_description' => 'Telegram is a chat app that makes it easy to get real-time notifications. Visit the documentation for more info and an install guide.',
'telegram_chat_id' => 'Telegram chat id',
'telegram_chat_id_description' => 'The message will be send to the corresponding chat.',
'telegram_get_chat_id' => 'Click here to get your chat id',
'activate_telegram' => 'Activate Telegram notifications',
- 'activate_telegram_description' => 'Allow Telegram notifications to be sent to the specified chat id. Without
- this permission, Telegram doesn\'t allow us to send notifications to you.',
- 'telegram_bot_username_found' => 'The bot was found!
This will open a chat
- with the bot. Here you need to press start or type /start.',
+ 'activate_telegram_description' => 'Allow Telegram notifications to be sent to the specified chat id. Without this permission, Telegram doesn\'t allow us to send notifications to you.',
+ 'telegram_bot_username_found' => 'The bot was found!
This will open a chat with the bot. Here you need to press start or type /start.',
'telegram_bot_username_error_token' => '401 - Unauthorized. Please make sure that the API token is valid.',
'telegram_bot_error' => 'An error has occurred while activating Telegram notification: %s',
'jabber' => 'Jabber',
@@ -153,8 +145,7 @@ $sm_lang = array(
'profile' => 'Profile',
'profile_updated' => 'Your profile has been updated.',
'error_user_name_bad_length' => 'Usernames must be between 2 and 64 characters.',
- 'error_user_name_invalid' => 'The username may only contain alphabetic characters (a-z, A-Z), digits (0-9),
- dots (.) and underscores (_).',
+ 'error_user_name_invalid' => 'The username may only contain alphabetic characters (a-z, A-Z), digits (0-9), dots (.) and underscores (_).',
'error_user_name_exists' => 'The given username already exists in the database.',
'error_user_email_bad_length' => 'Email addresses must be between 5 and 255 characters.',
'error_user_email_invalid' => 'The email address is invalid.',
@@ -170,6 +161,7 @@ $sm_lang = array(
'status' => 'Status',
'email' => 'Email',
'sms' => 'SMS',
+ 'discord' => 'Discord',
'pushover' => 'Pushover',
'webhook' => 'Webhook',
'telegram' => 'Telegram',
@@ -209,17 +201,13 @@ $sm_lang = array(
'type_service' => 'Service',
'type_ping' => 'Ping',
'pattern' => 'Search string/pattern',
- 'pattern_description' => 'If this pattern is not found on the website, the server will be marked
- online/offline. Regular expressions are allowed.',
+ 'pattern_description' => 'If this pattern is not found on the website, the server will be marked online/offline. Regular expressions are allowed.',
'pattern_online' => 'Pattern indicates website is',
- 'pattern_online_description' => 'Online: If this pattern was found on the website, the server will be marked
- online. Offline: If this pattern was not found on the website, the server
- will be marked offline.',
+ 'pattern_online_description' => 'Online: If this pattern was found on the website, the server will be marked online. Offline: If this pattern was not found on the website, the server will be marked offline.',
'redirect_check' => 'Redirecting to another domain is',
'redirect_check_description' => 'Redirect to another domain is usually a bad sign.',
'allow_http_status' => 'Allow HTTP status code',
- 'allow_http_status_description' => 'Mark website as online. HTTP Status codes lower then 400 are marked as
- online by default. Seperate with |.',
+ 'allow_http_status_description' => 'Mark website as online. HTTP Status codes lower then 400 are marked as online by default. Seperate with |.',
'header_name' => 'Header name',
'header_value' => 'Header value',
'header_name_description' => 'Case-sensitive.',
@@ -237,6 +225,8 @@ $sm_lang = array(
'send_email' => 'Send Email',
'sms' => 'SMS',
'send_sms' => 'Send SMS',
+ 'discord' => 'Discord',
+ 'send_discord' => 'Send Discord notification',
'webhook' => 'Webhook',
'send_webhook' => 'Send Webhook notification',
'pushover' => 'Pushover',
@@ -266,8 +256,7 @@ $sm_lang = array(
'warning_threshold' => 'Warning threshold',
'warning_threshold_description' => 'Number of failed checks required before it is marked offline.',
'ssl_cert_expiry_days' => 'SSL Certificate Validity',
- 'ssl_cert_expiry_days_description' => 'The minimum remaining days the SSL certificate is still valid. Use 0 to
- disable check.',
+ 'ssl_cert_expiry_days_description' => 'The minimum remaining days the SSL certificate is still valid. Use 0 to disable check.',
'ssl_cert_expired' => 'SSL certificate expired since',
'ssl_cert_expiring' => 'SSL certificate expiring:',
'chart_last_week' => 'Last week',
@@ -278,6 +267,7 @@ $sm_lang = array(
'chart_short_time_format' => '%H:%M',
'warning_notifications_disabled_sms' => 'SMS notifications are disabled.',
'warning_notifications_disabled_email' => 'Email notifications are disabled.',
+ 'warning_notifications_disabled_discord' => 'Discord notifications are disabled.',
'warning_notifications_disabled_webhook' => 'Webhook notifications are disabled.',
'warning_notifications_disabled_pushover' => 'Pushover notifications are disabled.',
'warning_notifications_disabled_telegram' => 'Telegram notifications are disabled.',
@@ -289,8 +279,7 @@ $sm_lang = array(
'error_server_ip_bad_website' => 'The website URL is not valid.',
'error_server_type_invalid' => 'The selected server type is invalid.',
'error_server_warning_threshold_invalid' => 'The warning threshold must be a valid integer greater than 0.',
- 'error_server_ssl_cert_expiry_days' => 'The remaining days for SSL certificate validity must be a valid
- integer greater than or equal to 0.',
+ 'error_server_ssl_cert_expiry_days' => 'The remaining days for SSL certificate validity must be a valid integer greater than or equal to 0.',
),
'config' => array(
'general' => 'General',
@@ -298,8 +287,7 @@ $sm_lang = array(
'language' => 'Language',
'show_update' => 'Check for updates?',
'password_encrypt_key' => 'The encryption key password',
- 'password_encrypt_key_note' => 'This key is used to encrypt passwords that are stored on servers for access to
- websites. If the key will change the stored password is invalid!',
+ 'password_encrypt_key_note' => 'This key is used to encrypt passwords that are stored on servers for access to websites. If the key will change the stored password is invalid!',
'proxy' => 'Enable proxy',
'proxy_url' => 'Proxy URL',
'proxy_user' => 'Proxy username',
@@ -320,6 +308,8 @@ $sm_lang = array(
'sms_gateway_username' => 'Gateway username',
'sms_gateway_password' => 'Gateway password',
'sms_from' => 'Sender\'s phone number',
+ 'discord_status' => 'Allow sending Discord messages',
+ 'discord_description' => 'Discord is a service that makes it easy to get real-time notifications. See their website for more info.',
'webhook_status' => 'Allow sending webhooks',
'webhook_description' => 'Allow sending webhooks to services like slack. The message payload end endpoint are defined in the profile settings.',
'webhook_url' => 'Webhook Url',
@@ -327,26 +317,16 @@ $sm_lang = array(
'webhook_json' => 'Webhook Json',
'webhook_json_description' => 'Customized Json, use #message as message variable.',
'pushover_status' => 'Allow sending Pushover messages',
- 'pushover_description' => 'Pushover is a service that makes it easy to get real-time notifications. See their website for more info.',
+ 'pushover_description' => 'Pushover is a service that makes it easy to get real-time notifications. See their website for more info.',
'pushover_clone_app' => 'Click here to create your Pushover app',
'pushover_api_token' => 'Pushover App API Token',
- 'pushover_api_token_description' => 'Before you can use Pushover, you need to register an App at their website and enter the App API
- Token here.',
+ 'pushover_api_token_description' => 'Before you can use Pushover, you need to register an App at their website and enter the App API Token here.',
'telegram_status' => 'Allow sending Telegram messages',
- 'telegram_description' => 'Telegram is a chat app that
- makes it easy to get real-time notifications. Visit the documentation for more
- info and an install guide.',
+ 'telegram_description' => 'Telegram is a chat app that makes it easy to get real-time notifications. Visit the documentation for more info and an install guide.',
'telegram_api_token' => 'Telegram API Token',
- 'telegram_api_token_description' => 'Before you can use Telegram, you need to get a API token. Visit the documentation for help.',
+ 'telegram_api_token_description' => 'Before you can use Telegram, you need to get a API token. Visit the documentation for help.',
'jabber_status' => 'Allow sending Jabber (XMPP) messages',
- 'jabber_description' => 'Visit the documentation for more info and an
- install guide.',
+ 'jabber_description' => 'Visit the documentation for more info and an install guide.',
'jabber_host' => 'Host',
'jabber_host_description' => 'Host of your Jabber account provider. For Google Account use talk.google.com.',
'jabber_port' => 'Port',
@@ -359,26 +339,19 @@ $sm_lang = array(
'jabber_password_description' => 'Fill only to set or change.',
'jabber_check' => 'Check your Jabber account if message was received.',
'alert_type' => 'Select when you\'d like to be notified.',
- 'alert_type_description' => 'Status change: You will receive a notification when a server has a change
- in status. So from online -> offline or offline -> online.
Offline:
- You will receive a notification when a server goes offline for the *FIRST TIME
- ONLY*. For example, your cronjob is every 15 minutes and your server goes down at
- 1 am and stays down till 6 am. You will get 1 notification at 1 am and that\'s
- it.
Always: You will receive a notification every time the script
- runs and a site is down, even if the site has been offline for hours.',
+ 'alert_type_description' => 'Status change: You will receive a notification when a server has a change in status. So from online -> offline or offline -> online.
Offline: You will receive a notification when a server goes offline for the *FIRST TIME ONLY*. For example, your cronjob is every 15 minutes and your server goes down at 1 am and stays down till 6 am. You will get 1 notification at 1 am and that\'s it.
Always: You will receive a notification every time the script runs and a site is down, even if the site has been offline for hours.',
'alert_type_status' => 'Status change',
'alert_type_offline' => 'Offline',
'alert_type_always' => 'Always',
'combine_notifications' => 'Combine notifications',
- 'combine_notifications_description' => 'Reduces the amount of notification by combining the notifications into
- 1 single notification. (This does not affect SMS notifications.)',
+ 'combine_notifications_description' => 'Reduces the amount of notification by combining the notifications into 1 single notification. (This does not affect SMS notifications.)',
'alert_proxy' => 'Even if enabled, proxy is never used for services',
'alert_proxy_url' => 'Format: host:port',
'log_status' => 'Log status',
- 'log_status_description' => 'If log status is set to TRUE, the monitor will log the event whenever the
- notification settings are passed.',
+ 'log_status_description' => 'If log status is set to TRUE, the monitor will log the event whenever the notification settings are passed.',
'log_email' => 'Log emails sent by the script',
'log_sms' => 'Log text messages sent by the script',
+ 'log_discord' => 'Log Discord messages sent by the script',
'log_pushover' => 'Log pushover messages sent by the script',
'log_webhook' => 'Log webhook messages sent by the script',
'log_telegram' => 'Log Telegram messages sent by the script',
@@ -386,12 +359,14 @@ $sm_lang = array(
'updated' => 'The configuration has been updated.',
'tab_email' => 'Email',
'tab_sms' => 'SMS',
+ 'tab_discord' => 'Discord',
'tab_pushover' => 'Pushover',
'tab_webhook' => 'Webhook',
'tab_telegram' => 'Telegram',
'tab_jabber' => 'Jabber',
'settings_email' => 'Email settings',
'settings_sms' => 'Text message settings',
+ 'settings_discord' => 'Discord settings',
'settings_pushover' => 'Pushover settings',
'settings_webhook' => 'Webhook settings',
'settings_telegram' => 'Telegram settings',
@@ -400,11 +375,12 @@ $sm_lang = array(
'settings_log' => 'Log settings',
'settings_proxy' => 'Proxy settings',
'auto_refresh' => 'Auto-refresh',
- 'auto_refresh_description' => 'Auto-refresh servers page.
Time in seconds, if 0 the
- page won\'t refresh.',
+ 'auto_refresh_description' => 'Auto-refresh servers page.
Time in seconds, if 0 the page won\'t refresh.',
'test' => 'Test',
'test_email' => 'An email will be sent to the address specified in your user profile.',
'test_sms' => 'An SMS will be sent to the phone number specified in your user profile.',
+ 'test_discord' => 'A Discord notification will be sent to the webhook specified in your user profile.',
+ 'test_pushover' => 'A Pushover notification will be sent to the user key/device specified in your user profile.',
'test_pushover' => 'A Pushover notification will be sent to the user key/device specified in your user
profile.',
'test_webhook' => 'A webhook notification will be sent to the given url endpoint.',
@@ -418,28 +394,27 @@ $sm_lang = array(
'sms_sent' => 'SMS sent',
'sms_error' => 'An error has occurred while sending the SMS: %s',
'sms_error_nomobile' => 'Unable to send test SMS: no valid phone number found in your profile.',
+ 'discord_sent' => 'Discord notification sent',
+ 'discord_error' => 'An error has occurred while sending the Discord notification: %s',
+ 'discord_error_nowebhook' => 'Unable to send test Discord notification: no valid Discord webhook found in your user profile.',
'webhook_sent' => 'Webhook notification sent',
'webhook_error' => 'An error has occurred while sending the webhook notification: %s',
'webhook_error_nourl' => 'Unable to send test notification: no url found in user profile.',
'webhook_error_nojson' => 'Unable to send test notification: no json found in user profile.',
'pushover_sent' => 'Pushover notification sent',
'pushover_error' => 'An error has occurred while sending the Pushover notification: %s',
- 'pushover_error_noapp' => 'Unable to send test notification: no Pushover App API token found in the global
- configuration.',
+ 'pushover_error_noapp' => 'Unable to send test notification: no Pushover App API token found in the global configuration.',
'pushover_error_nokey' => 'Unable to send test notification: no Pushover key found in your profile.',
'telegram_sent' => 'Telegram notification sent',
'telegram_error' => 'An error has occurred while sending the Telegram notification: %s',
- 'telegram_error_notoken' => 'Unable to send test notification: no Telegram API token found in the global
- configuration.',
+ 'telegram_error_notoken' => 'Unable to send test notification: no Telegram API token found in the global configuration.',
'telegram_error_noid' => 'Unable to send test notification: no chat id found in your profile.',
'jabber_sent' => 'Telegram notification sent',
'jabber_error' => 'An error has occurred while sending the Telegram notification: %s',
- 'jabber_error_noconfig' => 'Unable to send test notification: no Jabber account set in the global
- configuration.',
+ 'jabber_error_noconfig' => 'Unable to send test notification: no Jabber account set in the global configuration.',
'jabber_error_noaccount' => 'Unable to send test notification: no Jabber account found in your profile.',
'log_retention_period' => 'Log retention period',
- 'log_retention_period_description' => 'Number of days to keep logs of notifications and archives of server
- uptime. Enter 0 to disable log cleanup.',
+ 'log_retention_period_description' => 'Number of days to keep logs of notifications and archives of server uptime. Enter 0 to disable log cleanup.',
'log_retention_days' => 'days',
'user_agent' => 'User Agent',
'user_agent_key_note' => 'Custom user agent used by monitor within communication with external services.',
@@ -447,23 +422,24 @@ $sm_lang = array(
'notifications' => array(
'off_sms' => 'Server \'%LABEL%\' is DOWN: ip=%IP%, port=%PORT%. Error=%ERROR%',
'off_email_subject' => 'IMPORTANT: Server \'%LABEL%\' is DOWN',
+ 'off_email_body' => 'Failed to connect to the following server:
Server: %LABEL%
IP: %IP%
Port: %PORT%
Error: %ERROR%
Date: %DATE%',
+ 'off_discord_message' => 'Failed to connect to the following server:
Server: %LABEL%
IP: %IP%
Port: %PORT%
Error: %ERROR%
Date: %DATE%',
'off_email_body' => 'Failed to connect to the following server:
Server: %LABEL%
IP: %IP%
Port:
%PORT%
Error: %ERROR%
Date: %DATE%',
'off_webhook_title' => 'Server \'%LABEL%\' is DOWN',
'off_webhook_message' => 'Failed to connect to the following server:
Server: %LABEL%
IP:
%IP%
Port: %PORT%
Error: %ERROR%
Date: %DATE%',
'off_pushover_title' => 'Server \'%LABEL%\' is DOWN',
- 'off_pushover_message' => 'Failed to connect to the following server:
Server: %LABEL%
IP:
- %IP%
Port: %PORT%
Error: %ERROR%
Date: %DATE%',
- 'off_telegram_message' => 'Failed to connect to the following server:
Server: %LABEL%
IP:
- %IP%
Port: %PORT%
Error: %ERROR%
Date: %DATE%',
- 'off_jabber_message' => 'Failed to connect to the following server:
Server: %LABEL%
IP:
- %IP%
Port: %PORT%
Error: %ERROR%
Date: %DATE%',
+ 'off_pushover_message' => 'Failed to connect to the following server:
Server: %LABEL%
IP: %IP%
Port: %PORT%
Error: %ERROR%
Date: %DATE%',
+ 'off_telegram_message' => 'Failed to connect to the following server:
Server: %LABEL%
IP: %IP%
Port: %PORT%
Error: %ERROR%
Date: %DATE%',
+ 'off_jabber_message' => 'Failed to connect to the following server:
Server: %LABEL%
IP: %IP%
Port: %PORT%
Error: %ERROR%
Date: %DATE%',
'on_sms' => 'Server \'%LABEL%\' is RUNNING: ip=%IP%, port=%PORT%, it was down for %LAST_OFFLINE_DURATION%',
'on_email_subject' => 'IMPORTANT: Server \'%LABEL%\' is RUNNING',
'on_email_body' => 'Server \'%LABEL%\' is running again, it was down for
%LAST_OFFLINE_DURATION%:
Server: %LABEL%
IP: %IP%
Port: %PORT%
Date:
%DATE%',
+ 'on_discord_message' => 'Server \'%LABEL%\' is running again, it was down for:
+ %LAST_OFFLINE_DURATION%
Server: %LABEL%
IP: %IP%
Port: %PORT%
Date: %DATE%',
'on_webhook_title' => 'Server \'%LABEL%\' is RUNNING',
'on_webhook_message' => 'Server \'%LABEL%\' is running again, it was down for
%LAST_OFFLINE_DURATION%:
Server: %LABEL%
IP: %IP%
Port: %PORT%
Date:
@@ -480,6 +456,8 @@ $sm_lang = array(
%DATE%',
'combi_off_email_message' => '