Browse files

default :host/:cluster on an alert

  • Loading branch information...
1 parent e83f4d1 commit a30eda8b2609bedbd915e9e0186fe68f3cc2b541 @fetep committed May 29, 2012
Showing with 3 additions and 1 deletion.
  1. +2 −0 lib/cepmon/eventlistener.rb
  2. +1 −1 views/alert_row.erb
View
2 lib/cepmon/eventlistener.rb
@@ -61,6 +61,8 @@ def record_alert(vars, statement_name, exchange)
if @alerts[key]
@alerts[key].update(vars)
else
+ vars[:cluster] ||= '*' # for global-level aggregation
+ vars[:host] ||= '*' # for cluster-level aggregation
alert = CEPMon::Alert.new(vars)
@config.logger.info("NEW ALERT: #{statement_name}: cluster=#{alert.data[:cluster]} host=#{alert.data[:host]} reason=#{alert.reason}")
@config.logger.debug("NEW ALERT: json: #{alert.to_json}")
View
2 views/alert_row.erb
@@ -23,7 +23,7 @@
<%= @alert.cluster %>
</td>
<td>
- <%= @alert.host ? @alert.host.tr("_", ".") : "*" %>
+ <%= @alert.host.tr("_", ".") %>
</td>
<td>
<%=h @alert.reason %>

0 comments on commit a30eda8

Please sign in to comment.