mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-30 16:14:21 +02:00
Add transport to alert_template vars
This commit is contained in:
+3
-2
@@ -121,8 +121,6 @@ function IssueAlert($alert) {
|
|||||||
$obj = DescribeAlert($alert);
|
$obj = DescribeAlert($alert);
|
||||||
if (is_array($obj)) {
|
if (is_array($obj)) {
|
||||||
echo 'Issuing Alert-UID #'.$alert['id'].'/'.$alert['state'].': ';
|
echo 'Issuing Alert-UID #'.$alert['id'].'/'.$alert['state'].': ';
|
||||||
$msg = FormatAlertTpl($obj);
|
|
||||||
$obj['msg'] = $msg;
|
|
||||||
if (!empty($config['alert']['transports'])) {
|
if (!empty($config['alert']['transports'])) {
|
||||||
ExtTransports($obj);
|
ExtTransports($obj);
|
||||||
}
|
}
|
||||||
@@ -336,6 +334,9 @@ function ExtTransports($obj) {
|
|||||||
$opts = array_filter($opts);
|
$opts = array_filter($opts);
|
||||||
}
|
}
|
||||||
if (($opts === true || !empty($opts)) && $opts != false && file_exists($config['install_dir'].'/includes/alerts/transport.'.$transport.'.php')) {
|
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.' => ';
|
echo $transport.' => ';
|
||||||
eval('$tmp = function($obj,$opts) { global $config; '.file_get_contents($config['install_dir'].'/includes/alerts/transport.'.$transport.'.php').' return false; };');
|
eval('$tmp = function($obj,$opts) { global $config; '.file_get_contents($config['install_dir'].'/includes/alerts/transport.'.$transport.'.php').' return false; };');
|
||||||
$tmp = $tmp($obj,$opts);
|
$tmp = $tmp($obj,$opts);
|
||||||
|
|||||||
Reference in New Issue
Block a user