mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Update alerts.php
Update to make canopsis transport works. Canopsis transport use AMQP PHP libraries which needs to be installed and included at the begining of the transport but PHP doesn't allow this include to occured in an anonyous function.
This commit is contained in:
+7
-2
@@ -340,8 +340,13 @@ function ExtTransports($obj) {
|
||||
$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);
|
||||
if ($transport == "canopsis") {
|
||||
$tmp = eval ('global $config; '.file_get_contents($config['install_dir'].'/includes/alerts/transport.'.$transport.'.php').' return false;');
|
||||
}
|
||||
else {
|
||||
eval('$tmp = function($obj,$opts) { global $config; '.file_get_contents($config['install_dir'].'/includes/alerts/transport.'.$transport.'.php').' return false; };');
|
||||
$tmp = $tmp($obj,$opts);
|
||||
}
|
||||
$prefix = array( 0=>"recovery", 1=>$obj['severity']." alert", 2=>"acknowledgment" );
|
||||
$prefix[3] = &$prefix[0];
|
||||
$prefix[4] = &$prefix[0];
|
||||
|
||||
Reference in New Issue
Block a user