foreman_monitoring 3.2.0 → 3.4.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: 1be3a1ba7154a3c58770b20a9264bf473ace2154f7854ad51c6a9819954d278d
4
+ data.tar.gz: fdc54b65348bb8205e2d1fe589ac0e2d34ec97994c9a6b39375ee021b540171f
5
5
  SHA512:
6
- metadata.gz: 612b798a6f43d52b223c248e63298606fafe545caf2350633c9f24ec08b0f35de0a8459a560171b519a24972e39cc84c974b902c39c578adb680586cfc51f238
7
- data.tar.gz: def3221fb65d2d545ee7b404725d173de31f444008dff5140fcbfe6e315d20574cba95f2e8f5a14ad580c3d180fc89022ec8827a51d1ad541df51a08964679fc
6
+ metadata.gz: 90952ba49718ecf7670c31f3a9f833e2553c6fbaeab28967cf5ed4d31ec6f058c1aabf28b3311af66a130e9addf414b8da23747908c5d0560ead01f1fa12a897
7
+ data.tar.gz: c3e453eeee8cc770ab8c2905db45225b61b9ded3e6c630eaa05e3b983cdf9b62a94cb25e0b82490faeef0e371712d000090ad2f91485b89ca4bf29abe9773dee
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
 
@@ -9,6 +9,8 @@ module ForemanMonitoring
9
9
  after_build :downtime_host_build
10
10
 
11
11
  has_many :monitoring_results, :dependent => :destroy, :foreign_key => 'host_id', :inverse_of => :host
12
+
13
+ scoped_search :relation => :monitoring_proxy, :on => :name, :complete_value => true, :rename => :monitoring_proxy, :only_explicit => true
12
14
  end
13
15
  end
14
16
 
@@ -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.4.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,13 @@
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.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Timo Goebel
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-05-31 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: rdoc
@@ -100,7 +99,6 @@ homepage: https://github.com/theforeman/foreman_monitoring
100
99
  licenses:
101
100
  - GPL-3.0
102
101
  metadata: {}
103
- post_install_message:
104
102
  rdoc_options: []
105
103
  require_paths:
106
104
  - lib
@@ -118,8 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
118
116
  - !ruby/object:Gem::Version
119
117
  version: '0'
120
118
  requirements: []
121
- rubygems_version: 3.2.3
122
- signing_key:
119
+ rubygems_version: 3.6.7
123
120
  specification_version: 4
124
121
  summary: Foreman plugin for monitoring system integration.
125
122
  test_files: