Class: NagiosCheckResque::FailedJobsCheck
- Inherits:
-
Object
- Object
- NagiosCheckResque::FailedJobsCheck
- Includes:
- NagiosCheck
- Defined in:
- lib/nagios_check_resque/failed_jobs_check.rb
Overview
Warn if there are failed jobs
Instance Method Summary collapse
- #check ⇒ Object
-
#initialize(resque = ResqueAdapter.new) ⇒ FailedJobsCheck
constructor
A new instance of FailedJobsCheck.
Constructor Details
#initialize(resque = ResqueAdapter.new) ⇒ FailedJobsCheck
Returns a new instance of FailedJobsCheck.
15 16 17 |
# File 'lib/nagios_check_resque/failed_jobs_check.rb', line 15 def initialize(resque = ResqueAdapter.new) @resque = resque end |
Instance Method Details
#check ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/nagios_check_resque/failed_jobs_check.rb', line 19 def check @resque.setup(redis_url: ['redis-url']) failed_jobs_count = @resque.failed_count ("#{failed_jobs_count} failed jobs") store_value(:failed, failed_jobs_count) end |