notifyme 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG ADDED
@@ -0,0 +1,5 @@
1
+ v0.2
2
+ auto restart the service by the restart_command if it's failed
3
+
4
+ v0.1-dev
5
+ the first dev-version.
data/lib/notifyme/log.rb CHANGED
@@ -54,6 +54,10 @@ module NotifyMe
54
54
  end
55
55
  end
56
56
 
57
+ def clean_log_history!(task)
58
+ @@log_history.delete(task.name) if @@log_history[task.name]
59
+ end
60
+
57
61
  protected
58
62
  def generate(task)
59
63
  method("to_#{task.log_format}").call task
@@ -1,6 +1,6 @@
1
1
  module NotifyMe
2
2
 
3
- VERSION = '1.1.0'
3
+ VERSION = '1.1.1'
4
4
  DEFAULT_CONFIG_FILE = "#{ENV['HOME']}/.notifyme/notifyme_config.rb"
5
5
 
6
6
  autoload :Task, 'notifyme/task'
@@ -180,10 +180,13 @@ end
180
180
  task.result = e.to_s
181
181
  end
182
182
 
183
- # works fine.
184
- return if task.result.to_s.empty?
183
+ # the task works fine.
184
+ if task.result.to_s.empty?
185
+ task.logger.clean_log_history! task
186
+ return
187
+ end
185
188
 
186
- # restart the command if need
189
+ # restart the command if needed
187
190
  begin
188
191
  task.restart_command.call if task.restart_command
189
192
  rescue Exception => e
data/notifyme_config.rb CHANGED
@@ -29,7 +29,7 @@ NotifyMe::Start.config do
29
29
  log_format :text
30
30
 
31
31
  # set nagios directory
32
- # nagios_directory "/usr/local/nagios"
32
+ # nagios_directory "/usr/lib/nagios/plugins"
33
33
 
34
34
  # add some tasks
35
35
 
metadata CHANGED
@@ -1,99 +1,109 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: notifyme
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.1.1
4
5
  prerelease:
5
- version: 1.1.0
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - xianhua.zhou
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2013-01-02 00:00:00 Z
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
12
+ date: 2013-01-15 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
16
15
  name: daemons
17
- prerelease: false
18
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
19
17
  none: false
20
- requirements:
21
- - - ">="
22
- - !ruby/object:Gem::Version
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
23
21
  version: 1.1.0
24
22
  type: :runtime
25
- version_requirements: *id001
26
- - !ruby/object:Gem::Dependency
27
- name: json_pure
28
23
  prerelease: false
29
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 1.1.0
30
+ - !ruby/object:Gem::Dependency
31
+ name: json_pure
32
+ requirement: !ruby/object:Gem::Requirement
30
33
  none: false
31
- requirements:
32
- - - ">="
33
- - !ruby/object:Gem::Version
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
34
37
  version: 1.4.2
35
38
  type: :runtime
36
- version_requirements: *id002
37
- - !ruby/object:Gem::Dependency
38
- name: http_request.rb
39
39
  prerelease: false
40
- requirement: &id003 !ruby/object:Gem::Requirement
40
+ version_requirements: !ruby/object:Gem::Requirement
41
41
  none: false
42
- requirements:
43
- - - ">="
44
- - !ruby/object:Gem::Version
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: 1.4.2
46
+ - !ruby/object:Gem::Dependency
47
+ name: http_request.rb
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
45
53
  version: 1.1.13
46
54
  type: :runtime
47
- version_requirements: *id003
48
- description: NotifyMe takes care more than one tasks and process their results for you, it's similar to *NIX's cronjob but can do more.
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: 1.1.13
62
+ description: NotifyMe takes care more than one tasks and process their results for
63
+ you, it's similar to *NIX's cronjob.
49
64
  email: xianhua.zhou@gmail.com
50
- executables:
65
+ executables:
51
66
  - notifyme_daemon
52
67
  - notifyme
53
68
  extensions: []
54
-
55
69
  extra_rdoc_files: []
56
-
57
- files:
58
- - lib/notifyme.rb
59
- - lib/notifyme/log.rb
70
+ files:
71
+ - lib/vendor/smtp_add_tls_support.rb
72
+ - lib/notifyme/check.rb
73
+ - lib/notifyme/log/file.rb
60
74
  - lib/notifyme/log/mail.rb
61
75
  - lib/notifyme/log/stdout.rb
62
- - lib/notifyme/log/file.rb
76
+ - lib/notifyme/log.rb
63
77
  - lib/notifyme/start.rb
64
- - lib/notifyme/check.rb
65
78
  - lib/notifyme/task.rb
66
- - lib/vendor/smtp_add_tls_support.rb
79
+ - lib/notifyme.rb
80
+ - CHANGELOG
67
81
  - INSTALL
68
82
  - notifyme_config.rb
69
83
  - bin/notifyme_daemon
70
84
  - bin/notifyme
71
85
  homepage: http://github.com/xianhuazhou/NotifyMe
72
86
  licenses: []
73
-
74
87
  post_install_message:
75
88
  rdoc_options: []
76
-
77
- require_paths:
89
+ require_paths:
78
90
  - lib
79
- required_ruby_version: !ruby/object:Gem::Requirement
91
+ required_ruby_version: !ruby/object:Gem::Requirement
80
92
  none: false
81
- requirements:
82
- - - ">="
83
- - !ruby/object:Gem::Version
84
- version: "0"
85
- required_rubygems_version: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ! '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ required_rubygems_version: !ruby/object:Gem::Requirement
86
98
  none: false
87
- requirements:
88
- - - ">="
89
- - !ruby/object:Gem::Version
90
- version: "0"
99
+ requirements:
100
+ - - ! '>='
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
91
103
  requirements: []
92
-
93
104
  rubyforge_project: notifyme
94
105
  rubygems_version: 1.8.24
95
106
  signing_key:
96
107
  specification_version: 3
97
108
  summary: It's a kind of cronjob.
98
109
  test_files: []
99
-