sensu-plugins-haproxy 0.0.4 → 0.0.5

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 974706aeae73f0f2bfb8bdd14ed0d71f1dcad496
4
- data.tar.gz: 5044fc7788204c89de57e68ef2ec8dca8040f7be
3
+ metadata.gz: 977f24700c561ec67eceac0e6be8d40e73983a7e
4
+ data.tar.gz: 35b56c3e766fb1a0766ecf28299cbc637dbea9ee
5
5
  SHA512:
6
- metadata.gz: a6b459752ee440074a2c7bcf7df5a8aff5325db74175676b8da454c12a0053d47c3756a641da8afd8cca92119b49c48a3237ffd07281997c171f4c1b6efaa15f
7
- data.tar.gz: af7b93176532c3c7241d8d0efd3c8e32d32a69b750f31d631ea2dd6eea79bb5e1ddcc2319543aad474b67788a9ecab902b7e5eb15387b903a7b30ca63a461cbd
6
+ metadata.gz: c347bba6013e3b205e62259685fc5e27077b789232e7a8cdb4a268552c1a6536474a4c52c13f2037155d82059852571c90d328604f4b65d16b6f61c624de4e39
7
+ data.tar.gz: 5d4a63847381d55d79a75c60946d0731da4a875a5834975cad75ad12be93f6bdb6ec4488ba5b9307859ed42acf924b1a9b13880add9d777cdf4058cfd4504bbd
@@ -1 +1,2 @@
1
- Ikm�p�x������PG��G�U���N�g| -��f����ht�J�ϕw'F���7f����Ʋ�W�-"{�&�����1ِ�|%��&"o�3Omؐ�-/�����`ʾ��zQ�?���|�� ��ݸ��&Ϝ,_��L"�$'��+��dD��i8` :���iP�1��М\��98��%�I<��s��:9���>�s ����$�Rx�r;+�)告^OZ5�5�>I���`I�Ę��J�%O
1
+ ���W�')Xz
2
+ ���׼��iY;1F�����w���D��(W8?H�⡖w�t����g[��(B�3�����">�[����ȍ0n3<�/��~�
3
+
data.tar.gz.sig CHANGED
Binary file
@@ -5,6 +5,11 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
5
5
 
6
6
  ## Unreleased
7
7
 
8
+ ## [0.0.5] - 2015-11-26
9
+ ### Changed
10
+ - alert on min server count
11
+ - fixed reporting of empty values
12
+
8
13
  ## [0.0.4] - 2015-08-04
9
14
  ### Changed
10
15
  - general cleanup
@@ -80,6 +80,16 @@ class CheckHAProxy < Sensu::Plugin::Check::CLI
80
80
  default: 90,
81
81
  proc: proc(&:to_i),
82
82
  description: 'Session Limit Critical Percent, default: 90'
83
+ option :min_warn_count,
84
+ short: '-M COUNT',
85
+ default: 0,
86
+ proc: proc(&:to_i),
87
+ description: 'Minimum Server Warn Count, default: 0'
88
+ option :min_crit_count,
89
+ short: '-X COUNT',
90
+ default: 0,
91
+ proc: proc(&:to_i),
92
+ description: 'Minimum Server Critical Count, default: 0'
83
93
  option :all_services,
84
94
  short: '-A',
85
95
  boolean: true,
@@ -117,10 +127,14 @@ class CheckHAProxy < Sensu::Plugin::Check::CLI
117
127
  warning_sessions = services.select { |svc| svc[:slim].to_i > 0 && (100 * svc[:scur].to_f / svc[:slim].to_f) > config[:session_warn_percent] }
118
128
 
119
129
  status = "UP: #{percent_up}% of #{services.size} /#{config[:service]}/ services" + (failed_names.empty? ? '' : ", DOWN: #{failed_names.join(', ')}")
120
- if percent_up < config[:crit_percent]
130
+ if services.size < config[:min_crit_count]
131
+ critical status
132
+ elsif percent_up < config[:crit_percent]
121
133
  critical status
122
134
  elsif !critical_sessions.empty?
123
135
  critical status + '; Active sessions critical: ' + critical_sessions.map { |s| "#{s[:scur]} #{s[:pxname]}.#{s[:svname]}" }.join(', ')
136
+ elsif services.size < config[:min_warn_count]
137
+ warning status
124
138
  elsif percent_up < config[:warn_percent]
125
139
  warning status
126
140
  elsif !warning_sessions.empty?
@@ -125,6 +125,10 @@ class HAProxyMetrics < Sensu::Plugin::Metric::CLI::Graphite
125
125
  return nil
126
126
  end
127
127
 
128
+ def output(*args)
129
+ super(*args) unless args[1].nil?
130
+ end
131
+
128
132
  def run #rubocop:disable all
129
133
  out = nil
130
134
  1.upto(config[:retries]) do |_i|
@@ -2,7 +2,7 @@ module SensuPluginsHAProxy
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- PATCH = 4
5
+ PATCH = 5
6
6
 
7
7
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-haproxy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sensu-Plugins and contributors
@@ -30,7 +30,7 @@ cert_chain:
30
30
  8sHuVruarogxxKPBzlL2is4EUb6oN/RdpGx2l4254+nyR+abg//Ed27Ym0PkB4lk
31
31
  HP0m8WSjZmFr109pE/sVsM5jtOCvogyujQOjNVGN4gz1wwPr
32
32
  -----END CERTIFICATE-----
33
- date: 2015-08-05 00:00:00.000000000 Z
33
+ date: 2015-11-26 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: sensu-plugin
metadata.gz.sig CHANGED
Binary file