smart_proxy_monitoring 0.1.2 → 0.2.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/lib/smart_proxy_monitoring/monitoring_api.rb +3 -0
- data/lib/smart_proxy_monitoring/monitoring_plugin.rb +2 -0
- data/lib/smart_proxy_monitoring/version.rb +1 -1
- data/lib/smart_proxy_monitoring_icinga2/icinga2_result_uploader.rb +1 -1
- data/lib/smart_proxy_monitoring_icinga2/monitoring_icinga2_main.rb +2 -1
- data/lib/smart_proxy_monitoring_icinga2/monitoring_icinga2_plugin.rb +5 -0
- data/lib/smart_proxy_monitoring_icingadirector/monitoring_icingadirector_plugin.rb +3 -0
- metadata +8 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e366cc37c357a3178a8d28262e1b177a384296778987df9b7107fb400a22dfae
|
4
|
+
data.tar.gz: 6f38e4e49c70adc11feee5bf495c00650dbe5aaf7f5187a5dca31e1c80edbc3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bbfbf8d19457f374c487630507cfd867aed6726bc3d84396e31596b648c26e047bc8ccf084d801edba5ea9667e3c17fb609f2cce47d6e033cf7c036c0c3df286
|
7
|
+
data.tar.gz: 846663a2a6aaee48323920970a3199326d888f45918ac575808699267f6b1af11181d3bd2d4f71db8bc5efb79aab13bc11a0798b02a540a014df04776cf1b13f
|
@@ -58,11 +58,14 @@ module Proxy::Monitoring
|
|
58
58
|
comment = params[:comment] || 'triggered by foreman'
|
59
59
|
start_time = params[:start_time] || Time.now.to_i
|
60
60
|
end_time = params[:end_time] || (Time.now.to_i + (24 * 3600))
|
61
|
+
all_services = params[:all_services]
|
61
62
|
|
62
63
|
log_provider_errors do
|
63
64
|
validate_dns_name!(host)
|
64
65
|
host = strip_domain(host)
|
65
66
|
|
67
|
+
server.set_downtime_host(host, author, comment, start_time, end_time, all_services: all_services)
|
68
|
+
rescue ArgumentError
|
66
69
|
server.set_downtime_host(host, author, comment, start_time, end_time)
|
67
70
|
end
|
68
71
|
end
|
@@ -11,6 +11,8 @@ module Proxy::Monitoring
|
|
11
11
|
uses_provider
|
12
12
|
default_settings use_provider: 'monitoring_icinga2'
|
13
13
|
default_settings collect_status: true
|
14
|
+
expose_setting :collect_status
|
15
|
+
expose_setting :strip_domain
|
14
16
|
|
15
17
|
http_rackup_path File.expand_path('monitoring_http_config.ru', File.expand_path('../', __FILE__))
|
16
18
|
https_rackup_path File.expand_path('monitoring_http_config.ru', File.expand_path('../', __FILE__))
|
@@ -3,7 +3,7 @@ require 'thread'
|
|
3
3
|
module ::Proxy::Monitoring::Icinga2
|
4
4
|
class MonitoringResult < Proxy::HttpRequest::ForemanRequest
|
5
5
|
def push_result(result)
|
6
|
-
send_request(request_factory.create_post('api/monitoring_results', result))
|
6
|
+
send_request(request_factory.create_post('api/v2/monitoring_results', result))
|
7
7
|
end
|
8
8
|
end
|
9
9
|
|
@@ -58,7 +58,7 @@ module Proxy::Monitoring::Icinga2
|
|
58
58
|
result.to_json
|
59
59
|
end
|
60
60
|
|
61
|
-
def set_downtime_host(host, author, comment, start_time, end_time)
|
61
|
+
def set_downtime_host(host, author, comment, start_time, end_time, all_services: nil, **)
|
62
62
|
request_url = "/actions/schedule-downtime?type=Host&filter=#{uri_encode_filter("host.name==\"#{host}\"")}"
|
63
63
|
data = {
|
64
64
|
'author' => author,
|
@@ -67,6 +67,7 @@ module Proxy::Monitoring::Icinga2
|
|
67
67
|
'end_time' => end_time,
|
68
68
|
'duration' => 1000
|
69
69
|
}
|
70
|
+
data['all_services'] = all_services unless all_services.nil?
|
70
71
|
|
71
72
|
result = with_errorhandling("Set downtime on #{host}") do
|
72
73
|
Icinga2Client.post(request_url, data.to_json)
|
@@ -5,6 +5,11 @@ module ::Proxy::Monitoring::Icinga2
|
|
5
5
|
default_settings server: 'localhost'
|
6
6
|
default_settings api_port: '5665'
|
7
7
|
default_settings verify_ssl: true
|
8
|
+
expose_setting :server
|
9
|
+
expose_setting :api_user
|
10
|
+
capability("config")
|
11
|
+
capability("downtime")
|
12
|
+
capability("status") unless Proxy::Monitoring::Plugin.settings.collect_status
|
8
13
|
|
9
14
|
requires :monitoring, ::Proxy::Monitoring::VERSION
|
10
15
|
|
@@ -3,6 +3,9 @@ module ::Proxy::Monitoring::IcingaDirector
|
|
3
3
|
plugin :monitoring_icingadirector, ::Proxy::Monitoring::VERSION
|
4
4
|
|
5
5
|
default_settings verify_ssl: true
|
6
|
+
expose_setting :director_url
|
7
|
+
expose_setting :director_user
|
8
|
+
capability("config")
|
6
9
|
|
7
10
|
requires :monitoring, ::Proxy::Monitoring::VERSION
|
8
11
|
requires :monitoring_icinga2, ::Proxy::Monitoring::VERSION
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smart_proxy_monitoring
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Timo Goebel
|
8
8
|
- Dirk Goetz
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2022-05-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest-client
|
@@ -121,11 +121,11 @@ files:
|
|
121
121
|
- settings.d/monitoring.yml.example
|
122
122
|
- settings.d/monitoring_icinga2.yml.example
|
123
123
|
- settings.d/monitoring_icingadirector.yml.example
|
124
|
-
homepage:
|
124
|
+
homepage: https://github.com/theforeman/smart_proxy_monitoring
|
125
125
|
licenses:
|
126
|
-
-
|
126
|
+
- GPL-3.0
|
127
127
|
metadata: {}
|
128
|
-
post_install_message:
|
128
|
+
post_install_message:
|
129
129
|
rdoc_options: []
|
130
130
|
require_paths:
|
131
131
|
- lib
|
@@ -140,9 +140,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
140
140
|
- !ruby/object:Gem::Version
|
141
141
|
version: '0'
|
142
142
|
requirements: []
|
143
|
-
|
144
|
-
|
145
|
-
signing_key:
|
143
|
+
rubygems_version: 3.2.22
|
144
|
+
signing_key:
|
146
145
|
specification_version: 4
|
147
146
|
summary: Monitoring plug-in for Foreman's smart proxy
|
148
147
|
test_files: []
|