Skip to content

Commit

Permalink
Merge pull request #1310 from f0o/issue-1291
Browse files Browse the repository at this point in the history
Replace Alert-ID with Alert-Name/Rule in titles
  • Loading branch information
laf committed Jun 20, 2015
2 parents 5cd63f1 + b54dc28 commit 0e4e478
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions alerts.php
Expand Up @@ -329,7 +329,7 @@ function DescribeAlert($alert) {
$obj['device_id'] = $alert['device_id'];
$extra = $alert['details'];
if( $alert['state'] >= 1 ) {
$obj['title'] = 'Alert for device '.$device['hostname'].' Alert-ID #'.$alert['id'];
$obj['title'] = 'Alert for device '.$device['hostname'].' - '.($alert['name'] ? $alert['name'] : $alert['rule']);
if( $alert['state'] == 2 ) {
$obj['title'] .= " got acknowledged";
} elseif( $alert['state'] == 3 ) {
Expand All @@ -352,7 +352,7 @@ function DescribeAlert($alert) {
return false;
}
$extra = json_decode(gzuncompress($id['details']),true);
$obj['title'] = 'Device '.$device['hostname'].' recovered from Alert-ID #'.$id['id'];
$obj['title'] = 'Device '.$device['hostname'].' recovered from '.($alert['name'] ? $alert['name'] : $alert['rule']);
$obj['elapsed'] = TimeFormat(strtotime($alert['time_logged'])-strtotime($id['time_logged']));
$obj['id'] = $id['id'];
$obj['faults'] = false;
Expand Down

0 comments on commit 0e4e478

Please sign in to comment.