Project

General

Profile

« Previous | Next » 

Revision 459e0feb

Added by Paul Kelly almost 14 years ago

  • ID 459e0feb5c15f2ff8c175e2d46e372b4d83c6a4c

Fixes #249 - Remove AS from reports

Added a searchbar for hostname, reporting period and the type of report.

View differences:

app/models/report.rb
# with_changes
named_scope :with_changes, {:conditions => "status != 0"}
def self.per_page
20
end
# a method that save the report values (e.g. values from METRIC)
# it is not supported to edit status values after it has been written once.
def status=(st)
......
"#{host.name} / #{reported_at.to_s}"
end
def config_retrival
def config_retrieval
t = validate_meteric("time", :config_retrieval)
t.round_with_precision(2) if t
end
......
# 1. It might be auto imported, therefore might not be valid (e.g. missing partition table etc)
# 2. We want this to be fast and light on the db.
# at this point, the report is important, not as much of the host
host.save_with_validation(perform_validation = false)
host.save_with_validation(false)
# and save our report
self.create! :host => host, :reported_at => report.time.utc, :log => report, :status => st
rescue Exception => e
logger.warn "failed to process report for #{report.host} due to:#{e}"
logger.warn "Failed to process report for #{report.host} due to:#{e}"
false
end
end

Also available in: Unified diff