Revision 4173bd27
Added by Ohad Levy over 12 years ago
- ID 4173bd274bcc96ed5cb01002d7bdc0a80c6dd710
app/models/host.rb | ||
---|---|---|
((puppet_status >> #{BIT_NUM*METRIC.index("failed_restarts")} & #{MAX}) != 0)"
|
||
}
|
||
|
||
named_scope :without_error, { :conditions =>
|
||
"((puppet_status >> #{BIT_NUM*METRIC.index("failed")} & #{MAX}) = 0) and
|
||
((puppet_status >> #{BIT_NUM*METRIC.index("failed_restarts")} & #{MAX}) = 0)"
|
||
}
|
||
|
||
named_scope :with_changes, { :conditions => "(puppet_status > 0) and
|
||
((puppet_status >> #{BIT_NUM*METRIC.index("applied")} & #{MAX}) != 0) or
|
||
((puppet_status >> #{BIT_NUM*METRIC.index("restarted")} & #{MAX}) !=0)"
|
||
((puppet_status >> #{BIT_NUM*METRIC.index("restarted")} & #{MAX}) != 0)"
|
||
}
|
||
|
||
named_scope :successful, {:conditions => "puppet_status = 0"}
|
||
named_scope :without_changes, { :conditions =>
|
||
"((puppet_status >> #{BIT_NUM*METRIC.index("applied")} & #{MAX}) = 0) or
|
||
((puppet_status >> #{BIT_NUM*METRIC.index("restarted")} & #{MAX}) = 0)"
|
||
}
|
||
|
||
named_scope :successful, lambda { without_changes.without_error.scope(:find)}
|
||
|
||
named_scope :alerts_disabled, {:conditions => ["enabled = ?", false] }
|
||
|
||
named_scope :my_hosts, lambda {
|
Also available in: Unified diff
fixes #1135 - missing "good" systems with skipped resources in dashboard report