lib/ring/sqa/alarm.rb in ring-sqa-0.0.20 vs lib/ring/sqa/alarm.rb in ring-sqa-0.0.21
- old
+ new
@@ -34,15 +34,16 @@
@nodes = nodes
@methods = []
@methods << Email.new if CFG.email.to?
@methods << UDP2IRC.new if CFG.irc.password?
@hostname = Ring::SQA::CFG.host.name
+ @afi = Ring::SQA::CFG.afi
@alarm = false
end
def compose_message alarm_buffer
exceeding_nodes = alarm_buffer.exceeding_nodes
- msg = {short: "#{@hostname}: raising alarm - #{exceeding_nodes.size} new nodes down"}
+ msg = {short: "#{@hostname}: raising #{@afi} alarm - #{exceeding_nodes.size} new nodes down"}
exceeding_nodes = exceeding_nodes.map { |node| @nodes.get node }
nodes_list = ''
exceeding_nodes.sort_by{ |node| node[:cc] }.each do |node|
nodes_list << "- %-35s %15s AS%-6s %2s\n" % [node[:name], node[:ip], node[:as], node[:cc]]