Add #server_error as additional variable for webhooks
This commit is contained in:
parent
3120b68df1
commit
40f6ad9b53
|
@ -131,12 +131,11 @@ $sm_lang = array(
|
|||
'jabber_label' => 'Jabber',
|
||||
'jabber_description' => 'You Jabber account',
|
||||
'webhook' => 'Webhook',
|
||||
'webhook_description' => 'Send a json webhook to a certain endpoint. <br/> The json can be customized, e.g. {
|
||||
"text":"servermon: #message"}',
|
||||
'webhook_description' => 'Send a json webhook to a certain endpoint.',
|
||||
'webhook_url' => 'Webhook Url',
|
||||
'webhook_url_description' => 'Webhook public endpoint url, should start with https://.',
|
||||
'webhook_json' => 'Webhook JSON',
|
||||
'webhook_json_description' => 'Define a custom json, use #message as message variable, other variables are #server_ip, #server_label, #server_last_offline_duration and #status',
|
||||
'webhook_json_description' => 'Define a custom json, e.g. {"username": "servermon: #server_label" "text": "#server_ip is **#status**"}.<br>Available variables: #message, #server_error, #server_ip, #server_label, #server_last_offline_duration and #status',
|
||||
'delete_title' => 'Delete User',
|
||||
'delete_message' => 'Are you sure you want to delete user \'%1\'?',
|
||||
'deleted' => 'User deleted.',
|
||||
|
@ -315,7 +314,7 @@ $sm_lang = array(
|
|||
'webhook_url' => 'Webhook Url',
|
||||
'webhook_url_description' => 'Url to webhook endpoint',
|
||||
'webhook_json' => 'Webhook Json',
|
||||
'webhook_json_description' => 'Customized Json, use #message as message variable, other variables are #server_ip, #server_label, #server_last_offline_duration and #status.',
|
||||
'webhook_json_description' => 'Define a custom json. Available variables: #message, #server_error, #server_ip, #server_label, #server_last_offline_duration and #status',
|
||||
'pushover_status' => 'Allow sending Pushover messages',
|
||||
'pushover_description' => 'Pushover is a service that makes it easy to get real-time notifications. See <a href="https://pushover.net/" target="_blank">their website</a> for more info.',
|
||||
'pushover_clone_app' => 'Click here to create your Pushover app',
|
||||
|
|
|
@ -635,6 +635,7 @@ class StatusNotifier
|
|||
'#message' => $message,
|
||||
'#server_ip' => $this->server['ip'],
|
||||
'#server_label' => $this->server['label'],
|
||||
'#server_error' => $this->server['error'],
|
||||
'#server_last_offline_duration' => $this->status_new ? $this->server['last_offline_duration'] : '',
|
||||
'#status' => $this->status_new ? 'online' : 'offline'
|
||||
]);
|
||||
|
|
Loading…
Reference in New Issue