sensu-plugins-network-checks 0.1.2 → 0.1.3

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: f95b52c29e06c36b04daac09ee044f8beb8ff696
4
- data.tar.gz: 19130b94759f53b30dad024d3a746d37778fc706
3
+ metadata.gz: f95fd3961c18321fcb385bc5c1a60efacf1a3050
4
+ data.tar.gz: 078f595ed9bab70f5e9000d0a9bf832d61d8d876
5
5
  SHA512:
6
- metadata.gz: 0748e9f294e4d066e36c086c2441ed527fba8b17fc5249a38b4a3a02611beff13e7fe4d86aadf9b67151c2c6702afbf32d8e01476b7e509b2e77b04922df94cd
7
- data.tar.gz: b972c239580796e3e99b783a2dc164124b2c889f361229ee8602ef8a21ccd439076d279b0219b30037e78d66bcfe5ea48ba9ed07bb36541b7137ba1bedf02b70
6
+ metadata.gz: 8ed79b23eda15e7588f2274c7ee7f01df3d79db50855c68cc7c2420eba038ddfd4cf018c944b677257325c411b8efa23b81684ff21956a5e228a34f64223af5e
7
+ data.tar.gz: 99ad07554c717051ed4de6f06a52d5f4e6e0be3356a5603cf17f7bbce136e5df7775382387ae5260f8d092419bcf0e55dc099ed4efb4c8e8245411a52038b536
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
@@ -1,2 +1,3 @@
1
- �˪�z9L0���Ț��>'�9���
2
-
1
+ $�� �;*k�� ��):��-��%B���-��ރ]�:/�K��4$��H��y���8���uA�>��7l4m�I?�
2
+ �ž�?�� OX��Q{�
3
+ �Z;"-�^H��cDGN�!@��q�� �qY�G*S�<��-$��ˇD.��Cqc����H��+�X���������� �9 AA9ּK���H:*GCHVn���T��)���L�4��B�(�[S-���p%G�o�[u�x%�h]tW]�I}iTc
data/CHANGELOG.md CHANGED
@@ -5,6 +5,10 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
5
5
 
6
6
  ## Unreleased
7
7
 
8
+ ## [0.1.3] - 2016-01-15
9
+ ### Added
10
+ - Added check-socat.rb
11
+
8
12
  ## [0.1.2] - 2016-01-08
9
13
  ### Fixed
10
14
  - Bugfix for `check-whois-domain-expiration-multi` and `check-jsonwhois-domain-expiration`: return a warning-level response if there were any domains with expiration dates in the warning time period but none in the critical time period.
@@ -0,0 +1,83 @@
1
+ #! /usr/bin/env ruby
2
+ #
3
+ # check-socat
4
+ #
5
+ # DESCRIPTION:
6
+ # Run socat to inspect sockets
7
+ #
8
+ # OUTPUT:
9
+ # plain text
10
+ #
11
+ # PLATFORMS:
12
+ # Linux
13
+ #
14
+ # DEPENDENCIES:
15
+ # gem: sensu-plugin
16
+ # coreutils package for the timeout command
17
+ # socat package
18
+ #
19
+ # USAGE:
20
+ #
21
+ # Check if socat can receive particular a UDP multicast packet in 10 seconds:
22
+ # check-socat.rb -t 10s -i UDP4-RECVFROM:<PORT>,ip-add-membership=<MULTICASTADDR>:<INTERFACE> -o /dev/null
23
+ #
24
+ # Check if a UDP multicast packet contains an expected pattern:
25
+ # check-socat.rb -t 10s -i UDP4-RECVFROM:<PORT>,ip-add-membership=<MULTICASTADDR>:<INTERFACE> -o - --pipe "grep PATTERN"
26
+ #
27
+ # LICENSE:
28
+ # Released under the same terms as Sensu (the MIT license); see LICENSE
29
+ # for details.
30
+
31
+ require 'open3'
32
+ require 'sensu-plugin/check/cli'
33
+
34
+ class SocatCheck < Sensu::Plugin::Check::CLI
35
+ option :timeout,
36
+ description: 'Timeout in seconds',
37
+ short: '-t DURATION',
38
+ long: '--timeout DURATION',
39
+ default: '5s'
40
+
41
+ option :input,
42
+ description: 'Input stream',
43
+ short: '-i INPUT',
44
+ long: '--input INPUT',
45
+ required: true
46
+
47
+ option :output,
48
+ description: 'Output stream',
49
+ short: '-o OUTPUT',
50
+ long: '--output OUTPUT',
51
+ required: true
52
+
53
+ option :pipe,
54
+ description: 'Pipe socat output into this command',
55
+ short: '-p COMMAND',
56
+ long: '--pipe COMMAND'
57
+
58
+ def run
59
+ pipe = config[:pipe].nil? ? '' : "| #{config[:pipe]}"
60
+ timeout = config[:timeout]
61
+ stdout, stderr, status = Open3.capture3(
62
+ %(bash -c "set -o pipefail; timeout #{timeout} socat #{config[:input]} #{config[:output]} #{pipe}")
63
+ )
64
+ if status.success?
65
+ ok stdout
66
+ else
67
+ case status.exitstatus
68
+ when 124
69
+ critical "socat timed out\n#{stderr}"
70
+ when 125
71
+ critical "timeout failed\n#{stderr}"
72
+ when 126
73
+ critical "socat cannot be invoked\n#{stderr}"
74
+ when 127
75
+ critical "socat cannot be found\n#{stderr}"
76
+ when 137
77
+ critical "socat is sent the KILL signal\n#{stderr}"
78
+ else
79
+ critical stderr
80
+ end
81
+ end
82
+ end
83
+ end
@@ -2,7 +2,7 @@ module SensuPluginsNetworkChecks
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
- PATCH = 2
5
+ PATCH = 3
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-network-checks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
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: 2016-01-09 00:00:00.000000000 Z
33
+ date: 2016-01-15 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: dnsbl-client
@@ -242,6 +242,7 @@ executables:
242
242
  - metrics-interface.rb
243
243
  - check-whois-domain-expiration.rb
244
244
  - check-whois-domain-expiration-multi.rb
245
+ - check-socat.rb
245
246
  - check-rbl.rb
246
247
  - check-ports.rb
247
248
  - check-ports-nmap.rb
@@ -266,6 +267,7 @@ files:
266
267
  - bin/check-ports-nmap.rb
267
268
  - bin/check-ports.rb
268
269
  - bin/check-rbl.rb
270
+ - bin/check-socat.rb
269
271
  - bin/check-whois-domain-expiration-multi.rb
270
272
  - bin/check-whois-domain-expiration.rb
271
273
  - bin/metrics-interface.rb
metadata.gz.sig CHANGED
Binary file