Skip to content

Commit

Permalink
added time stamps to subject and data file
Browse files Browse the repository at this point in the history
  • Loading branch information
Troy Stribling committed Jun 8, 2011
1 parent ce33d01 commit 86ec819
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bin/bf_daily_status.rb
Expand Up @@ -54,7 +54,8 @@
end

#----------------------------------------------------------------------------------------------------
file = "ENVIRONMENT,SERVER,IP,ERROR MSG,TRIES,TRANSACTION(MS),UPTIME(HRS)\n"
report_time = Time.now
file = "#{report_time.strftime("%Y-%m-%d %H:%M")}\nENVIRONMENT,SERVER,IP,ERROR MSG,TRIES,TRANSACTION(MS),UPTIME(HRS)\n"
file += agg_response.inject([]) do |f, (env, vms)|
vms.each do |(vm, data)|
f << [env, vm, data[:ip], data[:error_msg] || 'NO ERROR', data[:tries] || 'NA', data[:elapsed_time_ms] || 'NA', data[:data] || 'NA'].join(',')
Expand All @@ -63,5 +64,5 @@

#----------------------------------------------------------------------------------------------------
puts "SENDING REPORT TO: #{EMAIL_CONFIG['msg']['to'].join(', ')}"
send_email(EMAIL_CONFIG['msg']['to'].join(', '), EMAIL_CONFIG['msg']['subject'] + " (#{short_msg})", msg, "status-#{Time.now.strftime("%Y-%m-%d")}.csv", file, EMAIL_CONFIG['server'])
send_email(EMAIL_CONFIG['msg']['to'].join(', '), EMAIL_CONFIG['msg']['subject'] + " (#{short_msg}) #{report_time.strftime("%Y-%m-%d %H:%M")}", msg, "status-#{report_time.strftime("%Y-%m-%d")}.csv", file, EMAIL_CONFIG['server'])
puts "ENDING RUN: #{Time.now.to_s}"

0 comments on commit 86ec819

Please sign in to comment.