issue #101: finishing pushover implementation

This commit is contained in:
Pepijn Over 2014-07-31 12:11:32 +02:00
parent 6b4668937d
commit c589424bce
36 changed files with 308 additions and 681 deletions

9
composer.json Normal file → Executable file
View File

@ -2,9 +2,16 @@
"name": "phpservermon/phpservermon",
"description": "PHP Server Monitor",
"homepage": "http://www.phpservermonitor.org",
"repositories": [
{
"type": "vcs",
"url": "https://github.com/phpservermon/php-pushover"
}
],
"require": {
"php": ">=5.3.7",
"phpmailer/phpmailer": "5.2.6",
"symfony/http-foundation": "2.4.*"
"symfony/http-foundation": "2.4.*",
"php-pushover/php-pushover": "dev-master"
}
}

44
composer.lock generated
View File

@ -3,8 +3,34 @@
"This file locks the dependencies of your project to a known state",
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file"
],
"hash": "63c9618391ed04b38b098c0139b50570",
"hash": "6a941e5369d421e16d869151569bc5c7",
"packages": [
{
"name": "php-pushover/php-pushover",
"version": "dev-master",
"source": {
"type": "git",
"url": "https://github.com/phpservermon/php-pushover.git",
"reference": "d13d08dbf5f1cfa73f4adca7e8d27f79c804dd7b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpservermon/php-pushover/zipball/d13d08dbf5f1cfa73f4adca7e8d27f79c804dd7b",
"reference": "d13d08dbf5f1cfa73f4adca7e8d27f79c804dd7b",
"shasum": ""
},
"type": "library",
"autoload": {
"files": [
"Pushover.php"
]
},
"description": "PHP class for the Pushover.net project",
"support": {
"source": "https://github.com/phpservermon/php-pushover/tree/master"
},
"time": "2014-07-30 13:55:53"
},
{
"name": "phpmailer/phpmailer",
"version": "v5.2.6",
@ -60,17 +86,17 @@
},
{
"name": "symfony/http-foundation",
"version": "v2.4.3",
"version": "v2.4.8",
"target-dir": "Symfony/Component/HttpFoundation",
"source": {
"type": "git",
"url": "https://github.com/symfony/HttpFoundation.git",
"reference": "11ad7352c7bfa12145a0df8e1c4c303c585ce169"
"reference": "68abe34601c519359b60363b99c29ecfb6679bc4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/11ad7352c7bfa12145a0df8e1c4c303c585ce169",
"reference": "11ad7352c7bfa12145a0df8e1c4c303c585ce169",
"url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/68abe34601c519359b60363b99c29ecfb6679bc4",
"reference": "68abe34601c519359b60363b99c29ecfb6679bc4",
"shasum": ""
},
"require": {
@ -111,7 +137,7 @@
],
"description": "Symfony HttpFoundation Component",
"homepage": "http://symfony.com",
"time": "2014-03-26 11:35:33"
"time": "2014-07-15 14:07:10"
}
],
"packages-dev": [
@ -121,9 +147,9 @@
],
"minimum-stability": "stable",
"stability-flags": [
],
"stability-flags": {
"php-pushover/php-pushover": 20
},
"platform": {
"php": ">=5.3.7"
},

View File

