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 +1 -1
- data/lib/plugin.rb +4 -0
- data/lib/qnotifier.rb +5 -3
- data/lib/web_service.rb +6 -3
- data/qnotifier.gemspec +1 -1
- data.tar.gz.sig +3 -2
- metadata +3 -3
- metadata.gz.sig +0 -0
data/lib/command.rb
CHANGED
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
|
-
|
110
|
-
|
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
data.tar.gz.sig
CHANGED
@@ -1,2 +1,3 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
�?��4I������$ҙa
|
2
|
+
e6C��~b�.�:]7w8#�y�=�TB�ݷ��h�{�i�ˢj PHMQ-o'7���&��4��T�DEikJw
|
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:
|
4
|
+
hash: 23
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 6
|
9
|
-
-
|
10
|
-
version: 0.6.
|
9
|
+
- 8
|
10
|
+
version: 0.6.8
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Gersham Meharg
|
metadata.gz.sig
CHANGED
Binary file
|