sensu-plugins-strongswan 1.2.0 → 2.0.0
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 +4 -4
- data/CHANGELOG.md +10 -2
- data/README.md +1 -0
- data/bin/metrics-strongswan-connection.rb +71 -0
- data/lib/sensu-plugins-strongswan/version.rb +2 -2
- metadata +7 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb9cfc67e98f78796ff984105ea1c6d1ecfc56a2f4d4e54f15d5e787e41b2341
|
4
|
+
data.tar.gz: dbe509551b2d89bee847ab44df19fb294a96f3480f925aaba327b31782449952
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd0a02e6ed04ef147bde40d780e1624adc6b8cd463d388797f8ad4097fd1768cf2d14977da523f9e174b731005d85a0db9ef4950253185ead459b90115dd2560
|
7
|
+
data.tar.gz: 59940dd6fd07b3a199645134aba922cdca164e242f33e086f77f0a311e8be610006e727dd9a761ec38ee64b3b608240b96077f1d378e3ed22f9d8a4763dfd885
|
data/CHANGELOG.md
CHANGED
@@ -5,12 +5,19 @@ This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins
|
|
5
5
|
|
6
6
|
## [Unreleased]
|
7
7
|
|
8
|
+
## [2.0.0] - 2018-03-07
|
9
|
+
### Breaking Changes
|
10
|
+
- Dropping ruby `< 2.3` support (@yuri-zubov)
|
11
|
+
|
12
|
+
### Added
|
13
|
+
- Added new metrics-strongswan-connection.rb plugin for getting connection metrics (@yuri-zubov)
|
14
|
+
|
8
15
|
## [1.2.0] - 2018-03-04
|
9
16
|
### Added
|
10
17
|
- Added new metrics-strongswan-listcounters.rb plugin for getting IKE counters (@yuri-zubov)
|
11
18
|
|
12
19
|
### Breaking Changes
|
13
|
-
Dropping ruby `< 2.1` support (@yuri-zubov)
|
20
|
+
- Dropping ruby `< 2.1` support (@yuri-zubov)
|
14
21
|
|
15
22
|
## [1.1.0] - 2018-02-22
|
16
23
|
### Added
|
@@ -43,7 +50,8 @@ Dropping ruby `< 2.1` support (@yuri-zubov)
|
|
43
50
|
### Added
|
44
51
|
- add check-strongswan.rb and metrics-strongswan.rb plugins
|
45
52
|
|
46
|
-
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-strongswan/compare/
|
53
|
+
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-strongswan/compare/2.0.0...HEAD
|
54
|
+
[2.0.0]: https://github.com/sensu-plugins/sensu-plugins-strongswan/compare/1.2.0...2.0.0
|
47
55
|
[1.2.0]: https://github.com/sensu-plugins/sensu-plugins-strongswan/compare/1.1.0...1.2.0
|
48
56
|
[1.1.0]: https://github.com/sensu-plugins/sensu-plugins-strongswan/compare/1.0.0...1.1.0
|
49
57
|
[1.0.0]: https://github.com/sensu-plugins/sensu-plugins-strongswan/0.1.1...1.0.0
|
data/README.md
CHANGED
@@ -0,0 +1,71 @@
|
|
1
|
+
#! /usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# metrics-strongswan-statusall.rb
|
4
|
+
#
|
5
|
+
# DESCRIPTION:
|
6
|
+
# This plugin collects metrics from a Strongswan VPN server
|
7
|
+
#
|
8
|
+
# OUTPUT:
|
9
|
+
# metric data
|
10
|
+
#
|
11
|
+
# PLATFORMS:
|
12
|
+
# Linux
|
13
|
+
#
|
14
|
+
# DEPENDENCIES:
|
15
|
+
# gem: sensu-plugin
|
16
|
+
#
|
17
|
+
# USAGE:
|
18
|
+
# metrics-strongswan-connection.rb
|
19
|
+
#
|
20
|
+
# NOTES:
|
21
|
+
# This plugin should be executed as root using sudo
|
22
|
+
#
|
23
|
+
# LICENSE:
|
24
|
+
# Copyright Yuri Zubov <yury.zubau@gmail.com>
|
25
|
+
# Released under the same terms as Sensu (the MIT license); see LICENSE
|
26
|
+
# for details.
|
27
|
+
#
|
28
|
+
|
29
|
+
require 'sensu-plugin/metric/cli'
|
30
|
+
require 'open3'
|
31
|
+
require 'socket'
|
32
|
+
|
33
|
+
# Collect strongswan metrics
|
34
|
+
class MetricsStrongswanStrongswanConnection < Sensu::Plugin::Metric::CLI::Graphite
|
35
|
+
option :scheme,
|
36
|
+
description: 'Metric naming scheme, text to prepend to metric',
|
37
|
+
short: '-s SCHEME',
|
38
|
+
long: '--scheme SCHEME',
|
39
|
+
default: "#{Socket.gethostname}.strongswan"
|
40
|
+
|
41
|
+
option :connection,
|
42
|
+
description: 'Connection name to check',
|
43
|
+
short: '-c NAME',
|
44
|
+
long: '--connection NAME',
|
45
|
+
required: true
|
46
|
+
|
47
|
+
def run_ipsec_statusall
|
48
|
+
stdout, result = Open3.capture2("ipsec statusall #{config[:connection]}")
|
49
|
+
unknown 'Unable to get Strongswan statusall' unless result.success?
|
50
|
+
stdout
|
51
|
+
end
|
52
|
+
|
53
|
+
def run
|
54
|
+
ipsec_status = run_ipsec_statusall
|
55
|
+
|
56
|
+
found = false
|
57
|
+
ipsec_status.each_line do |line|
|
58
|
+
result = line.match(/(?<name>.*)\{.*(?<bytes_i>\d+)\ bytes_i.*\ (?<bytes_o>\d+)\ bytes_o/)
|
59
|
+
next unless result
|
60
|
+
|
61
|
+
found = true
|
62
|
+
output "#{config[:scheme]}.#{result[:name]}.bytes_i", result[:bytes_i]
|
63
|
+
output "#{config[:scheme]}.#{result[:name]}.bytes_o", result[:bytes_o]
|
64
|
+
end
|
65
|
+
if found
|
66
|
+
ok
|
67
|
+
else
|
68
|
+
critical('Not found')
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu-plugins-strongswan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sensu-Plugins and contributors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-03-
|
11
|
+
date: 2018-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sensu-plugin
|
@@ -128,14 +128,14 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: 0.
|
131
|
+
version: 0.51.0
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: 0.
|
138
|
+
version: 0.51.0
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: yard
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -155,6 +155,7 @@ email: "<sensu-users@googlegroups.com>"
|
|
155
155
|
executables:
|
156
156
|
- check-strongswan-connection.rb
|
157
157
|
- check-strongswan.rb
|
158
|
+
- metrics-strongswan-connection.rb
|
158
159
|
- metrics-strongswan-listcounters.rb
|
159
160
|
- metrics-strongswan.rb
|
160
161
|
extensions: []
|
@@ -165,6 +166,7 @@ files:
|
|
165
166
|
- README.md
|
166
167
|
- bin/check-strongswan-connection.rb
|
167
168
|
- bin/check-strongswan.rb
|
169
|
+
- bin/metrics-strongswan-connection.rb
|
168
170
|
- bin/metrics-strongswan-listcounters.rb
|
169
171
|
- bin/metrics-strongswan.rb
|
170
172
|
- lib/sensu-plugins-strongswan.rb
|
@@ -187,7 +189,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
187
189
|
requirements:
|
188
190
|
- - ">="
|
189
191
|
- !ruby/object:Gem::Version
|
190
|
-
version: 2.
|
192
|
+
version: 2.3.0
|
191
193
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
192
194
|
requirements:
|
193
195
|
- - ">="
|