mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Merge pull request #3148 from ekoyle/alert_template_transport
Alert template transport
This commit is contained in:
@@ -121,8 +121,6 @@ function IssueAlert($alert) {
|
||||
$obj = DescribeAlert($alert);
|
||||
if (is_array($obj)) {
|
||||
echo 'Issuing Alert-UID #'.$alert['id'].'/'.$alert['state'].': ';
|
||||
$msg = FormatAlertTpl($obj);
|
||||
$obj['msg'] = $msg;
|
||||
if (!empty($config['alert']['transports'])) {
|
||||
ExtTransports($obj);
|
||||
}
|
||||
@@ -338,6 +336,9 @@ function ExtTransports($obj) {
|
||||
$opts = array_filter($opts);
|
||||
}
|
||||
if (($opts === true || !empty($opts)) && $opts != false && file_exists($config['install_dir'].'/includes/alerts/transport.'.$transport.'.php')) {
|
||||
$obj['transport'] = $transport;
|
||||
$msg = FormatAlertTpl($obj);
|
||||
$obj['msg'] = $msg;
|
||||
echo $transport.' => ';
|
||||
eval('$tmp = function($obj,$opts) { global $config; '.file_get_contents($config['install_dir'].'/includes/alerts/transport.'.$transport.'.php').' return false; };');
|
||||
$tmp = $tmp($obj,$opts);
|
||||
|
Reference in New Issue
Block a user