From 719c2bc63e5ee0dbea9522eaeb76e7a24b50a1ff Mon Sep 17 00:00:00 2001 From: James Campbell Date: Thu, 4 Jun 2015 21:55:26 +1000 Subject: [PATCH 1/3] Testing log_event for issued alerts --- alerts.php | 1 + 1 file changed, 1 insertion(+) diff --git a/alerts.php b/alerts.php index 6af7370b3..2a46e60f5 100755 --- a/alerts.php +++ b/alerts.php @@ -252,6 +252,7 @@ function ExtTransports($obj) { eval('$tmp = function($obj,$opts) { global $config; '.file_get_contents($config['install_dir']."/includes/alerts/transport.".$transport.".php").' };'); $tmp = $tmp($obj,$opts); echo ($tmp ? "OK" : "ERROR")."; "; + log_event("Issued ".$severity." alert for rule ".$obj['name']." to transport".$transport,$obj['hostname'],"Alerts"); } } } From 45d7ff0a7314c24b70d1bc1435c1a42487a80a3b Mon Sep 17 00:00:00 2001 From: James Campbell Date: Thu, 4 Jun 2015 22:13:45 +1000 Subject: [PATCH 2/3] Added log_event for issued alerts --- alerts.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alerts.php b/alerts.php index 2a46e60f5..93da619b2 100755 --- a/alerts.php +++ b/alerts.php @@ -252,7 +252,7 @@ function ExtTransports($obj) { eval('$tmp = function($obj,$opts) { global $config; '.file_get_contents($config['install_dir']."/includes/alerts/transport.".$transport.".php").' };'); $tmp = $tmp($obj,$opts); echo ($tmp ? "OK" : "ERROR")."; "; - log_event("Issued ".$severity." alert for rule ".$obj['name']." to transport".$transport,$obj['hostname'],"Alerts"); + log_event("Issued ".$obj['severity']." alert for rule '".$obj['name']."' to transport '".$transport."'",$obj['device_id']); } } } From f56c8c4425303035c89ac91e993a9ecef5be83f7 Mon Sep 17 00:00:00 2001 From: James Campbell Date: Thu, 4 Jun 2015 22:15:22 +1000 Subject: [PATCH 3/3] Fixed indentation --- alerts.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alerts.php b/alerts.php index 93da619b2..458fc330a 100755 --- a/alerts.php +++ b/alerts.php @@ -252,7 +252,7 @@ function ExtTransports($obj) { eval('$tmp = function($obj,$opts) { global $config; '.file_get_contents($config['install_dir']."/includes/alerts/transport.".$transport.".php").' };'); $tmp = $tmp($obj,$opts); echo ($tmp ? "OK" : "ERROR")."; "; - log_event("Issued ".$obj['severity']." alert for rule '".$obj['name']."' to transport '".$transport."'",$obj['device_id']); + log_event("Issued ".$obj['severity']." alert for rule '".$obj['name']."' to transport '".$transport."'",$obj['device_id']); } } }