my_nagios 0.0.21 → 0.0.22
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/jobs/schedule_by_interval_job.rb +1 -1
- data/app/models/my_nagios/check.rb +4 -4
- data/app/views/my_nagios/checks/_check_row.haml +3 -0
- data/app/views/my_nagios/welcome/index.haml +1 -1
- data/db/migrate/20160915190233_add_retry_count_to_check.rb +5 -0
- data/lib/my_nagios/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 005a2d3a1d87debfa2bd09ba55382e2a01e57d00
|
4
|
+
data.tar.gz: 80224bda33b1880e06e95cb83733e4962cc035a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73ae5dece408756ae52ef4d1205cd782dfcf204684e99a3cd05fcc7bbc4f2b418303b443d0465627169c62996c04a4edeca8e8eb67b5ca04d4b46258b070ea95
|
7
|
+
data.tar.gz: 40fbece622f7f4a993f5158ac08366cf8459b022f6daae10eb95612319020a7b64724a71affc66527613b0f5f44dd7daaf264dcabde89da1c613dd83bfdcf05a
|
@@ -7,7 +7,7 @@ class ScheduleByIntervalJob
|
|
7
7
|
|
8
8
|
# Run each Check separately (new ssh connection for each check even common host)
|
9
9
|
if one_by_one
|
10
|
-
MyNagios::Check.where(interval: options['interval']).each do |check|
|
10
|
+
MyNagios::Check.enabled.not_snoozed.where(interval: options['interval']).each do |check|
|
11
11
|
MonitoringJob.perform_async(check)
|
12
12
|
end
|
13
13
|
|
@@ -23,10 +23,10 @@ module MyNagios
|
|
23
23
|
|
24
24
|
self.additional_command_result = ssh.exec!(self.additional_command) if not self.additional_command.blank? and status.eql?(:critical)
|
25
25
|
|
26
|
-
self.update(state: :completed, status: status, latest_state: result, latest_updated_at: Time.now)
|
26
|
+
self.update(state: :completed, status: status, latest_state: result, latest_updated_at: Time.now, retry_count: 0)
|
27
27
|
end
|
28
28
|
rescue => e
|
29
|
-
self.update(state: :completed, status: :info, latest_state: e, latest_updated_at: Time.now)
|
29
|
+
self.update(state: :completed, status: :info, latest_state: e, latest_updated_at: Time.now, retry_count: (self.retry_count + 1))
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
@@ -43,12 +43,12 @@ module MyNagios
|
|
43
43
|
|
44
44
|
check.additional_command_result = ssh.exec!(check.additional_command) if not check.additional_command.blank? and status.eql?(:critical)
|
45
45
|
|
46
|
-
check.update(state: :completed, status: status, latest_state: result, latest_updated_at: Time.now)
|
46
|
+
check.update(state: :completed, status: status, latest_state: result, latest_updated_at: Time.now, retry_count: 0)
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
50
|
rescue => e
|
51
|
-
check_list.each { |check| check.update(state: :completed, status: :info, latest_state: e, latest_updated_at: Time.now) }
|
51
|
+
check_list.each { |check| check.update(state: :completed, status: :info, latest_state: e, latest_updated_at: Time.now, retry_count: (check.retry_count + 1)) }
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
@@ -22,6 +22,9 @@
|
|
22
22
|
%span.label{ class: "label-#{status_to_label(check.status)}"}= check.status
|
23
23
|
=check.latest_state
|
24
24
|
|
25
|
+
- if check.retry_count > 0
|
26
|
+
%strong= "(retries count: #{check.retry_count})"
|
27
|
+
|
25
28
|
- if is_snooze
|
26
29
|
%div.snooze_for
|
27
30
|
Snooze for: #{check.snooze_for}
|
@@ -6,7 +6,7 @@
|
|
6
6
|
=form_tag group_action_path do
|
7
7
|
Please, set action for selected checks:
|
8
8
|
=select_tag :check_group_action, options_for_select(['Disable', 'Enable', 'Snooze for'])
|
9
|
-
=select_tag :snooze_time_select, options_for_select(['15 min', '30 min', '60
|
9
|
+
=select_tag :snooze_time_select, options_for_select([['15 min', '15'], ['30 min', '30'], ['1 h', '60'], ['3h', '180'], ['6h', '360'], ['12h', '720']])
|
10
10
|
=hidden_field_tag :group_action_check_ids
|
11
11
|
=submit_tag
|
12
12
|
|
data/lib/my_nagios/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: my_nagios
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.22
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vitaly Omelchenko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-09-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -196,6 +196,7 @@ files:
|
|
196
196
|
- db/migrate/20160601081654_add_regexp_to_check.rb
|
197
197
|
- db/migrate/20160621080454_additional_command.rb
|
198
198
|
- db/migrate/20160823134410_add_snooze_for_check.rb
|
199
|
+
- db/migrate/20160915190233_add_retry_count_to_check.rb
|
199
200
|
- lib/my_nagios.rb
|
200
201
|
- lib/my_nagios/engine.rb
|
201
202
|
- lib/my_nagios/version.rb
|