qnotifier 0.6.7 → 0.6.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/command.rb CHANGED
@@ -104,7 +104,7 @@ module Qnotifier
104
104
  copy_init
105
105
  puts "Doing initial update..."
106
106
  qnotifier.run
107
- puts "\nPlease start the qnotifier daemon now."
107
+ puts "\nPlease start the qnotifier daemon now ('sudo qnotifier start')"
108
108
  else
109
109
  puts "Exiting."
110
110
  end
data/lib/plugin.rb CHANGED
@@ -16,6 +16,9 @@ module Qnotifier
16
16
  def run
17
17
  @class_name = self.class.to_s.split("::").last
18
18
  @alert_count = 0
19
+ @alerts = nil
20
+ @reports = nil
21
+ @stats = nil
19
22
 
20
23
  # Read the options from the global config and mix them in to the defaults for this plugin
21
24
  if @config[@class_name]
@@ -83,6 +86,7 @@ module Qnotifier
83
86
  # Alert is no longer needed as the value has crossed back over the threshold value
84
87
  def reset_alert(name, message)
85
88
  if Qnotifier::Storage.get("AlertTime_#{@class_name}-#{name}")
89
+ Qnotifier.log.error "Resetting alert"
86
90
  @alerts = {@class_name => []} unless @alerts
87
91
  log.warn message
88
92
  Qnotifier::Storage.delete("AlertTime_#{@class_name}-#{name}")
data/lib/qnotifier.rb CHANGED
@@ -30,9 +30,6 @@ module Qnotifier
30
30
  def initialize
31
31
  Qnotifier::Storage.restore
32
32
 
33
- @alerts = {}
34
- @reports = {}
35
- @stats = {}
36
33
  @alert_count = 0
37
34
  end
38
35
 
@@ -48,6 +45,11 @@ module Qnotifier
48
45
  def run
49
46
  start_logging
50
47
  load_config
48
+
49
+ @alerts = {}
50
+ @reports = {}
51
+ @stats = {}
52
+ @report_count = 0
51
53
 
52
54
  if Qnotifier::Storage.get("server_disabled_pings")
53
55
  Qnotifier.log.fatal "Disabled by the Qnotifer API, please re-register (qnotifier --register key) this agent to enable. Exiting."
data/lib/web_service.rb CHANGED
@@ -22,9 +22,10 @@ module Qnotifier
22
22
  puts "\nAlerts:"
23
23
  pp alerts
24
24
  puts "\nNot sending alerts to server due to debug mode."
25
+ return
25
26
  end
26
27
 
27
- Qnotifier.log.info "Sending #{alerts.count} alerts #{alerts}"
28
+ Qnotifier.log.info "Sending #{alerts.count} alerts #{alerts}"
28
29
 
29
30
  # Hostname
30
31
  unless @config["hostname"]
@@ -106,8 +107,10 @@ module Qnotifier
106
107
 
107
108
  if response.code == 200
108
109
  body = JSON.parse(response.body)
109
- if body[:poll_interval]
110
- @@poll_interval = body[:poll_interval].to_i
110
+ #Qnotifier.log.info "Response #{body.inspect}"
111
+ if body["poll_interval"]
112
+ @@poll_interval = body["poll_interval"].to_i
113
+ #Qnotifier.log.info "Report polling interval is #{@@poll_interval}"
111
114
  end
112
115
  Qnotifier.log.debug "Server Response: HTTP #{response.code} #{body[:message]}"
113
116
  else
data/qnotifier.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{qnotifier}
5
- s.version = "0.6.7"
5
+ s.version = "0.6.8"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Gersham Meharg"]
data.tar.gz.sig CHANGED
@@ -1,2 +1,3 @@
1
- �zk?J���DB[�)�<��^ax|��Xl�T��xFg��D� �A�V �e�߅��Zq
2
- ��r�У��ՋQN��ꣲ‚o%�����&��DH�IZwwrhu���ǃ毘
1
+ �?��4I������$ҙa
2
+ e6C��~b�.�:]7w8#�y�=�TB�ݷ��h{�i�ˢj PHMQ-o'7���&��4��TDEikJw
3
+ ( ��Q�"/�� ���B7^�G��5�ԏ��I"뙎W�Ɂ`�~R�qU'��-�]V� ɉ��y�m*�0��d�6+t�w��6Y�8͵{����rP��â��=
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qnotifier
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 7
10
- version: 0.6.7
9
+ - 8
10
+ version: 0.6.8
11
11
  platform: ruby
12
12
  authors:
13
13
  - Gersham Meharg
metadata.gz.sig CHANGED
Binary file