@ -414,13 +414,12 @@ function psm_build_mail($from_name = null, $from_email = null) {
}
/**
* Prepare a new Pushover util.
*
* @return \psm\Util\Pushover
* @return \Pushover
*/
function psm_build_pushover() {
$pushover = new \psm\Util\Pushover();
$pushover = new \Pushover();
$pushover->setToken(psm_get_conf('pushover_api_token'));
return $pushover;

View File

@ -81,6 +81,9 @@ $sm_lang = array(
'level_description' => '<b>Администраторите</b> имат пълен достъп: могат да управляват сървърите, потребителите и да редактират глобалните настройки.<br/><b>Потребителите</b> могат само да виждат статуса на сървърите и да обнояват информацията за даден сървър, за който им е разрешен достъп.',
'mobile' => 'Мобилен телефон',
'email' => 'Имейл',
'pushover' => 'Pushover',
'pushover_key' => 'Pushover Key',
'pushover_device' => 'Pushover Device',
'delete_title' => 'Изтриване на потребител',
'delete_message' => 'Сигурни ли сте, че искате да изтриете потребител \'%1\'?',
'deleted' => 'Потребителят е изтрит успешно.',
@ -104,6 +107,7 @@ $sm_lang = array(
'status' => 'Статус',
'email' => 'Имейл',
'sms' => 'SMS',
'pushover' => 'Pushover',
'no_logs' => 'Няма налични логове',
),
'servers' => array(
@ -127,6 +131,7 @@ $sm_lang = array(
'send_email' => 'Имейл',
'sms' => 'SMS',
'send_sms' => 'SMS',
'pushover' => 'Pushover',
'users' => 'Users',
'delete_title' => 'Изтриване на сървър',
'delete_message' => 'Сигурни ли сте, че искате да изтриете сървър \'%1\'?',
@ -186,6 +191,8 @@ $sm_lang = array(
'sms_gateway_username' => 'Потребител',
'sms_gateway_password' => 'Парола',
'sms_from' => 'Номер на изпращача',
'pushover_status' => 'Allow sending pushover messages',
'pushover_api_token' => 'Pushover App API Token',
'alert_type' => 'Изберете кога желаете да получавате известия<br/>',
'alert_type_description' => '<b>Промяна на сатуса:</b><br>'.
'Ще получавате известие когато има промяна със връзката на даден някой от описаните сървър или сайт. От Онлайн -> Офлайн и от Офлайн -> Онлайн.<br/>'.
@ -194,8 +201,7 @@ $sm_lang = array(
'вашия cron скрипт проверява всеки 15 минути и връзката до сървъра е изгубена в 1 часа през нощта и не работи до 6 часа сутринта '.
'Вие ще получите едно известие в 1 часа за това<br/>'.
'<br><b>Винаги:</b><br> '.
'Ще получавате известие при всяка проверка на Вашия крон скрипт дори когато връзката до даден сървър или сайт е била'.
'прекъсната в продължение на часове.',
'Ще получавате известие при всяка проверка на Вашия крон скрипт дори когато връзката до даден сървър или сайт е била прекъсната в продължение на часове.',
'alert_type_status' => 'Промяна на статуса',
'alert_type_offline' => 'Офлайн',
'alert_type_always' => 'Винаги',
@ -203,13 +209,15 @@ $sm_lang = array(
'log_status_description' => 'Ако е отметнато, системата ще записва всяка промяна.',
'log_email' => 'Да се пази ли лог на изпратените имейли от системата',
'log_sms' => 'Да се пази ли лог на изпратените SMS съобщения от системата',
'log_pushover' => 'Log pushover messages sent by the script',
'updated' => 'Настройките са обновени успешно.',
'nochanges' => 'Не бяха направени промени!',
'tab_email' => 'Имейл',
'tab_sms' => 'SMS',
'tab_log' => 'Логове',
'tab_pushover' => 'Pushover',
'settings_email' => 'Имейл настройки',
'settings_sms' => 'SMS настройки',
'settings_pushover' => 'Pushover settings',
'settings_notification' => 'Настройки на известията',
'settings_log' => 'Настройки на логовете',
'auto_refresh' => 'Автоматично опресняване',
@ -235,9 +243,13 @@ $sm_lang = array(
'off_sms' => 'Сървър \'%LABEL%\' е Офлайн: ip=%IP%, port=%PORT%. Greshka=%ERROR%',
'off_email_subject' => 'Връзката до \'%LABEL%\' е ИЗГУБЕНА',
'off_email_body' => "Неуспешно свързване:<br/><br/>Сървър: %LABEL%<br/>IP адрес: %IP%<br/>Порт: %PORT%<br/>Грешка: %ERROR%<br/>Днес: %DATE%",
'off_pushover_title' => 'Връзката до \'%LABEL%\' е ИЗГУБЕНА',
'off_pushover_message' => "Неуспешно свързване:<br/><br/>Сървър: %LABEL%<br/>IP адрес: %IP%<br/>Порт: %PORT%<br/>Грешка: %ERROR%<br/>Днес: %DATE%",
'on_sms' => 'Сървър \'%LABEL%\' е Онлайн: ip=%IP%, port=%PORT%',
'on_email_subject' => 'Връзката до \'%LABEL%\' е ВЪЗСТАНОВЕНА',
'on_email_body' => "Връзката до '%LABEL%' беше ВЪЗСТАНОВЕНА:<br/><br/>Сървър: %LABEL%<br/>IP адрес: %IP%<br/>Порт: %PORT%<br/>Днес: %DATE%",
'on_pushover_title' => 'Връзката до \'%LABEL%\' е ВЪЗСТАНОВЕНА',
'on_pushover_message' => "Връзката до '%LABEL%' беше ВЪЗСТАНОВЕНА:<br/><br/>Сървър: %LABEL%<br/>IP адрес: %IP%<br/>Порт: %PORT%<br/>Днес: %DATE%",
),
'login' => array(
'welcome_usermenu' => 'Добре дошъл, %user_name%',

View File

@ -81,6 +81,9 @@ $sm_lang = array(
'level_description' => '<b>Administratore</b> har fuld adgang: De kan styre servere, brugere og indstillingere.<br/><b>Brugere</b> kan kun se og køre opdatere for servere som er tildelt til dem.',
'mobile' => 'Mobil',
'email' => 'Email',
'pushover' => 'Pushover',
'pushover_key' => 'Pushover Key',
'pushover_device' => 'Pushover Device',
'delete_title' => 'Slet bruger',
'delete_message' => 'Er du sikker på du vil slette bruger \'%1\'?',
'deleted' => 'Bruger slettet.',
@ -104,6 +107,7 @@ $sm_lang = array(
'status' => 'Status',
'email' => 'Email',
'sms' => 'SMS',
'pushover' => 'Pushover',
'no_logs' => 'Intet i loggen',
),
'servers' => array(
@ -127,6 +131,7 @@ $sm_lang = array(
'send_email' => 'Send Email',
'sms' => 'SMS',
'send_sms' => 'Send SMS',
'pushover' => 'Pushover',
'users' => 'Users',
'delete_title' => 'Slet server',
'delete_message' => 'Er du sikker på du vil slette server \'%1\'?',
@ -186,16 +191,17 @@ $sm_lang = array(
'sms_gateway_username' => 'Gateway brugernavn/apikey',
'sms_gateway_password' => 'Gateway adgangskode',
'sms_from' => 'Afsenders navn.',
'pushover_status' => 'Allow sending pushover messages',
'pushover_api_token' => 'Pushover App API Token',
'alert_type' => 'Vælg hvornår du vil modtage besked.<br/>',
'alert_type_description' => '<b>Status ændring:</b> '.
'alert_type_description' => '<b>Status ændring:</b> '.
'Du vil modtage en notifcation når en server har en ændring i status. Fra online -> offline eller offline -> online.<br/>'.
'<br /><b>Offline:</b> '.
'Du vil modtage en meddelelse, når en server går offline for * kun første gang *. for eksempel, '.
'Hvis dit cronjob køre hvert kvatere og din server går ned kl 01 og kommer først op kl 06 '.
' så vil du kun modtage en mail kl 01.<br/>'.
'<br><b>Altid:</b> '.
'Du vil modtage en besked, hver gang scriptet kører og et websted er nede, selvom site har været '.
'offline i flere timer.',
'Du vil modtage en besked, hver gang scriptet kører og et websted er nede, selvom site har været offline i flere timer.',
'alert_type_status' => 'Status ændret',
'alert_type_offline' => 'Offline',
'alert_type_always' => 'Altid',
@ -203,13 +209,15 @@ $sm_lang = array(
'log_status_description' => 'Hvis log status er sat til TRUE, vil monitoren logge hændelsen hver gang status ændre sig.',
'log_email' => 'Log mails sendt af systemet',
'log_sms' => 'Log SMS sendt af systemet',
'log_pushover' => 'Log pushover messages sent by the script',
'updated' => 'Indstillingerne er blevet opdateret.',
'nochanges' => 'The configuration didn\'t change.',
'tab_email' => 'Email',
'tab_sms' => 'SMS',
'tab_log' => 'Log',
'tab_pushover' => 'Pushover',
'settings_email' => 'Email indstillinger',
'settings_sms' => 'SMS indstillinger',
'settings_pushover' => 'Pushover settings',
'settings_notification' => 'Meddelelse indstillinger',
'settings_log' => 'Log indstillinger',
'auto_refresh' => 'Genopfriske automatisk',
@ -235,9 +243,13 @@ $sm_lang = array(
'off_sms' => 'Server \'%LABEL%\' is DOWN: ip=%IP%, port=%PORT%. Fejl=%ERROR%',
'off_email_subject' => 'VIGTIG: Server \'%LABEL%\' is DOWN',
'off_email_body' => "Det lykkedes ikke at oprette forbindelse til følgende server:<br/><br/>Server: %LABEL%<br/>IP: %IP%<br/>Port: %PORT%<br/>Fejl: %ERROR%<br/>Date: %DATE%",
'off_pushover_title' => 'Server \'%LABEL%\' is DOWN',
'off_pushover_message' => "Det lykkedes ikke at oprette forbindelse til følgende server:<br/><br/>Server: %LABEL%<br/>IP: %IP%<br/>Port: %PORT%<br/>Fejl: %ERROR%<br/>Date: %DATE%",
'on_sms' => 'Server \'%LABEL%\' is RUNNING: ip=%IP%, port=%PORT%',
'on_email_subject' => 'VIGTIG: Server \'%LABEL%\' is RUNNING',
'on_email_body' => "Server '%LABEL%' køre igen:<br/><br/>Server: %LABEL%<br/>IP: %IP%<br/>Port: %PORT%<br/>Dato: %DATE%",
'on_pushover_title' => 'Server \'%LABEL%\' is RUNNING',
'on_pushover_message' => "Server '%LABEL%' køre igen:<br/><br/>Server: %LABEL%<br/>IP: %IP%<br/>Port: %PORT%<br/>Dato: %DATE%",
),
'login' => array(
'welcome_usermenu' => 'Velkommen, %user_name%',

View File

@ -201,8 +201,7 @@ $sm_lang = array(
'Sie bekommen eine Benachrichtigung, wenn ein Server Offline ist.<br/>'.
'Es wird nur eine Mitteilung versendet.<br/>'.
'<br/><b>Immer: </b>'.
'Sie werden jedesmal wenn der CronJob oder das Script ausgef&uuml;hrt wird benachrichtigt,<br>'.
'auch wenn der Dienst mehreres Stunden offline ist',
'Sie werden jedesmal wenn der CronJob oder das Script ausgef&uuml;hrt wird benachrichtigt auch wenn der Dienst mehreres Stunden offline ist',
'alert_type_status' => 'Status ge&auml;ndert',
'alert_type_offline' => 'Offline',
'alert_type_always' => 'Immer',
@ -216,10 +215,9 @@ $sm_lang = array(
'tab_email' => 'Email',
'tab_sms' => 'SMS',
'tab_pushover' => 'Pushover',
'tab_log' => 'Log',
'settings_email' => 'Email',
'settings_sms' => 'SMS Nachricht',
'settings_pushover' => 'Pushover',
'settings_pushover' => 'Pushover settings',
'settings_notification' => 'Benachrichtigung',
'settings_log' => 'Log',
'auto_refresh' => 'Auto-refresh',
@ -245,17 +243,13 @@ $sm_lang = array(
'off_sms' => 'Server \'%LABEL%\' ist Offline: ip=%IP%, port=%PORT%. Fehler=%ERROR%',
'off_email_subject' => 'Wichtig: Server \'%LABEL%\' ist Offline',
'off_email_body' => "Kann keine Verbindung zum Server aufbauen:<br/><br/>Server: %LABEL%<br/>IP: %IP%<br/>Port: %PORT%<br/>Fehler: %ERROR%<br/>Datum: %DATE%",
'off_pushover_title' => '\'%LABEL%\' Offline',
'off_pushover_message' => 'Server \'%LABEL%\'<br/>ist Offline<br/>IP: %IP%<br/>Port: %PORT%<br/>Fehler: %ERROR%',
'off_pushover_url_title' => 'SERVER MONITOR',
'off_pushover_url' => '%MONITORURL%',
'off_pushover_title' => 'Server \'%LABEL%\' ist Offline',
'off_pushover_message' => "Kann keine Verbindung zum Server aufbauen:<br/><br/>Server: %LABEL%<br/>IP: %IP%<br/>Port: %PORT%<br/>Fehler: %ERROR%<br/>Datum: %DATE%",
'on_sms' => 'Server \'%LABEL%\' ist wieder Online: ip=%IP%, port=%PORT%',
'on_email_subject' => 'Wichtig: Server \'%LABEL%\' ist wieder Online',
'on_email_body' => "Server '%LABEL%' l&auml;uft wieder:<br/><br/>Server: %LABEL%<br/>IP: %IP%<br/>Port: %PORT%<br/>Datum: %DATE%",
'on_pushover_title' => '\'%LABEL%\' Online',
'on_pushover_message' => 'Server \'%LABEL%\'<br/>ist wieder Online<br/>IP: %IP%<br/>Port: %PORT%',
'on_pushover_url_title' => 'SERVER MONITOR',
'on_pushover_url' => '%MONITORURL%',
'on_pushover_title' => 'Server \'%LABEL%\' ist wieder Online',
'on_pushover_message' => "Server '%LABEL%' l&auml;uft wieder:<br/><br/>Server: %LABEL%<br/>IP: %IP%<br/>Port: %PORT%<br/>Datum: %DATE%",
),
'login' => array(
'welcome_usermenu' => 'Welcome, %user_name%',

View File

@ -131,7 +131,7 @@ $sm_lang = array(
'send_email' => 'Send Email',
'sms' => 'SMS',
'send_sms' => 'Send SMS',
'send_pushover' => 'Send Pushover',
'pushover' => 'Pushover',
'users' => 'Users',
'delete_title' => 'Delete server',
'delete_message' => 'Are you sure you want to delete server \'%1\'?',
@ -201,8 +201,7 @@ $sm_lang = array(
'your cronjob is every 15 mins and your server goes down at 1 am and stays down till 6 am. '.
'You will get 1 notification at 1 am and thats it.<br/>'.
'<br><b>Always:</b> '.
'You will receive a notification every time the script runs and a site is down, even if the site has been '.
'offline for hours.',
'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',
@ -216,7 +215,6 @@ $sm_lang = array(
'tab_email' => 'Email',
'tab_sms' => 'SMS',
'tab_pushover' => 'Pushover',
'tab_log' => 'Log',
'settings_email' => 'Email settings',
'settings_sms' => 'Text message settings',
'settings_pushover' => 'Pushover settings',
@ -245,17 +243,13 @@ $sm_lang = 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:<br/><br/>Server: %LABEL%<br/>IP: %IP%<br/>Port: %PORT%<br/>Error: %ERROR%<br/>Date: %DATE%",
'off_pushover_title' => '\'%LABEL%\' Offline',
'off_pushover_message' => 'Server \'%LABEL%\'<br/>ist Offline<br/>IP: %IP%<br/>Port: %PORT%<br/>Fehler: %ERROR%',
'off_pushover_url_title' => 'SERVER MONITOR',
'off_pushover_url' => '%MONITORURL%',
'off_pushover_title' => 'Server \'%LABEL%\' is DOWN',
'off_pushover_message' => "Failed to connect to the following server:<br/><br/>Server: %LABEL%<br/>IP: %IP%<br/>Port: %PORT%<br/>Error: %ERROR%<br/>Date: %DATE%",
'on_sms' => 'Server \'%LABEL%\' is RUNNING: ip=%IP%, port=%PORT%',
'on_email_subject' => 'IMPORTANT: Server \'%LABEL%\' is RUNNING',
'on_email_body' => "Server '%LABEL%' is running again:<br/><br/>Server: %LABEL%<br/>IP: %IP%<br/>Port: %PORT%<br/>Date: %DATE%",
'on_pushover_title' => '\'%LABEL%\' Online',
'on_pushover_message' => 'Server \'%LABEL%\'<br/>ist wieder Online<br/>IP: %IP%<br/>Port: %PORT%',
'on_pushover_url_title' => 'SERVER MONITOR',
'on_pushover_url' => '%MONITORURL%',
'on_pushover_title' => 'Server \'%LABEL%\' is RUNNING',
'on_pushover_message' => 'Server \'%LABEL%\' is running again:<br/><br/>Server: %LABEL%<br/>IP: %IP%<br/>Port: %PORT%<br/>Date: %DATE%',
),
'login' => array(
'welcome_usermenu' => 'Welcome, %user_name%',

View File

@ -81,6 +81,9 @@ $sm_lang = array(
'level_description' => '<b>Administrators</b> have full access: they can manage servers, users and edit the global configuration.<br/><b>Users</b> can only view and run the updater for the servers that have been assigned to them.',
'mobile' => 'Mobil',
'email' => 'Email',
'pushover' => 'Pushover',
'pushover_key' => 'Pushover Key',
'pushover_device' => 'Pushover Device',
'delete_title' => 'Delete User',
'delete_message' => 'Are you sure you want to delete user \'%1\'?',
'deleted' => 'User deleted.',
@ -104,6 +107,7 @@ $sm_lang = array(
'status' => 'Estado',
'email' => 'Email',
'sms' => 'SMS',
'pushover' => 'Pushover',
'no_logs' => 'No logs',
),
'servers' => array(
@ -127,6 +131,7 @@ $sm_lang = array(
'send_email' => 'Email',
'sms' => 'SMS',
'send_sms' => 'SMS',
'pushover' => 'Pushover',
'users' => 'Users',
'delete_title' => 'Delete Server',
'delete_message' => 'Are you sure you want to delete server \'%1\'?',
@ -137,6 +142,7 @@ $sm_lang = array(
'latency_max' => 'Tiempo de respuesta (maximum)',
'latency_min' => 'Tiempo de respuesta (minimum)',
'latency_avg' => 'Tiempo de respuesta (average)',
'uptime' => 'Uptime',
'year' => 'Year',
'month' => 'Month',
'week' => 'Week',
@ -185,6 +191,8 @@ $sm_lang = array(
'sms_gateway_username' => 'Gateway username',
'sms_gateway_password' => 'Gateway password',
'sms_from' => 'Número origen del SMS',
'pushover_status' => 'Allow sending pushover messages',
'pushover_api_token' => 'Pushover App API Token',
'alert_type' => 'Cuando desea recibir notificaciones ?<br/>',
'alert_type_description' => '<b>... Al cambiar el estado:</b> '.
'p.ej. online -> offline o offline -> online.<br/>'.
@ -201,13 +209,15 @@ $sm_lang = array(
'log_status_description' => 'Al setear TRUE (marcar) se protocolan todos los estados.',
'log_email' => 'Enviar Log via email?',
'log_sms' => 'Enviar Log via SMS ?',
'log_pushover' => 'Log pushover messages sent by the script',
'updated' => 'Configuración guardada.',
'nochanges' => 'The configuration didn\'t change.',
'tab_email' => 'Email',
'tab_sms' => 'SMS',
'tab_log' => 'Log',
'tab_pushover' => 'Pushover',
'settings_email' => 'Email',
'settings_sms' => 'Mensaje SMS',
'settings_pushover' => 'Pushover settings',
'settings_notification' => 'Notificación',
'settings_log' => 'Log',
'auto_refresh' => 'Refrescar automáticamente página de servidores',
@ -233,9 +243,13 @@ $sm_lang = array(
'off_sms' => 'Servidor \'%LABEL%\' está fuera de línea: ip=%IP%, port=%PORT%. error=%ERROR%',
'off_email_subject' => 'Importante: Servidor \'%LABEL%\' está fuera de línea',
'off_email_body' => "No posible conectar al servidor:<br/><br/>Servidor: %LABEL%<br/>IP: %IP%<br/>Port: %PORT%<br/>Error: %ERROR%<br/>Fecha: %DATE%",
'off_pushover_title' => 'Servidor \'%LABEL%\' está fuera de línea',
'off_pushover_message' => "No posible conectar al servidor:<br/><br/>Servidor: %LABEL%<br/>IP: %IP%<br/>Port: %PORT%<br/>Error: %ERROR%<br/>Fecha: %DATE%",
'on_sms' => 'Servidor \'%LABEL%\' ya está de nuevo funcionando en línea: ip=%IP%, port=%PORT%',
'on_email_subject' => 'Importante: Servidor \'%LABEL%\' ya está de nuevo en línea',
'on_email_body' => "Servidor '%LABEL%' ya está funcionando en línea de nuevo:<br/><br/>Servidor: %LABEL%<br/>IP: %IP%<br/>Port: %PORT%<br/>Fecha: %DATE%",
'on_pushover_title' => 'Servidor \'%LABEL%\' ya está de nuevo en línea',
'on_pushover_message' => "Servidor '%LABEL%' ya está funcionando en línea de nuevo:<br/><br/>Servidor: %LABEL%<br/>IP: %IP%<br/>Port: %PORT%<br/>Fecha: %DATE%",
),
'login' => array(
'welcome_usermenu' => 'Welcome, %user_name%',

View File

@ -81,6 +81,9 @@ $sm_lang = array(
'level_description' => 'Les <b>Administrateurs</b> ont un accès total. Ils peuvent gérer les serveurs, les utilisateurs et éditer la configuration globale.<br/>Les <b>Utilisateurs</b> ne peuvent que voir et mettre à jour les serveurs qui leur ont été assignés.',
'mobile' => 'Téléphone',
'email' => 'Email',
'pushover' => 'Pushover',
'pushover_key' => 'Pushover Key',
'pushover_device' => 'Pushover Device',
'delete_title' => 'Supprimer un utilisateur',
'delete_message' => 'Êtes-vous sûr de vouloir supprimer l\'utilisateur \'%1\' ?',
'deleted' => 'Utilisateur supprimé.',
@ -104,6 +107,7 @@ $sm_lang = array(
'status' => 'État',
'email' => 'email',
'sms' => 'SMS',
'pushover' => 'Pushover',
'no_logs' => 'Aucun événement',
),
'servers' => array(
@ -127,6 +131,7 @@ $sm_lang = array(
'send_email' => 'Envoyer un email',
'sms' => 'SMS',
'send_sms' => 'Envoyer un SMS',
'pushover' => 'Pushover',
'users' => 'Users',
'delete_title' => 'Supprimer un serveur',
'delete_message' => 'Êtes-vous sûr de vouloir supprimer le serveur \'%1\' ?',
@ -186,6 +191,8 @@ $sm_lang = array(
'sms_gateway_username' => 'Nom utilisateur de la passerelle',
'sms_gateway_password' => 'Mot de passe de la passerelle',
'sms_from' => 'SMS de l\'expéditeur',
'pushover_status' => 'Allow sending pushover messages',
'pushover_api_token' => 'Pushover App API Token',
'alert_type' => 'Choisissez quand vous souhaitez être notifié.<br/>',
'alert_type_description' => '<b>Changement d\'état : </b>'.
'Vous recevez une notification chaque fois que le serveur change d\'état. C\'est-à-dire passe de l\'état OK à HORS SERVICE ou de HORS SERVICE à OK.<br/>'.
@ -202,13 +209,15 @@ $sm_lang = array(
'log_status_description' => 'Si l\'option est activée, un événement est enregistré chaque fois qu\'une notification a lieu.',
'log_email' => 'Enregistrer tout les emails envoyés',
'log_sms' => 'Enregistrer tout les SMS envoyés',
'log_pushover' => 'Log pushover messages sent by the script',
'updated' => 'La configuration a été mise à jour.',
'nochanges' => 'La configuration n\'a pas été modifiée.',
'tab_email' => 'Email',
'tab_sms' => 'SMS',
'tab_log' => 'Événements',
'tab_pushover' => 'Pushover',
'settings_email' => 'Configuration email',
'settings_sms' => 'Configuration SMS',
'settings_pushover' => 'Pushover settings',
'settings_notification' => 'Configuration des notifications',
'settings_log' => 'Configuration des événements',
'auto_refresh' => 'Auto-rachaîchissement',
@ -234,9 +243,13 @@ $sm_lang = array(
'off_sms' => 'Le Serveur \'%LABEL%\' est HORS SERVICE: IP=%IP%, Port=%PORT%. Erreur=%ERROR%',
'off_email_subject' => 'IMPORTANT: Le Serveur \'%LABEL%\' est HORS SERVICE',
'off_email_body' => "Impossible de se connecter au serveur suivant:<br/><br/>Serveur: %LABEL%<br/>IP: %IP%<br/>Port: %PORT%<br/>Erreur: %ERROR%<br/>Date: %DATE%",
'off_pushover_title' => 'Le Serveur \'%LABEL%\' est HORS SERVICE',
'off_pushover_message' => "Impossible de se connecter au serveur suivant:<br/><br/>Serveur: %LABEL%<br/>IP: %IP%<br/>Port: %PORT%<br/>Erreur: %ERROR%<br/>Date: %DATE%",
'on_sms' => 'Le Serveur \'%LABEL%\' est OK: IP=%IP%, Port=%PORT%',
'on_email_subject' => 'IMPORTANT: Le Serveur \'%LABEL%\' est OK',
'on_email_body' => "Le Serveur '%LABEL%' est de nouveau OK:<br/><br/>Serveur: %LABEL%<br/>IP: %IP%<br/>Port: %PORT%<br/>Date: %DATE%",
'on_pushover_title' => 'Le Serveur \'%LABEL%\' est OK',
'on_pushover_message' => "Le Serveur '%LABEL%' est de nouveau OK:<br/><br/>Serveur: %LABEL%<br/>IP: %IP%<br/>Port: %PORT%<br/>Date: %DATE%",
),
'login' => array(
'welcome_usermenu' => 'Bonjour %user_name%',

View File

@ -81,6 +81,9 @@ $sm_lang = array(
'level_description' => '<b>Administrators</b> have full access: they can manage servers, users and edit the global configuration.<br/><b>Users</b> can only view and run the updater for the servers that have been assigned to them.',
'mobile' => 'Cellulare',
'email' => 'Email',
'pushover' => 'Pushover',
'pushover_key' => 'Pushover Key',
'pushover_device' => 'Pushover Device',
'delete_title' => 'Delete User',
'delete_message' => 'Are you sure you want to delete user \'%1\'?',
'deleted' => 'User deleted.',
@ -104,6 +107,7 @@ $sm_lang = array(
'status' => 'Stato',
'email' => 'Email',
'sms' => 'SMS',
'pushover' => 'Pushover',
'no_logs' => 'No logs',
),
'servers' => array(
@ -127,6 +131,7 @@ $sm_lang = array(
'send_email' => 'Invia Email',
'sms' => 'SMS',
'send_sms' => 'Invia SMS',
'pushover' => 'Pushover',
'users' => 'Users',
'delete_title' => 'Delete Server',
'delete_message' => 'Are you sure you want to delete server \'%1\'?',
@ -137,6 +142,7 @@ $sm_lang = array(
'latency_max' => 'Tempo di risposta (maximum)',
'latency_min' => 'Tempo di risposta (minimum)',
'latency_avg' => 'Tempo di risposta (average)',
'uptime' => 'Uptime',
'year' => 'Year',
'month' => 'Month',
'week' => 'Week',
@ -185,6 +191,8 @@ $sm_lang = array(
'sms_gateway_username' => 'Nome Utente Gateway',
'sms_gateway_password' => 'Password Gateway',
'sms_from' => 'Numero di telefono del mittente',
'pushover_status' => 'Allow sending pushover messages',
'pushover_api_token' => 'Pushover App API Token',
'alert_type' => 'Seleziona quando vuoi essere notificato.<br/>',
'alert_type_description' => '<b>Cambio di Stato:</b> '.
'Riceverai una notifica solo quando un server cambierà stato. Quindi da online -> offline oppure da offline -> online.<br/>'.
@ -201,13 +209,15 @@ $sm_lang = array(
'log_status_description' => 'Se lo Stato Log è impostato su VERO, il monitor registrerà nel log gli eventi appena le notifiche verranno inviate.',
'log_email' => 'Registra email inviate dallo script.',
'log_sms' => 'Registra SMS inviati dallo script.',
'log_pushover' => 'Log pushover messages sent by the script',
'updated' => 'La configurazione è stato aggiornata.',
'nochanges' => 'The configuration didn\'t change.',
'tab_email' => 'Email',
'tab_sms' => 'SMS',
'tab_log' => 'Log',
'tab_pushover' => 'Pushover',
'settings_email' => 'Impostazioni Email',
'settings_sms' => 'Impostazioni SMS',
'settings_pushover' => 'Pushover settings',
'settings_notification' => 'Impostazioni Notifiche',
'settings_log' => 'Impostazioni Log',
'auto_refresh' => 'Auto-Aggiorna pagina servers',
@ -233,9 +243,13 @@ $sm_lang = array(
'off_sms' => 'Server \'%LABEL%\' è DOWN: ip=%IP%, porta=%PORT%. Errore=%ERROR%',
'off_email_subject' => 'IMPORTANTE: Server \'%LABEL%\' è DOWN',
'off_email_body' => "Impossibile connettersi al seguente server:<br/><br/>Server: %LABEL%<br/>IP: %IP%<br/>Porta: %PORT%<br/>Errore: %ERROR%<br/>Data: %DATE%",
'off_pushover_title' => 'Server \'%LABEL%\' è DOWN',
'off_pushover_message' => "Impossibile connettersi al seguente server:<br/><br/>Server: %LABEL%<br/>IP: %IP%<br/>Porta: %PORT%<br/>Errore: %ERROR%<br/>Data: %DATE%",
'on_sms' => 'Server \'%LABEL%\' è ATTIVO: ip=%IP%, porta=%PORT%',
'on_email_subject' => 'IMPORTANTE: Server \'%LABEL%\' è ATTIVO',
'on_email_body' => "Server '%LABEL%' è di nuovo attivo:<br/><br/>Server: %LABEL%<br/>IP: %IP%<br/>Porta: %PORT%<br/>Data: %DATE%",
'on_pushover_title' => 'Server \'%LABEL%\' è ATTIVO',
'on_pushover_message' => "Server '%LABEL%' è di nuovo attivo:<br/><br/>Server: %LABEL%<br/>IP: %IP%<br/>Porta: %PORT%<br/>Data: %DATE%",
),
'login' => array(
'welcome_usermenu' => 'Welcome, %user_name%',

View File

@ -81,6 +81,9 @@ $sm_lang = array(
'level_description' => '<b>Administrators</b> have full access: they can manage servers, users and edit the global configuration.<br/><b>Users</b> can only view and run the updater for the servers that have been assigned to them.',
'mobile' => '휴대폰',
'email' => 'Email',
'pushover' => 'Pushover',
'pushover_key' => 'Pushover Key',
'pushover_device' => 'Pushover Device',
'delete_title' => 'Delete User',
'delete_message' => 'Are you sure you want to delete user \'%1\'?',
'deleted' => 'User deleted.',
@ -104,6 +107,7 @@ $sm_lang = array(
'status' => '상태',
'email' => 'email',
'sms' => 'sms',
'pushover' => 'Pushover',
'no_logs' => 'No logs',
),
'servers' => array(
@ -127,6 +131,7 @@ $sm_lang = array(
'send_email' => '메일 전송',
'sms' => 'SMS 전송',
'send_sms' => 'SMS 전송',
'pushover' => 'Pushover',
'users' => 'Users',
'delete_title' => 'Delete Server',
'delete_message' => 'Are you sure you want to delete server \'%1\'?',
@ -186,6 +191,8 @@ $sm_lang = array(
'sms_gateway_username' => 'Gateway username',
'sms_gateway_password' => 'Gateway password',
'sms_from' => 'Sender\'s phone number',
'pushover_status' => 'Allow sending pushover messages',
'pushover_api_token' => 'Pushover App API Token',
'alert_type' => '알림을 원하면 다음과 같이 변경하십시오..<br/>',
'alert_type_description' => '<b>상태 변경: </b><br/>'.
'서버 상태가 변경이되면 알림을 받습니다. online -> offline -> online.<br/>'.
@ -194,6 +201,7 @@ $sm_lang = array(
'cron이 매 15분이고 오전1시 부터 오전6시까지 다운되었을때 오전1시에 한번 알림을 받습니다.<br />' .
'<br/><b>항상: </b><br/>'.
'사이트가 다운되었을 때 매시간 알림을 받습니다.',
'alert_type_status' => '상태 변경',
'alert_type_offline' => '오프라인',
'alert_type_always' => '항상',
@ -201,13 +209,15 @@ $sm_lang = array(
'log_status_description' => '로그상태가 TRUE이면 알림설정이 통과할때마다 이벤트를 기록합니다.',
'log_email' => '이메일로 로그를 전송하시겠습니까?',
'log_sms' => 'SMS로 로그를 전송하시겠습니까?',
'log_pushover' => 'Log pushover messages sent by the script',
'updated' => '설정이 수정되었습니다.',
'nochanges' => 'The configuration didn\'t change.',
'tab_email' => 'Email',
'tab_sms' => 'SMS',
'tab_log' => '로그',
'tab_pushover' => 'Pushover',
'settings_email' => 'Email 설정',
'settings_sms' => 'SMS 설정',
'settings_pushover' => 'Pushover settings',
'settings_notification' => '알림 설정',
'settings_log' => '로그 설정',
'auto_refresh' => 'Auto-refresh',
@ -233,9 +243,13 @@ $sm_lang = array(
'off_sms' => '서버(\'%LABEL%\')가 다운되었습니다. : ip=%IP%, port=%PORT%. Error=%ERROR%',
'off_email_subject' => '중요: 서버(\'%LABEL%\')가 다운되었습니다.',
'off_email_body' => "서버 접속을 실패하였습니다.<br/><br/>Server: %LABEL%<br/>IP: %IP%<br/>Port: %PORT%<br/>Error: %ERROR%<br/>Date: %DATE%",
'off_pushover_title' => '서버(\'%LABEL%\')가 다운되었습니다.',
'off_pushover_message' => "서버 접속을 실패하였습니다.<br/><br/>Server: %LABEL%<br/>IP: %IP%<br/>Port: %PORT%<br/>Error: %ERROR%<br/>Date: %DATE%",
'on_sms' => '서버(\'%LABEL%\') 가동중: ip=%IP%, port=%PORT%',
'on_email_subject' => '중요: 서버(\'%LABEL%\')가 가동중입니다.',
'on_email_body' => "서버('%LABEL%')가 재가동됩니다.:<br/><br/>Server: %LABEL%<br/>IP: %IP%<br/>Port: %PORT%<br/>Date: %DATE%",
'on_pushover_title' => '서버(\'%LABEL%\')가 가동중입니다.',
'on_pushover_message' => "서버('%LABEL%')가 재가동됩니다.:<br/><br/>Server: %LABEL%<br/>IP: %IP%<br/>Port: %PORT%<br/>Date: %DATE%",
),
'login' => array(
'welcome_usermenu' => 'Welcome, %user_name%',

View File

@ -81,6 +81,9 @@ $sm_lang = array(
'level_description' => '<b>Beheerders</b> hebben volledige toegang: ze kunnen servers en gebruiker beheren en de globale configuratie aanpassen.<br/><b>Gebruikers</b> kunnen alleen de servers bekijken en op fouten testen die aan hun zijn toegewezen.',
'mobile' => 'Mobiel',
'email' => 'Email',
'pushover' => 'Pushover',
'pushover_key' => 'Pushover Key',
'pushover_device' => 'Pushover Device',
'delete_title' => 'Delete User',
'delete_message' => 'Are you sure you want to delete user \'%1\'?',
'deleted' => 'User deleted.',
@ -104,6 +107,7 @@ $sm_lang = array(
'status' => 'Status',
'email' => 'Email',
'sms' => 'SMS',
'pushover' => 'Pushover',
'no_logs' => 'No logs',
),
'servers' => array(
@ -127,6 +131,7 @@ $sm_lang = array(
'send_email' => 'Stuur email',
'sms' => 'SMS',
'send_sms' => 'Stuur SMS',
'pushover' => 'Pushover',
'users' => 'Gebruikers',
'delete_title' => 'Delete Server',
'delete_message' => 'Are you sure you want to delete server \'%1\'?',
@ -186,6 +191,8 @@ $sm_lang = array(
'sms_gateway_username' => 'Gateway gebruikersnaam',
'sms_gateway_password' => 'Gateway wachtwoord',
'sms_from' => 'Telefoonnummer afzender',
'pushover_status' => 'Sta Pushover berichten toe?',
'pushover_api_token' => 'Pushover App API Token',
'alert_type' => 'Selecteer wanneer je een notificatie wilt.<br/>',
'alert_type_description' => '<b>Status change:</b> '.
'Je ontvangt alleen bericht wanneer een server van status verandert. Dus van online -> offline of offline -> online.<br/>'.
@ -202,13 +209,15 @@ $sm_lang = array(
'log_status_description' => 'Als de log status aan staat, zal de monitor een log aanmaken elke keer dat hij door de notificatie instellingen komt.',
'log_email' => 'Log emails verstuurd bij het script?',
'log_sms' => 'Log sms berichten verstuurd bij het script?',
'log_pushover' => 'Log pushover messages sent by the script',
'updated' => 'De configuratie is gewijzigd.',
'nochanges' => 'De configuratie is ongewijzigd.',
'tab_email' => 'Email',
'tab_sms' => 'SMS',
'tab_log' => 'Log',
'tab_pushover' => 'Pushover',
'settings_email' => 'Email instellingen',
'settings_sms' => 'SMS instellingen',
'settings_pushover' => 'Pushover settings',
'settings_notification' => 'Notificatie instellingen',
'settings_log' => 'Log instellingen',
'auto_refresh' => 'Auto-refresh',
@ -234,9 +243,13 @@ $sm_lang = array(
'off_sms' => 'Server %LABEL% is DOWN: ip=%IP%, poort=%PORT%. Fout=%ERROR%',
'off_email_subject' => 'BELANGRIJK: Server %LABEL% is DOWN',
'off_email_body' => "De server kon niet worden bereikt:<br/><br/>Server: %LABEL%<br/>IP: %IP%<br/>Poort: %PORT%<br/>Fout: %ERROR%<br/>Datum: %DATE%",
'off_pushover_title' => 'Server %LABEL% is DOWN',
'off_pushover_message' => "De server kon niet worden bereikt:<br/><br/>Server: %LABEL%<br/>IP: %IP%<br/>Poort: %PORT%<br/>Fout: %ERROR%<br/>Datum: %DATE%",
'on_sms' => 'Server %LABEL% is RUNNING: ip=%IP%, poort=%PORT%',
'on_email_subject' => 'BELANGRIJK: Server %LABEL% is RUNNING',
'on_email_body' => "Server %LABEL% is weer online:<br/><br/>Server: %LABEL%<br/>IP: %IP%<br/>Poort: %PORT%<br/>Datum: %DATE%",
'on_pushover_title' => 'Server %LABEL% is RUNNING',
'on_pushover_message' => "Server %LABEL% is weer online:<br/><br/>Server: %LABEL%<br/>IP: %IP%<br/>Poort: %PORT%<br/>Datum: %DATE%",
),
'login' => array(
'welcome_usermenu' => 'Welkom, %user_name%',

View File

@ -81,6 +81,9 @@ $sm_lang = array(
'level_description' => '<b>Administradores</b> Tem total acesso: podem gerenciar servidores, usuários e configurações globais.<br/><b>Usuários</b> só podem executar atualizações para servidores que lhe foram atribuídos.',
'mobile' => 'Celular',
'email' => 'Email',
'pushover' => 'Pushover',
'pushover_key' => 'Pushover Key',
'pushover_device' => 'Pushover Device',
'delete_title' => 'Delete User',
'delete_message' => 'Are you sure you want to delete user \'%1\'?',
'deleted' => 'User deleted.',
@ -104,6 +107,7 @@ $sm_lang = array(
'status' => 'Status',
'email' => 'Email',
'sms' => 'SMS',
'pushover' => 'Pushover',
'no_logs' => 'No logs',
),
'servers' => array(
@ -127,6 +131,7 @@ $sm_lang = array(
'send_email' => 'Enviar Email',
'sms' => 'SMS',
'send_sms' => 'Enviar SMS',
'pushover' => 'Pushover',
'users' => 'Users',
'delete_title' => 'Delete Server',
'delete_message' => 'Are you sure you want to delete server \'%1\'?',
@ -186,6 +191,8 @@ $sm_lang = array(
'sms_gateway_username' => 'Usuário do Gateway',
'sms_gateway_password' => 'Senha do Gateway',
'sms_from' => 'Número de telefone de envio',
'pushover_status' => 'Allow sending pushover messages',
'pushover_api_token' => 'Pushover App API Token',
'alert_type' => 'Selecione como você gostaria de ser notificado.<br/>',
'alert_type_description' => '<b>Mudança de Status:</b> '.
'Você receberá uma notificação quando o seridor tive uma mudança de status. De online -> offline ou offline -> online.<br/>'.
@ -194,8 +201,7 @@ $sm_lang = array(
'A cronjob é a cada 15 minutos e seu servidor caiu em 1:00 e permanece offline até 6 am. '.
'Você receberá uma notificação a 1:00 apenas<br/>'.
'<br><b>Sempre:</b> '.
'Você receberá uma notificação toda vez que o script é executado e um site esta offline, mesmo se o site tenha ficado '.
'offline por horas.',
'Você receberá uma notificação toda vez que o script é executado e um site esta offline, mesmo se o site tenha ficado offline por horas.',
'alert_type_status' => 'Mudança de Status',
'alert_type_offline' => 'Offline',
'alert_type_always' => 'Sempre',
@ -203,13 +209,15 @@ $sm_lang = array(
'log_status_description' => 'Se o status de registro é definido como TRUE, o monitor irá registrar o evento sempre que as configurações de notificação forem passadas.',
'log_email' => 'Registrar no Log os envios de email feitos pelo script?',
'log_sms' => 'Registrar no Log os envios de mensagens de texto feitos pelo script?',
'log_pushover' => 'Log pushover messages sent by the script',
'updated' => 'A configuração foi atualizada.',
'nochanges' => 'The configuration didn\'t change.',
'tab_email' => 'Email',
'tab_sms' => 'Texto',
'tab_log' => 'Logs',
'tab_pushover' => 'Pushover',
'settings_email' => 'Configuração de email',
'settings_sms' => 'Configuração de mensagens de texto',
'settings_pushover' => 'Pushover settings',
'settings_notification' => 'Configuração de notificações',
'settings_log' => 'Configuração de Logs',
'auto_refresh' => 'Atualizar automaticamente',
@ -235,9 +243,13 @@ $sm_lang = array(
'off_sms' => 'Servidor \'%LABEL%\' está OFFLINE: ip=%IP%, porta=%PORT%. Erro=%ERROR%',
'off_email_subject' => 'IMPORTANTE: Servidor \'%LABEL%\' está OFFLINE',
'off_email_body' => "Falha ao conectar ao servidor:<br/><br/>Servidor: %LABEL%<br/>IP: %IP%<br/>Porta: %PORT%<br/>Erro: %ERROR%<br/>Data: %DATE%",
'off_pushover_title' => 'Servidor \'%LABEL%\' está OFFLINE',
'off_pushover_message' => "Falha ao conectar ao servidor:<br/><br/>Servidor: %LABEL%<br/>IP: %IP%<br/>Porta: %PORT%<br/>Erro: %ERROR%<br/>Data: %DATE%",
'on_sms' => 'Servidor \'%LABEL%\' esta ONLINE: ip=%IP%, porta=%PORT%',
'on_email_subject' => 'IMPORTANTE: Servidor \'%LABEL%\' esta ONLINE',
'on_email_body' => "Servidor '%LABEL%' esta ONLINE novamente:<br/><br/>Servidor: %LABEL%<br/>IP: %IP%<br/>Porta: %PORT%<br/>Data: %DATE%",
'on_pushover_title' => 'Servidor \'%LABEL%\' esta ONLINE',
'on_pushover_message' => "Servidor '%LABEL%' esta ONLINE novamente:<br/><br/>Servidor: %LABEL%<br/>IP: %IP%<br/>Porta: %PORT%<br/>Data: %DATE%",
),
'login' => array(
'welcome_usermenu' => 'Bem vindo, %user_name%',

View File

@ -81,6 +81,9 @@ $sm_lang = array(
'level_description' => '<b>Администраторы</b> имеют полный доступ: они могут управлять серверами, пользователями и изменять общую конфигурацию.<br/><b>Пользователи</b> могут только просматривать и запускать проверку для серверов которые были к ним прикрепплены.',
'mobile' => 'Телефон',
'email' => 'Email',
'pushover' => 'Pushover',
'pushover_key' => 'Pushover Key',
'pushover_device' => 'Pushover Device',
'delete_title' => 'Удалить пользователя',
'delete_message' => 'Вы точно хотите удалить пользователя \'%1\'?',
'deleted' => 'Пользователь удален.',
@ -104,6 +107,7 @@ $sm_lang = array(
'status' => 'Статус',
'email' => 'Email',
'sms' => 'SMS',
'pushover' => 'Pushover',
'no_logs' => 'Записей нет',
),
'servers' => array(
@ -127,6 +131,7 @@ $sm_lang = array(
'send_email' => 'Отправить Email',
'sms' => 'SMS',
'send_sms' => 'Отправить SMS',
'pushover' => 'Pushover',
'users' => 'Users',
'delete_title' => 'Удалить сервер',
'delete_message' => 'Вы точно хотите удалить сервер \'%1\'?',
@ -186,6 +191,8 @@ $sm_lang = array(
'sms_gateway_username' => 'Пользователь',
'sms_gateway_password' => 'Пароль',
'sms_from' => 'Номер отправителя',
'pushover_status' => 'Allow sending pushover messages',
'pushover_api_token' => 'Pushover App API Token',
'alert_type' => 'Выбирите, какие вы хотите получать уведомления<br/>',
'alert_type_description' => '<b>Изменение статуса :</b> '.
'Вы получите уведомление об изменение статуса. Для онлайн -> оффлайн или офлайн -> онлайн.<br/>'.
@ -194,8 +201,7 @@ $sm_lang = array(
'Задание Cron выставлено на каждые 15 минут. Сервер перейдет в статус оффлайн в 1:00 и не измениться до 6:00. '.
'Вы получите 1 уведомление только в 1:00<br/>'.
'<br><b>Всегда:</b> '.
'Вы будете получать уведомление при каждом запуске скрипта проверки, как только сервер перейдет в статус оффлайн, даже если'.
'сервер находится в этом статусе несколько часов',
'Вы будете получать уведомление при каждом запуске скрипта проверки, как только сервер перейдет в статус оффлайн, даже если сервер находится в этом статусе несколько часов',
'alert_type_status' => 'Изменение статуса',
'alert_type_offline' => 'Оффлайн',
'alert_type_always' => 'Всегда',
@ -203,13 +209,15 @@ $sm_lang = array(
'log_status_description' => 'Если лог установлен в TRUE, монитор будет логировать все события режим которых выбран в типе уведомлений.',
'log_email' => 'Уведомления отправленые по Email',
'log_sms' => 'Уведомления отправленые по Email',
'log_pushover' => 'Log pushover messages sent by the script',
'updated' => 'Параметры были успешно применены.',
'nochanges' => 'Параметры не изменились.',
'tab_email' => 'Email',
'tab_sms' => 'SMS',
'tab_log' => 'Лог',
'tab_pushover' => 'Pushover',
'settings_email' => 'Настройка Email',
'settings_sms' => 'Настройка SMS',
'settings_pushover' => 'Pushover settings',
'settings_notification' => 'Настройка уведомлений',
'settings_log' => 'Настройка логирования',
'auto_refresh' => 'Авто-обновление',
@ -235,9 +243,13 @@ $sm_lang = array(
'off_sms' => 'Сервер \'%LABEL%\' сейчас НЕДОСТУПЕН: ip=%IP%, port=%PORT%. Ошибка=%ERROR%',
'off_email_subject' => 'ВАЖНО: сервер \'%LABEL%\' сейчас НЕДОСТУПЕН',
'off_email_body' => "Невозможно подключиться к следующему серверу:<br/><br/>Server: %LABEL%<br/>IP: %IP%<br/>Порт: %PORT%<br/>Ошибка: %ERROR%<br/>Дата: %DATE%",
'off_pushover_title' => 'Cервер \'%LABEL%\' сейчас НЕДОСТУПЕН',
'off_pushover_message' => "Невозможно подключиться к следующему серверу:<br/><br/>Server: %LABEL%<br/>IP: %IP%<br/>Порт: %PORT%<br/>Ошибка: %ERROR%<br/>Дата: %DATE%",
'on_sms' => 'Сервер \'%LABEL%\' сейчас ДОСТУПЕН: ip=%IP%, port=%PORT%',
'on_email_subject' => 'ВАЖНО: Сервер \'%LABEL%\' сейчас ДОСТУПЕН',
'on_email_body' => "Сервер '%LABEL%' снова доступен:<br/><br/>Server: %LABEL%<br/>IP: %IP%<br/>Port: %PORT%<br/>Date: %DATE%",
'on_pushover_title' => 'Сервер \'%LABEL%\' сейчас ДОСТУПЕН',
'on_pushover_message' => "Сервер '%LABEL%' снова доступен:<br/><br/>Server: %LABEL%<br/>IP: %IP%<br/>Port: %PORT%<br/>Date: %DATE%",
),
'login' => array(
'welcome_usermenu' => 'Здравствуйте, %user_name%',

View File

@ -81,6 +81,9 @@ $sm_lang = array(
'level_description' => '<b>超级管理员</b> 拥有所有权限: 管理服务器, 用户 以及修改设置.<br/><b>普通用户</b> 只能查看及更新自己名下所属的服务器.',
'mobile' => '手机',
'email' => '邮件',
'pushover' => 'Pushover',
'pushover_key' => 'Pushover Key',
'pushover_device' => 'Pushover Device',
'delete_title' => 'Delete User',
'delete_message' => 'Are you sure you want to delete user \'%1\'?',
'deleted' => 'User deleted.',
@ -104,6 +107,7 @@ $sm_lang = array(
'status' => '状态',
'email' => '邮件',
'sms' => '短信',
'pushover' => 'Pushover',
'no_logs' => 'No logs',
),
'servers' => array(
@ -127,6 +131,7 @@ $sm_lang = array(
'send_email' => '发送邮件',
'sms' => '短信',
'send_sms' => '发送短信',
'pushover' => 'Pushover',
'users' => 'Users',
'delete_title' => 'Delete Server',
'delete_message' => 'Are you sure you want to delete server \'%1\'?',
@ -186,6 +191,8 @@ $sm_lang = array(
'sms_gateway_username' => 'SMS网关用户名',
'sms_gateway_password' => 'SMS网关密码',
'sms_from' => '发信人电话号',
'pushover_status' => 'Allow sending pushover messages',
'pushover_api_token' => 'Pushover App API Token',
'alert_type' => '如果想要收到提醒请选中此项.<br/>',
'alert_type_description' => '<b>状态变化:</b> '.
'服务器 online -> offline 或 offline -> online 的状态变化将会收到提醒.<br/>'.
@ -202,13 +209,15 @@ $sm_lang = array(
'log_status_description' => '如果状态记录设置为开, 提醒发送时均会保存记录.',
'log_email' => '记录脚本所发邮件?',
'log_sms' => '记录脚本所发短信SMS?',
'log_pushover' => 'Log pushover messages sent by the script',
'updated' => '设置已更新.',
'nochanges' => 'The configuration didn\'t change.',
'tab_email' => '邮件发送设置',
'tab_sms' => '短信发送设置',
'tab_log' => '日志设置',
'tab_pushover' => 'Pushover',
'settings_email' => '邮件发送设置',
'settings_sms' => '短信发送设置',
'settings_pushover' => 'Pushover settings',
'settings_notification' => '提醒设置',
'settings_log' => '日志设置',
'auto_refresh' => 'Auto-refresh',
@ -234,9 +243,13 @@ $sm_lang = array(
'off_sms' => '服务器 \'%LABEL%\' 宕机: ip=%IP%, port=%PORT%. Error=%ERROR%',
'off_email_subject' => 'IMPORTANT: 服务器 \'%LABEL%\' 宕机',
'off_email_body' => "无法连接到以下服务器:<br/><br/>服务器: %LABEL%<br/>IP: %IP%<br/>Port: %PORT%<br/>错误: %ERROR%<br/>日期: %DATE%",
'off_pushover_title' => '服务器 \'%LABEL%\' 宕机',
'off_pushover_message' => "无法连接到以下服务器:<br/><br/>服务器: %LABEL%<br/>IP: %IP%<br/>Port: %PORT%<br/>错误: %ERROR%<br/>日期: %DATE%",
'on_sms' => '服务器 \'%LABEL%\' 运行中: ip=%IP%, port=%PORT%',
'on_email_subject' => 'IMPORTANT: 服务器 \'%LABEL%\' 运行中',
'on_email_body' => "服务器 '%LABEL%' 恢复运行:<br/><br/>服务器: %LABEL%<br/>IP: %IP%<br/>Port: %PORT%<br/>日期: %DATE%",
'on_pushover_title' => '服务器 \'%LABEL%\' 运行中',
'on_pushover_message' => "服务器 '%LABEL%' 恢复运行:<br/><br/>服务器: %LABEL%<br/>IP: %IP%<br/>Port: %PORT%<br/>日期: %DATE%",
),
'login' => array(
'welcome_usermenu' => '欢迎, %user_name%',

View File

@ -237,8 +237,8 @@ class ConfigController extends AbstractController {
$this->default_tab = 'email';
} elseif(isset($_POST['sms_submit']) || !empty($_POST['test_sms'])) {
$this->default_tab = 'sms';
} elseif(isset($_POST['logging_submit'])) {
$this->default_tab = 'logging';
} elseif(isset($_POST['pushover_submit'])) {
$this->default_tab = 'pushover';
}
}
$this->initializeAction('index');
@ -253,7 +253,6 @@ class ConfigController extends AbstractController {
'label_tab_email' => psm_get_lang('config', 'tab_email'),
'label_tab_sms' => psm_get_lang('config', 'tab_sms'),
'label_tab_pushover' => psm_get_lang('config', 'tab_pushover'),
'label_tab_log' => psm_get_lang('config', 'tab_log'),
'label_settings_email' => psm_get_lang('config', 'settings_email'),
'label_settings_sms' => psm_get_lang('config', 'settings_sms'),
'label_settings_pushover' => psm_get_lang('config', 'settings_pushover'),

View File

@ -45,12 +45,7 @@ class LogController extends AbstractServerController {
*/
protected function executeIndex() {
$this->setTemplateId('server_log_list', 'server/log.tpl.html');
$entries = array();
$entries['status'] = $this->getEntries('status');
$entries['email'] = $this->getEntries('email');
$entries['sms'] = $this->getEntries('sms');
$entries['pushover'] = $this->getEntries('pushover');
$log_types = array('status', 'email', 'sms', 'pushover');
// get users
$users = $this->db->select(PSM_DB_PREFIX.'users', null, array('user_id','name'));
@ -60,7 +55,8 @@ class LogController extends AbstractServerController {
$users_labels[$user['user_id']] = $user['name'];
}
foreach($entries as $key => $records) {
foreach($log_types as $key) {
$records = $this->getEntries($key);
$log_count = count($records);
for ($x = 0; $x < $log_count; $x++) {

View File

@ -93,6 +93,11 @@ class ServerController extends AbstractServerController {
// we need an array for our template magic (see below):
$html_actions = array('html_actions' => $html_actions);
$icons = array(
'email' => 'icon-envelope',
'sms' => 'icon-mobile',
'pushover' => 'icon-pushover',
);
$servers = $this->getServers();
$server_count = count($servers);
@ -120,13 +125,15 @@ class ServerController extends AbstractServerController {
if(($servers[$x]['active'] == 'yes')) {
$servers[$x]['active_icon'] = 'icon-eye-open';
$servers[$x]['active_title'] = psm_get_lang('servers', 'monitoring');
$servers[$x]['email_icon'] = ($servers[$x]['email'] == 'yes') ? 'icon-envelope' : '';
$servers[$x]['sms_icon'] = ($servers[$x]['sms'] == 'yes') ? 'icon-mobile' : '';
foreach($icons as $i_id => $i_icon) {
if(psm_get_conf($i_id . '_status') && $servers[$x][$i_id] == 'yes') {
$servers[$x][$i_id . '_icon'] = $i_icon;
}
}
} else {
$servers[$x]['active_icon'] = 'icon-eye-close';
$servers[$x]['active_title'] = psm_get_lang('servers', 'no_monitoring');
$servers[$x]['email_icon'] = '';
$servers[$x]['sms_icon'] = '';
}
$servers[$x] = $this->formatServer($servers[$x]);
@ -240,6 +247,7 @@ class ServerController extends AbstractServerController {
'active' => in_array($_POST['active'], array('yes', 'no')) ? $_POST['active'] : 'no',
'email' => in_array($_POST['email'], array('yes', 'no')) ? $_POST['email'] : 'no',
'sms' => in_array($_POST['sms'], array('yes', 'no')) ? $_POST['sms'] : 'no',
'pushover' => in_array($_POST['pushover'], array('yes', 'no')) ? $_POST['pushover'] : 'no',
);
// make sure websites start with http://
if($clean['type'] == 'website' && substr($clean['ip'], 0, 4) != 'http') {
@ -412,7 +420,7 @@ class ServerController extends AbstractServerController {
'label_send_email' => psm_get_lang('servers', 'send_email'),
'label_sms' => psm_get_lang('servers', 'sms'),
'label_send_sms' => psm_get_lang('servers', 'send_sms'),
'label_send_pushover' => psm_get_lang('servers', 'send_pushover'),
'label_pushover' => psm_get_lang('servers', 'pushover'),
'label_users' => psm_get_lang('servers', 'users'),
'label_warning_threshold' => psm_get_lang('servers', 'warning_threshold'),
'label_warning_threshold_description' => psm_get_lang('servers', 'warning_threshold_description'),
@ -447,4 +455,4 @@ class ServerController extends AbstractServerController {
}
return $result;
}
}
}

View File

@ -143,7 +143,7 @@ class Installer {
('sms_gateway_username', 'username'),
('sms_gateway_password', 'password'),
('sms_from', '1234567890'),
('pushover_status', '1'),
('pushover_status', '0'),
('pushover_api_token', ''),
('alert_type', 'status'),
('log_status', '1'),
@ -200,7 +200,7 @@ class Installer {
PSM_DB_PREFIX . 'log' => "CREATE TABLE `" . PSM_DB_PREFIX . "log` (
`log_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`server_id` int(11) unsigned NOT NULL,
`type` enum('status','email','sms') NOT NULL,
`type` enum('status','email','sms','pushover') NOT NULL,
`message` varchar(255) NOT NULL,
`datetime` timestamp NOT NULL default CURRENT_TIMESTAMP,
`user_id` varchar(255) NOT NULL,
@ -221,7 +221,7 @@ class Installer {
`active` enum('yes','no') NOT NULL default 'yes',
`email` enum('yes','no') NOT NULL default 'yes',
`sms` enum('yes','no') NOT NULL default 'no',
`pushover` enum('yes','no') NOT NULL default 'no',
`pushover` enum('yes','no') NOT NULL default 'yes',
`warning_threshold` mediumint(1) unsigned NOT NULL DEFAULT '1',
`warning_threshold_counter` mediumint(1) unsigned NOT NULL DEFAULT '0',
`timeout` smallint(1) unsigned NULL DEFAULT NULL,
@ -398,14 +398,16 @@ class Installer {
protected function upgrade310() {
$queries = array();
$queries[] = "INSERT INTO `" . PSM_DB_PREFIX . "config` (`key`, `value`) VALUES ('pushover_status', '1');";
$queries[] = "INSERT INTO `" . PSM_DB_PREFIX . "config` (`key`, `value`) VALUES ('log_pushover', '1');";
$queries[] = "INSERT INTO `" . PSM_DB_PREFIX . "config` (`key`, `value`) VALUES ('pushover_api_token', '');";
psm_update_conf('pushover_status', 1);
psm_update_conf('log_pushover', 1);
psm_update_conf('pushover_api_token', '');
$queries[] = "ALTER TABLE `" . PSM_DB_PREFIX . "users` ADD `pushover_key` VARCHAR( 255 ) NOT NULL AFTER `mobile`;";
$queries[] = "ALTER TABLE `" . PSM_DB_PREFIX . "users` ADD `pushover_device` VARCHAR( 255 ) NOT NULL AFTER `pushover_key`;";
$queries[] = "ALTER TABLE `" . PSM_DB_PREFIX . "servers` ADD `pushover` ENOM( 'yes','no' ) NOT NULL DEFAULT 'no' AFTER `sms`;";
$queries[] = "ALTER TABLE `" . PSM_DB_PREFIX . "users` ADD `pushover_device` VARCHAR( 255 ) NOT NULL AFTER `pushover_key`;";
$queries[] = "ALTER TABLE `" . PSM_DB_PREFIX . "servers` ADD `pushover` ENUM( 'yes','no' ) NOT NULL DEFAULT 'yes' AFTER `sms`;";
$queries[] = "ALTER TABLE `" . PSM_DB_PREFIX . "log` CHANGE `type` `type` ENUM( 'status', 'email', 'sms', 'pushover' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;";
$queries[] = "ALTER TABLE `" . PSM_DB_PREFIX . "servers` ADD `timeout` smallint(1) unsigned NULL DEFAULT NULL;";
$queries[] = "CREATE TABLE IF NOT EXISTS `" . PSM_DB_PREFIX . "users_preferences` (
`user_id` int(11) unsigned NOT NULL,
@ -413,7 +415,7 @@ class Installer {
`value` varchar(255) NOT NULL,
PRIMARY KEY (`user_id`, `key`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;";
$queries[] = "ALTER TABLE `" . PSM_DB_PREFIX . "servers` ADD `timeout` smallint(1) unsigned NULL DEFAULT NULL;";
$this->execSQL($queries);
}
}

View File

@ -1,54 +0,0 @@
<?php
/**
* PHP Server Monitor
* Monitor your servers and websites.
*
* This file is part of PHP Server Monitor.
* 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
* along with PHP Server Monitor. If not, see <http://www.gnu.org/licenses/>.
*
* @package phpservermon
* @author Pepijn Over <pep@neanderthal-technology.com>
* @copyright Copyright (c) 2008-2014 Pepijn Over <pep@neanderthal-technology.com>
* @license http://www.gnu.org/licenses/gpl.txt GNU GPL v3
* @version Release: @package_version@
* @link http://www.phpservermonitor.org/
* @since phpservermon 3.0.0
**/
namespace psm\Util;
/**
* Pushover is not using namespaces so unable to load files in autoloader.
*/
require_once(PSM_PATH_VENDOR . '/Pushover/Pushover.php');
/**
* PSM Pushover utility
*
* The Pushover is an open source lib that can be found in vendor/Pushover.
*
* @see \Pushover
*/
class Pushover extends \Pushover {
/**
* Open new Pushover
*
* @param boolean $exceptions
*/
function __construct($exceptions = false) {
parent::__construct($exceptions);
}
}

View File

@ -164,22 +164,28 @@ class StatusNotifier {
);
}
$users = $this->getUsers($this->server_id);
if(empty($users)) {
return $notify;
}
// check if email is enabled for this server
if($this->send_emails && $this->server['email'] == 'yes') {
// send email
$this->notifyByEmail();
$this->notifyByEmail($users);
}
// check if sms is enabled for this server
if($this->send_sms && $this->server['sms'] == 'yes') {
// yay lets wake those nerds up!
$this->notifyByTxtMsg();
$this->notifyByTxtMsg($users);
}
// check if pushover is enabled for this server
if($this->send_pushover && $this->server['pushover'] == 'yes') {
// yay lets wake those nerds up!
$this->notifyByPushover();
$this->notifyByPushover($users);
}
return $notify;
@ -188,17 +194,12 @@ class StatusNotifier {
/**
* This functions performs the email notifications
*
* @param array $users
* @return boolean
*/
protected function notifyByEmail() {
protected function notifyByEmail($users) {
$userlist = array();
$users = $this->getUsers($this->server_id);
if (empty($users)) {
return false;
}
// build mail object with some default values
$mail = psm_build_mail();
$mail->Subject = psm_parse_msg($this->status_new, 'email_subject', $this->server);
@ -226,53 +227,43 @@ class StatusNotifier {
/**
* This functions performs the pushover notifications
*
* @param array $users
* @return boolean
*/
protected function notifyByPushover() {
protected function notifyByPushover($users) {
$userlist = array();
$users = $this->getUsers($this->server_id);
if (empty($users)) {
return false;
}
// build pushover object with some default values
$pushover = psm_build_pushover();
if($this->status_new === true)
{
if($this->status_new === true) {
$pushover->setPriority(0);
}else
{
} else {
$pushover->setPriority(2);
$pushover->setRetry(300); //Used with Priority = 2; Pushover will resend the notification every 60 seconds until the user accepts.
$pushover->setExpire(3600); //Used with Priority = 2; Pushover will resend the notification every 60 seconds for 3600 seconds. After that point, it stops sending notifications.
}
//$pushover->setCallback('http://some.url/runscript.php'); // The callback parameter must be a URL (HTTP or HTTPS) that is reachable from the Internet that our servers will call out to as soon as the notification has been acknowledged.
$pushover->setTimestamp(time());
//$pushover->setDebug(true);
//$pushover->setSound('bike');
$this->server['MONITORURL']=$url = "http".(!empty($_SERVER['HTTPS'])?"s":"").":\/\/".$_SERVER['SERVER_NAME'];
$message = psm_parse_msg($this->status_new, 'pushover_message', $this->server);
$pushover->setTitle(psm_parse_msg($this->status_new, 'pushover_title', $this->server));
$pushover->setMessage(str_replace('<br/>', "\n", $message));
// @todo fix url when script is executed via CLI
// $pushover->setUrl($url);
// $pushover->setUrlTitle(psm_get_lang('system', 'title'));
$pushover->setUrl(psm_parse_msg($this->status_new, 'pushover_url', $this->server));
$pushover->setUrlTitle(psm_parse_msg($this->status_new, 'pushover_url_title', $this->server));
// go through empl
foreach ($users as $user) {
foreach($users as $user) {
if(trim($user['pushover_key']) == '') {
continue;
}
$userlist[] = $user['user_id'];
$pushover->setUser($user['pushover_key']);
$pushover->setDevice($user['pushover_device']);
if($user['pushover_device'] != '') {
$pushover->setDevice($user['pushover_device']);
}
$pushover->send();
}
if(psm_get_conf('log_pushover')) {
// save to log
psm_add_log($this->server_id, 'pushover', $message, implode(',', $userlist));
}
}
@ -280,16 +271,10 @@ class StatusNotifier {
/**
* This functions performs the text message notifications
*
* @return unknown
* @param array $users
* @return boolean
*/
protected function notifyByTxtMsg() {
// send sms to all users for this server using defined gateway
$users = $this->getUsers($this->server_id);
if (empty($users)) {
return false;
}
protected function notifyByTxtMsg($users) {
$sms = psm_build_sms();
if(!$sms) {
return false;

50
src/templates/config/config.tpl.html Executable file → Normal file
View File

@ -5,7 +5,6 @@
<li class="{email_active}"><a href="#config-email" data-toggle="tab">{label_tab_email}</a></li>
<li class="{sms_active}"><a href="#config-sms" data-toggle="tab">{label_tab_sms}</a></li>
<li class="{pushover_active}"><a href="#config-pushover" data-toggle="tab">{label_tab_pushover}</a></li>
<li class="{logging_active}"><a href="#config-logging" data-toggle="tab">{label_tab_log}</a></li>
</ul>
<div class="tab-content well">
<div id="config-general" class="tab-pane {general_active}">
@ -34,6 +33,8 @@
<p class="help-block">{label_auto_refresh_servers}</p>
</div>
</div>
</fieldset>
<fieldset>
<legend>{label_settings_notification}</legend>
<div class="control-group">
<label class="control-label" for="alert_type">{label_alert_type}</label>
@ -46,6 +47,15 @@
<p class="help-block">{label_alert_type_description}</p>
</div>
</div>
</fieldset>
<fieldset>
<legend>{label_settings_log}</legend>
<div class="control-group">
<div class="controls">
<label class="checkbox"><input type="checkbox" id="log_status" name="log_status[]" {log_status_checked} /> {label_log_status}</label>
<p class="help-block">{label_log_status_description}</p>
</div>
</div>
<div class="form-actions">
<button class="btn btn-success" type="submit" name="general_submit">{label_save}</button>
</div>
@ -59,6 +69,11 @@
<label class="checkbox" for="email_status"><input type="checkbox" id="email_status" name="email_status[]" {email_status_checked} /> {label_email_status}</label>
</div>
</div>
<div class="control-group">
<div class="controls">
<label class="checkbox"><input type="checkbox" id="log_email" name="log_email[]" {log_email_checked} /> {label_log_email}</label>
</div>
</div>
<div class="control-group">
<label class="control-label" for="email_from_name">{label_email_from_name}</label>
<div class="controls">
@ -114,6 +129,11 @@
<label class="checkbox" for="sms_status"><input type="checkbox" id="sms_status" name="sms_status[]" {sms_status_checked} /> {label_sms_status}</label>
</div>
</div>
<div class="control-group">
<div class="controls">
<label class="checkbox"><input type="checkbox" id="log_sms" name="log_sms[]" {log_sms_checked} /> {label_log_sms}</label>
</div>
</div>
<div class="control-group">
<label class="control-label" for="sms_gateway">{label_sms_gateway}</label>
<div class="controls">
@ -166,6 +186,11 @@
<label class="checkbox" for="pushover_status"><input type="checkbox" id="pushover_status" name="pushover_status[]" {pushover_status_checked} /> {label_pushover_status}</label>
</div>
</div>
<div class="control-group">
<div class="controls">
<label class="checkbox"><input type="checkbox" id="log_pushover" name="log_pushover[]" {log_pushover_checked} /> {label_log_pushover}</label>
</div>
</div>
<div class="control-group">
<label class="control-label" for="pushover_api">{label_pushover_api_token}</label>
<div class="controls">
@ -173,31 +198,10 @@
</div>
</div>
<div class="form-actions">
<button class="btn btn-success" type="submit">{label_save}</button>
<button class="btn btn-success" type="submit" name="pushover_submit">{label_save}</button>
</div>
</fieldset>
</div>
<div id="config-logging" class="tab-pane">
<fieldset>
<legend>{label_settings_log}</legend>
<div class="control-group">
<label class="checkbox"><input type="checkbox" id="log_status" name="log_status[]" {log_status_checked} /> {label_log_status}</label>
<p class="help-block">{label_log_status_description}</p>
</div>
<div class="control-group">
<label class="checkbox"><input type="checkbox" id="log_email" name="log_email[]" {log_email_checked} /> {label_log_email}</label>
</div>
<div class="control-group">
<label class="checkbox"><input type="checkbox" id="log_sms" name="log_sms[]" {log_sms_checked} /> {label_log_sms}</label>
</div>
<div class="control-group">
<label class="checkbox"><input type="checkbox" id="log_pushover" name="log_pushover[]" {log_pushover_checked} /> {label_log_pushover}</label>
</div>
<div class="form-actions">
<button class="btn btn-success" type="submit" name="logging_submit">{label_save}</button>
</div>
</fieldset>
</div>
</div>
</form>
<!--%%tpl_config-->

0
src/templates/install/install.tpl.html Executable file → Normal file
View File

0
src/templates/main.tpl.html Executable file → Normal file
View File

0
src/templates/main_sidebar.tpl.html Executable file → Normal file
View File

0
src/templates/server/log.tpl.html Executable file → Normal file
View File

View File

@ -10,9 +10,6 @@
<th class="hidden-phone">{label_rtime}</th>
<th class="hidden-phone">{label_last_online}</th>
<th class="hidden-phone">{label_monitoring}</th>
<th class="visible-desktop">{label_email}</th>
<th class="visible-desktop">{label_sms}</th>
<th class="visible-desktop">{label_pushover}</th>
<th class="hidden-phone">{label_action}</th>
</tr>
</thead>
@ -27,10 +24,7 @@
<td class="nowrap visible-desktop"><div class="table-cell-title">{type}</div></td>
<td class="nowrap hidden-phone"><div class="table-cell-title">{rtime} s</div></td>
<td class="nowrap hidden-phone"><div class="table-cell-title">{last_online}</div></td>
<td class="tight visible-tablet"><div class="table-cell-title"><i class="{active_icon}" title="{active_title}"></i> <i class="{email_icon}" title="{label_email}"></i> <i class="{sms_icon}" title="{label_sms}"></i></div></td>
<td class="tight visible-desktop"><div class="table-cell-title">{active}</div></td>
<td class="tight visible-desktop"><div class="table-cell-title">{email}</div></td>
<td class="tight visible-desktop"><div class="table-cell-title">{sms}</div></td>
<td class="tight hidden-phone"><div class="table-cell-title"><i class="{active_icon}" title="{active_title}"></i> <i class="{email_icon}" title="{label_email}"></i> <i class="{sms_icon}" title="{label_sms}"></i> <i class="{pushover_icon}" title="Pushover"></i></div></td>
<td class="tight hidden-phone">
<div class="table-cell-title">
<a class="btn btn-small" href="index.php?mod=server&amp;action=view&amp;id={server_id}"><i class="icon-chart"></i></a>
@ -52,7 +46,7 @@
<div class="table-row">
<div class="table-cell"><i class="{type_icon}" title="{type}"></i> {ip_short}</div>
<div class="table-cell tight">
<i class="{active_icon}" title="{active_title}"></i> <i class="{email_icon}" title="{label_email}"></i> <i class="{sms_icon}" title="{label_sms}"></i>
<i class="{active_icon}" title="{active_title}"></i> <i class="{email_icon}" title="{label_email}"></i> <i class="{sms_icon}" title="{label_sms}"></i> <i class="{pushover_icon}" title="Pushover"></i>
</div>
</div>
</div>
@ -142,7 +136,7 @@
</div>
</div>
<div class="control-group">
<label class="control-label" for="pushover">{label_send_pushover}</label>
<label class="control-label" for="pushover">{label_pushover}</label>
<div class="controls">
<select id="pushover" name="pushover">
<option value="yes" {edit_pushover_selected_yes}>{label_yes}</option>

0
src/templates/server/status.tpl.html Executable file → Normal file
View File

View File

@ -68,7 +68,7 @@
<td>{sms}</td>
</tr>
<tr>
<td>{label_send_pushover}:</td>
<td>{label_pushover}:</td>
<td>{pushover}</td>
</tr>
<tr>

0
src/templates/user/login.tpl.html Executable file → Normal file
View File

0
src/templates/user/profile.tpl.html Executable file → Normal file
View File

20
src/templates/user/user.tpl.html Executable file → Normal file
View File

@ -7,7 +7,6 @@
<th class="visible-desktop">{label_level}</th>
<th class="hidden-phone">{label_email}</th>
<th class="hidden-phone">{label_mobile}</th>
<th class="hidden-pushover">{label_pushover}</th>
<th class="hidden-phone">{label_servers}</th>
<th class="hidden-phone tight">{label_action}</th>
</tr>
@ -15,13 +14,6 @@
<tbody>
<!--%tpl_repeat_users-->
<tr>
<td>{name}</td>
<td>{user_name}</td>
<td>{label_level_{level}}</td>
<td>{mobile}</td>
<td>{pushover_device}</td>
<td>{email}</td>
<td>{emp_servers}</td>
<td>
<div class="table-body">
<div class="table-cell-title">
@ -118,6 +110,12 @@
<input type="text" id="email" name="email" value="{edit_value_email}" maxlength="255" required>
</div>
</div>
<div class="control-group">
<label class="control-label" for="mobile">{label_mobile}</label>
<div class="controls">
<input type="text" id="mobile" name="mobile" value="{edit_value_mobile}" maxlength="15" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="pushover_key">{label_pushover_key}</label>
<div class="controls">
@ -130,12 +128,6 @@
<input type="text" id="pushover_device" name="pushover_device" value="{edit_value_pushover_device}" maxlength="255" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="email">{label_email}</label>
<div class="controls">
<input type="text" id="mobile" name="mobile" value="{edit_value_mobile}" maxlength="15" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="servers[]">{label_servers}</label>
<div class="controls">

View File

@ -560,3 +560,7 @@ legend{
.icon-admin {
background-position: -48px -168px;
}
.icon-pushover {
background-position: -72px -168px;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

View File

@ -1,452 +0,0 @@
<?php
/**
* php-pushover
*
* https://github.com/kryap/php-pushover
*
* PHP service wrapper for the pushover.net API: https://pushover.net/api
*
* @author Chris Schalenborgh <chris.s@kryap.com>
* @version 0.2
* @package php-pushover
* @example test.php
* @link https://pushover.net/api
* @license BSD License
*/
class Pushover
{
// api url
const API_URL = 'https://api.pushover.net/1/messages.xml';
/**
* Application API token
*
* @var string
*/
private $_token;
/**
* User API token
*
* @var string
*/
private $_user;
/**
* Turn on/off debug mode
*
* @var bool
*/
private $_debug = false;
/**
* Title of the message
*
* @var string
*/
private $_title;
/**
* The message itself (up to 512 characters)
*
* @var string
*/
private $_message;
/**
* Timestamp in Unix timestamp format
*
* @var int
*/
private $_timestamp;
/**
* User's device (user specific)
*
* @var string
*/
private $_device;
/**
* Priority of the message. Can be 0, 1 or 2. High-priority messages (1) override a user's "quiet hours" setting and will always be delivered any time they are received. High priority messages are highlighted in red in the Android and iOS clients. Emergency Priority (2) messages work similar to High-Priority messages, but they are repeated until the message is acknowledged by the user.
*
* @var string
*/
private $_priority = 0;
/**
* Include a Supplementary URL (up to 200 characters)
*
* @var string
*/
private $_url;
/**
* Title of the included URL (up to 50 characters)
*
* @var string
*/
private $_url_title;
/**
* The Retry parameter is only used when the Priority is set to 2 (or emergency-priority), and specifies how often (in seconds) the Pushover servers will send the same notification to the user. In a situation where your user might be in a noisy environment or sleeping, retrying the notification (with sound and vibration) will help get his or her attention. This parameter must have a value of at least 30 seconds between retries.
*
* @var int
*/
private $_retry;
/**
* The expire parameter is only used when the Priority is set to 2 (or emergency-priority), and specifies how many seconds your notification will continue to be retried for. If the notification has not been acknowledged in expire seconds, it will be marked as expired and will stop being sent to the user. This parameter must have a maximum value of at most 86400 seconds (24 hours).
*
* @var int
*/
private $_expire;
/**
* The optional callback parameter may be supplied with a publicly-accessible URL that our servers will send a request to when the user has acknowledged your notification.
*
* @var string
*/
private $_callback;
/**
* The sound parameter. Get an up-to-date sound list from https://api.pushover.net/1/sounds.json?token=
*
* @var int
*/
private $_sound;
/**
* Default constructor
*/
public function __construct () {
}
/**
* Set API token
*
* @param string $token Your app API key.
*
* @return void
*/
public function setToken ($token) {
$this->_token = (string)$token;
}
/**
* Get API token
*
* @return string
*/
public function getToken () {
return $this->_token;
}
/**
* Set API user
*
* @param string $user The user's API key.
*
* @return void
*/
public function setUser ($user) {
$this->_user = (string)$user;
}
/**
* Get API user
*
* @return string
*/
public function getUser () {
return $this->_user;
}
/**
* Set message title
*
* @param string $title Title of push notification.
*
* @return void
*/
public function setTitle ($title) {
$this->_title = (string)$title;
}
/**
* Get message title
*
* @return string
*/
public function getTitle () {
return $this->_title;
}
/**
* Set Retry Time
*
* @param int $retry The retry time (in seconds). Must have a value of at least 30 seconds.
*/
public function setRetry ($retry) {
$this->_retry = (int)$retry;
}
/**
* Get Retry Time
*
* @return int
*/
public function getRetry() {
return $this->_retry;
}
/**
* Set Expire Time
*
* @param int $expire The expiry time (in seconds). Must have a maximum value of at most, 86400 seconds.
*/
public function setExpire ($expire) {
$this->_expire = (int)$expire;
}
/**
* Get Expire Time
*
* @return string
*/
public function getExpire () {
return $this->_expire;
}
/**
* Set Callback URL
*
* @param string $callback a publically-accessible URL that Pushover sends a request to when the user has acknowledged your notification.
*/
public function setCallback ($callback) {
$this->_callback = $callback;
}
/**
* Get Callback URL
*
* @return int
*/
public function getCallback() {
return $this->_callback;
}
/**
* Set message
*
* @param string $msg Message of push notification.
*
* @return void
*/
public function setMessage ($msg) {
$this->_message = (string)$msg;
}
/**
* Get message
*
* @return string
*/
public function getMessage () {
return $this->_message;
}
/**
* Set device
*
* @param string $device Leave this empty if you want to send to all user's devices. This can be user specific!
*
* @return void
*/
public function setDevice ($device) {
$this->_device = (string)$device;
}
/**
* Get device
*
* @return string
*/
public function getDevice () {
return $this->_device;
}
/**
* Set timestamp
*
* Messages are stored on the Pushover servers with a timestamp of when they were initially received through the API. This timestamp is sent to and shown on client devices, and messages are listed in order of these timestamps. In most cases, this default timestamp is acceptable. This is not for scheduling!
*
* @param int $time dispaly time on device
*
* @return void
*/
public function setTimestamp ($time) {
$this->_timestamp = (int)$time;
}
/**
* Get timestamp
*
* @return int
*/
public function getTimestamp () {
return $this->_timestamp;
}
/**
* Set priority (-1, 0 or 1)
*
* -1 Low priority notifications.
* 0 Default.
* 1 triggers a high-priority alert that always generates sound and vibration.
* 2 triggers the same high-priority alert that #1 does; but is repeated until the notification is acknowledged by the user.
*
* @param int $priority priority level.
*
* @return void
*/
public function setPriority ($priority) {
$this->_priority = (int)$priority;
}
/**
* Get priority
*
* @return int
*/
public function getPriority () {
return $this->_priority;
}
/**
* Set url
*
* @param string $url Add an url to your notification.
*
* @return void
*/
public function setUrl ($url) {
$this->_url = (string)$url;
}
/**
* Get url
*
* @return string
*/
public function getUrl () {
return $this->_url;
}
/**
* Set url title
*
* @param string $url_title A title if you want to show a text instead of the actual url.
*
* @return void
*/
public function setUrlTitle ($url_title) {
$this->_url_title = (string)$url_title;
}
/**
* Get url title
*
* @return string
*/
public function getUrlTitle () {
return $this->_url_title;
}
/**
* Set debug mode
*
* @param bool $debug Enable this to receive detailed input and output info.
*
* @return void
*/
public function setDebug ($debug) {
$this->_debug = (boolean)$debug;
}
/**
* Get debug mode
*
* @return bool
*/
public function getDebug () {
return $this->_debug;
}
/**
* Set sound
*
* @param string $sound If no sound parameter is specified, the user's default tone will play. If the user has not chosen a custom sound, the standard Pushover sound will play.
*
* @return void
*/
public function setSound ($sound) {
$this->_sound = (string)$sound;
}
/**
* Get sound
*
* @return string
*/
public function getSound () {
return $this->_sound;
}
/**
* Send message to Pushover API
*
* @return bool
*/
public function send() {
if(!Empty($this->_token) && !Empty($this->_user) && !Empty($this->_message)) {
if(!isset($this->_timestamp)) $this->setTimestamp(time());
$c = curl_init();
curl_setopt($c, CURLOPT_URL, self::API_URL);
curl_setopt($c, CURLOPT_HEADER, false);
/*
if possible, set CURLOPT_SSL_VERIFYPEER to true..
- http://www.tehuber.com/phps/cabundlegen.phps
*/
curl_setopt($c, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
curl_setopt($c, CURLOPT_POSTFIELDS, array(
'token' => $this->getToken(),
'user' => $this->getUser(),
'title' => $this->getTitle(),
'message' => $this->getMessage(),
'device' => $this->getDevice(),
'priority' => $this->getPriority(),
'timestamp' => $this->getTimestamp(),
'expire' => $this->getExpire(),
'retry' => $this->getRetry(),
'callback' => $this->getCallback(),
'url' => $this->getUrl(),
'sound' => $this->getSound(),
'url_title' => $this->getUrlTitle()
));
$response = curl_exec($c);
$xml = simplexml_load_string($response);
if($this->getDebug()) {
return array('output' => $xml, 'input' => $this);
}
else {
return ($xml->status == 1) ? true : false;
}
}
}
}
?>