foreman_monitoring 3.2.0 → 3.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 685e5be086aa9ee637a3ef119df3310475334138a687f2583e21148ba63e1743
4
- data.tar.gz: 2dd299e15e6a4701e15ff7fc04e95c733c72454bd718f15082315fada5db2e4a
3
+ metadata.gz: fbc15d58535450315726e01bde9c45df3064ae3976604cf8fe53680b9f0f4224
4
+ data.tar.gz: 90bbd8f69daf9c6b12d3932c9b6ae3e2dec193c5f81877622d95714e4f347f6e
5
5
  SHA512:
6
- metadata.gz: 612b798a6f43d52b223c248e63298606fafe545caf2350633c9f24ec08b0f35de0a8459a560171b519a24972e39cc84c974b902c39c578adb680586cfc51f238
7
- data.tar.gz: def3221fb65d2d545ee7b404725d173de31f444008dff5140fcbfe6e315d20574cba95f2e8f5a14ad580c3d180fc89022ec8827a51d1ad541df51a08964679fc
6
+ metadata.gz: 3d928ff20a8614adb90889492acbd822e61338e3e9ca3c62de391a1128f4b9c32f85c5cb5ef8d72c6a65a1cf67a43eddddb4bf1ea5d1f08011c8a8f1336ee4cb
7
+ data.tar.gz: b835d8b198011f5b203a3e598c954c91dab8d8c84e05ec8641e66aee128777d6548cdf86f7b919b08447895a2959112a0d402ee343e63c95caccdd44314e03e4
data/README.md CHANGED
@@ -37,7 +37,8 @@ touch ~foreman/tmp/restart.txt
37
37
  | >= 2.0 | ~> 2.0 |
38
38
  | >= 2.2 | ~> 2.1 |
39
39
  | >= 3.0 | ~> 3.0 |
40
- | >= 3.6 | ~> 3.1 |
40
+ | >= 3.6 | ~> 3.1, ~>3.2 |
41
+ | >= 3.13 | ~> 3.3 |
41
42
 
42
43
  # Usage
43
44
 
@@ -6,11 +6,6 @@ module ForemanMonitoring
6
6
  class Engine < ::Rails::Engine
7
7
  engine_name 'foreman_monitoring'
8
8
 
9
- config.autoload_paths += Dir["#{config.root}/app/controllers/concerns"]
10
- config.autoload_paths += Dir["#{config.root}/app/helpers/concerns"]
11
- config.autoload_paths += Dir["#{config.root}/app/models/concerns"]
12
- config.autoload_paths += Dir["#{config.root}/app/services"]
13
-
14
9
  # Add any db migrations
15
10
  initializer 'foreman_monitoring.load_app_instance_data' do |app|
16
11
  ForemanMonitoring::Engine.paths['db/migrate'].existent.each do |path|
@@ -18,73 +13,75 @@ module ForemanMonitoring
18
13
  end
19
14
  end
20
15
 
21
- initializer 'foreman_monitoring.register_plugin', :before => :finisher_hook do |_app|
22
- Foreman::Plugin.register :foreman_monitoring do
23
- requires_foreman '>= 3.0'
24
-
25
- settings do
26
- category(:monitoring, N_('Monitoring')) do
27
- setting('monitoring_affect_global_status',
28
- type: :boolean,
29
- description: N_("Monitoring status will affect a host's global status when enabled"),
30
- default: true,
31
- full_name: N_('Monitoring status should affect global status'))
32
- setting('monitoring_create_action',
33
- type: :string,
34
- description: N_('What action should be taken when a host is created'),
35
- default: 'create',
36
- full_name: N_('Host Create Action'),
37
- collection: proc { ::Monitoring::CREATE_ACTIONS })
38
- setting('monitoring_delete_action',
39
- type: :string,
40
- description: N_('What action should be taken when a host is deleted'),
41
- default: 'delete',
42
- full_name: N_('Host Delete Action'),
43
- collection: proc { ::Monitoring::DELETE_ACTIONS })
16
+ initializer 'foreman_monitoring.register_plugin', :before => :finisher_hook do |app|
17
+ app.reloader.to_prepare do
18
+ Foreman::Plugin.register :foreman_monitoring do
19
+ requires_foreman '>= 3.13'
20
+
21
+ settings do
22
+ category(:monitoring, N_('Monitoring')) do
23
+ setting('monitoring_affect_global_status',
24
+ type: :boolean,
25
+ description: N_("Monitoring status will affect a host's global status when enabled"),
26
+ default: true,
27
+ full_name: N_('Monitoring status should affect global status'))
28
+ setting('monitoring_create_action',
29
+ type: :string,
30
+ description: N_('What action should be taken when a host is created'),
31
+ default: 'create',
32
+ full_name: N_('Host Create Action'),
33
+ collection: proc { ::Monitoring::CREATE_ACTIONS })
34
+ setting('monitoring_delete_action',
35
+ type: :string,
36
+ description: N_('What action should be taken when a host is deleted'),
37
+ default: 'delete',
38
+ full_name: N_('Host Delete Action'),
39
+ collection: proc { ::Monitoring::DELETE_ACTIONS })
40
+ end
44
41
  end
