qnotifier 0.6.2 → 0.6.3

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.
@@ -34,14 +34,14 @@ System:
34
34
  # use_load: either one_minute, five_minute or fifteen_minutes
35
35
  use_load: five_minute
36
36
  # normalize_load: whether to divide the reported load by the number of CPUs in the system
37
- normalize_load: true
37
+ normalize_load: false
38
38
  # Alert if the CPU is above this percent usage, 0 disables
39
- alert_cpu_threshold: 10
39
+ alert_cpu_threshold: 95
40
40
  # Alert if the memory is above this percent usage, 0 disables
41
- alert_memory_threshold: 10
42
- # Alert if the memory is above this percent usage, 0 disables
41
+ alert_memory_threshold: 90
42
+ # Alert if the load is above this percent usage, 0 disables
43
43
  alert_load_threshold: 1.0
44
- # Alert if the memory is above this percent usage, 0 disables
44
+ # Alert if the disk is above this percent usage, 0 disables
45
45
  alert_disk_threshold: 90
46
46
  # Partitions which to monitor for free disk space
47
47
  partitions:
@@ -107,6 +107,5 @@ Ruby:
107
107
  #
108
108
 
109
109
  # The API End Point in which to send our pings
110
- #api_endpoint: "http://ping.qnotifier.com"
111
- api_endpoint: "http://localhost:4567"
110
+ api_endpoint: "http://ping.qnotifier.com"
112
111
 
data/lib/command.rb CHANGED
@@ -20,6 +20,12 @@ module Qnotifier
20
20
  qnotifier.register(register_code)
21
21
  exit
22
22
  end
23
+ opts.on("-w", "--wipe", "Wipes the saved variables, including registration. You must recreate the server and reregister after this.") do
24
+ qnotifier = Qnotifier::Process.new
25
+ qnotifier.debug = true if @debug
26
+ qnotifier.wipe
27
+ exit
28
+ end
23
29
  opts.on("-v", "--version", "Displays the agent version") do |version|
24
30
  puts "Qnotifier Agent Version: #{Qnotifier::VERSION}"
25
31
  exit
data/lib/qnotifier.rb CHANGED
@@ -135,6 +135,8 @@ module Qnotifier
135
135
  Qnotifier.log.error "Server already registered. You should not keep registering the server, you only need to do this once."
136
136
  end
137
137
 
138
+ Qnotifier::Storage.wipe
139
+
138
140
  webservice = Qnotifier::WebService.new
139
141
  webservice.config = @config
140
142
  api_key = webservice.register_server(code)
@@ -143,6 +145,13 @@ module Qnotifier
143
145
 
144
146
  end
145
147
 
148
+ def wipe
149
+ start_logging
150
+ load_config
151
+
152
+ Qnotifier::Storage.wipe
153
+ end
154
+
146
155
  def save_api_key(api_key)
147
156
  return unless api_key
148
157
  @config["api_key"] = api_key
data/lib/storage.rb CHANGED
@@ -31,6 +31,11 @@ module Qnotifier
31
31
  @@stored_variables[key] = value
32
32
  end
33
33
 
34
+ def self.wipe
35
+ saved_variables = File.dirname(__FILE__) + "/../var/saved_variables.yml"
36
+ File.delete(saved_variables)
37
+ end
38
+
34
39
  def self.delete(key)
35
40
  restore unless @@restored
36
41
  @@stored_variables.delete(key)
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.2"
5
+ s.version = "0.6.3"
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
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qnotifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gersham Meharg
metadata.gz.sig CHANGED
Binary file