Class
Symbiosis::Monitor::StateDB
In:
monit/lib/symbiosis/monitor/state_db.rb
Parent:
Object
Methods
all_results_for
clean
create_table
failed_since
insert
last_failure
last_result_for
last_success
new
record
table_exists?
update
Constants
VALID_STATES
=
%w(OK USAGEFAIL TEMPFAIL FAIL)
Attributes
dbh
[R]
For testing.
Public Class methods
new
(fn = '/var/lib/symbiosis/monit.db')
Public Instance methods
all_results_for
(test)
clean
(n_days = 30, now = Time.now)
Removes old records from the database, that are were created more than n_days ago.
create_table
()
failed_since
(test)
insert
(test, exitstatus, output, timestamp)
last_failure
(test)
last_result_for
(test)
last_success
(test)
record
(test, exitstatus, output, timestamp = Time.now)
table_exists?
()
update
(test, exitstatus, output, timestamp, last_timestamp)
[Validate]