sumo-check-sumo 0.0.25 → 0.0.26

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: adf1e2c9cdccafad81eb8b531a47c1d1a3402361
4
- data.tar.gz: cef889fd3d030a79af0609d03686d9cc25265f3e
3
+ metadata.gz: 7bd59ab1d27f84e31a00ef27bcecf821ae95f68c
4
+ data.tar.gz: c636a2763c6accfc332344f8d0cc339075e5c753
5
5
  SHA512:
6
- metadata.gz: 19f8feeedaddf01b64c26c8722c03a607dc7eddcab744b0e48e3599b570eb11262afa968d34f3e9c005178715a7fbbdebefba1593b9db9a5f37c879e9be13090
7
- data.tar.gz: 20d620fcec42c9a7dd60e1148357f01f299618ae7b25b868fedb009d6ecd0a669c1584c331ae13b391909d6de1766e49520e36bf84d5f923e6d25eb5c00951f1
6
+ metadata.gz: 6e8adf4c14d2eab8145f5b27f11ae4623bccbca1de629efd810544d7026ecf3b7791912c887593fb6dbe3924a1f8b611f270b0ee7b3a9d29134874d17f051136
7
+ data.tar.gz: c50bc0953dc9281195f5cba9b168fc5ed9eebe6996c6aa0532bbc4152d71a7245354fb6535409880310030317e78b4db0abc035e5f14a5a9c920225bff640e47
@@ -6,18 +6,18 @@ require 'inifile'
6
6
  class SumoSumoMailEmailCheck < Sensu::Plugin::Check::CLI
7
7
 
8
8
  option :warn_value,
9
- short: '-W VALUE',
9
+ short: '-w VALUE',
10
10
  long: '--warn_value VALUE',
11
11
  description: 'Warning for Pending Messages',
12
12
  required: false,
13
- default: 1000
13
+ default: 3000
14
14
 
15
15
  option :critical_value,
16
16
  short: '-c VALUE',
17
17
  long: '--critical_value VALUE',
18
18
  description: 'critical for Pending Messages',
19
19
  required: false,
20
- default: 1500
20
+ default: 4000
21
21
 
22
22
  option :interval_value,
23
23
  short: '-i VALUE',
@@ -33,15 +33,13 @@ class SumoSumoMailEmailCheck < Sensu::Plugin::Check::CLI
33
33
  # pending_count = db.query("SELECT count(id) FROM SumoMailEmail where state='pending' and scheduled_for <= NOW() - INTERVAL #{config[:interval_value].to_i} MINUTE;").first["count(id)"].to_i
34
34
  pending_count = db.query("SELECT count(id) FROM SumoMailEmail where state='pending';").first["count(id)"].to_i
35
35
 
36
- case
37
- when pending_count == 0
38
- ok "SumoMailEmail Pending Count is: #{pending_count} "
39
- when pending_count >config[:critical_value].to_i
36
+
37
+ if pending_count >= config[:critical_value].to_i
40
38
  critical "SumoMailEmail Pending Count is: #{pending_count} "
41
- when pending_count >config[:warn_value].to_i
42
- warning "SumoMailEmailPending Count is: #{pending_count} "
39
+ elsif pending_count >= config[:warn_value].to_i
40
+ warning "SumoMailEmail Pending Count is: #{pending_count} "
43
41
  else
44
- warning "ODD: we did not match any cases for alerts, this should not happen, SumoMailEmail Pending Count is: #{pending_count} "
42
+ ok "SumoMailEmail Pending Count is: #{pending_count} "
45
43
  end
46
44
 
47
45
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sumo-check-sumo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.25
4
+ version: 0.0.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dr. Ogg