45
- end
46
42
 
47
- apipie_documented_controllers ["#{ForemanMonitoring::Engine.root}/app/controllers/api/v2/*.rb"]
48
-
49
- security_block :foreman_monitoring do
50
- permission :view_monitoring_results,
51
- {},
52
- :resource_type => 'Host'
53
- permission :manage_downtime_hosts,
54
- { :hosts => [:downtime, :select_multiple_downtime, :update_multiple_downtime], :'api/v2/downtime' => [:create] },
55
- :resource_type => 'Host'
56
- permission :upload_monitoring_results,
57
- :'api/v2/monitoring_results' => [:create]
58
- end
43
+ apipie_documented_controllers ["#{ForemanMonitoring::Engine.root}/app/controllers/api/v2/*.rb"]
44
+
45
+ security_block :foreman_monitoring do
46
+ permission :view_monitoring_results,
47
+ {},
48
+ :resource_type => 'Host'
49
+ permission :manage_downtime_hosts,
50
+ { :hosts => [:downtime, :select_multiple_downtime, :update_multiple_downtime], :'api/v2/downtime' => [:create] },
51
+ :resource_type => 'Host'
52
+ permission :upload_monitoring_results,
53
+ :'api/v2/monitoring_results' => [:create]
54
+ end
59
55
 
60
- # Extend built in permissions
61
- Foreman::AccessControl.permission(:edit_hosts).actions.concat [
62
- 'hosts/select_multiple_monitoring_proxy',
63
- 'hosts/update_multiple_monitoring_proxy'
64
- ]
56
+ # Extend built in permissions
57
+ Foreman::AccessControl.permission(:edit_hosts).actions.concat [
58
+ 'hosts/select_multiple_monitoring_proxy',
59
+ 'hosts/update_multiple_monitoring_proxy'
60
+ ]
65
61
 
66
- role 'Monitoring viewer', [:view_monitoring_results], 'Role granting permissions to view monitor results'
67
- role 'Monitoring manager', [:view_monitoring_results, :manage_downtime_hosts], 'Role granting permissions to view monitor results and manage downtimes'
62
+ role 'Monitoring viewer', [:view_monitoring_results], 'Role granting permissions to view monitor results'
63
+ role 'Monitoring manager', [:view_monitoring_results, :manage_downtime_hosts], 'Role granting permissions to view monitor results and manage downtimes'
68
64
 
69
- register_custom_status HostStatus::MonitoringStatus
65
+ register_custom_status HostStatus::MonitoringStatus
70
66
 
71
- add_controller_action_scope('HostsController', :index) { |base_scope| base_scope.includes(:monitoring_results) }
67
+ add_controller_action_scope('HostsController', :index) { |base_scope| base_scope.includes(:monitoring_results) }
72
68
 
73
- monitoring_proxy_options = {
74
- :feature => 'Monitoring',
75
- :label => N_('Monitoring Proxy'),
76
- :description => N_('Monitoring Proxy to use to manage monitoring of this host'),
77
- :api_description => N_('ID of Monitoring Proxy to use to manage monitoring of this host')
78
- }
69
+ monitoring_proxy_options = {
70
+ :feature => 'Monitoring',
71
+ :label => N_('Monitoring Proxy'),
72
+ :description => N_('Monitoring Proxy to use to manage monitoring of this host'),
73
+ :api_description => N_('ID of Monitoring Proxy to use to manage monitoring of this host')
74
+ }
79
75
 
80
- # add monitoring smart proxy to hosts and hostgroups
81
- smart_proxy_for Host::Managed, :monitoring_proxy, monitoring_proxy_options
82
- smart_proxy_for Hostgroup, :monitoring_proxy, monitoring_proxy_options
76
+ # add monitoring smart proxy to hosts and hostgroups
77
+ smart_proxy_for Host::Managed, :monitoring_proxy, monitoring_proxy_options
78
+ smart_proxy_for Hostgroup, :monitoring_proxy, monitoring_proxy_options
83
79
 
84
- add_controller_action_scope('HostsController', :index) { |base_scope| base_scope.includes(:monitoring_proxy) }
80
+ add_controller_action_scope('HostsController', :index) { |base_scope| base_scope.includes(:monitoring_proxy) }
85
81
 
86
- describe_host do
87
- multiple_actions_provider :monitoring_hosts_multiple_actions
82
+ describe_host do
83
+ multiple_actions_provider :monitoring_hosts_multiple_actions
84
+ end
88
85
  end
89
86
  end
90
87
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ForemanMonitoring
4
- VERSION = '3.2.0'
4
+ VERSION = '3.3.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_monitoring
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0
4
+ version: 3.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Timo Goebel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-31 00:00:00.000000000 Z
11
+ date: 2025-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rdoc
@@ -118,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
118
118
  - !ruby/object:Gem::Version
119
119
  version: '0'
120
120
  requirements: []
121
- rubygems_version: 3.2.3
121
+ rubygems_version: 3.5.22
122
122
  signing_key:
123
123
  specification_version: 4
124
124
  summary: Foreman plugin for monitoring system integration.