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 +4 -4
- data/bin/sumo-check-SumoMailEmail.rb +8 -10
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7bd59ab1d27f84e31a00ef27bcecf821ae95f68c
|
4
|
+
data.tar.gz: c636a2763c6accfc332344f8d0cc339075e5c753
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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: '-
|
9
|
+
short: '-w VALUE',
|
10
10
|
long: '--warn_value VALUE',
|
11
11
|
description: 'Warning for Pending Messages',
|
12
12
|
required: false,
|
13
|
-
default:
|
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:
|
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
|
-
|
37
|
-
|
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
|
-
|
42
|
-
warning "
|
39
|
+
elsif pending_count >= config[:warn_value].to_i
|
40
|
+
warning "SumoMailEmail Pending Count is: #{pending_count} "
|
43
41
|
else
|
44
|
-
|
42
|
+
ok "SumoMailEmail Pending Count is: #{pending_count} "
|
45
43
|
end
|
46
44
|
|
47
45
|
end
|