def alerting_checks(opts = {})
        time = opts[:time] || Time.now
        init_scope = Flapjack::Data::Check.intersect(:enabled => true, :alertable => true)
        ret = checks(:initial_scope => init_scope,
                     :time => Time.now)

        return Flapjack::Data::Check.empty if ret.empty?

        start_range = Zermelo::Filters::IndexRange.new(nil, time, :by_score => true)
        end_range   = Zermelo::Filters::IndexRange.new(time, nil, :by_score => true)

        sched_maint_check_ids = Flapjack::Data::ScheduledMaintenance.
          intersect(:start_time => start_range, :end_time => end_range).
          associated_ids_for(:check).values

        ret = ret.diff(:id => sched_maint_check_ids) unless sched_maint_check_ids.empty?

        unsched_maint_check_ids = Flapjack::Data::UnscheduledMaintenance.
          intersect(:start_time => start_range, :end_time => end_range).
          associated_ids_for(:check).values

        ret = ret.diff(:id => unsched_maint_check_ids) unless unsched_maint_check_ids.empty?
        ret
      end
this can be called from the API (with no args) or from notifier.rb
(which will pass an effective time)