foreman_abrt 0.0.6 → 0.0.7

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: 769f6ad2b02f93ffcdb04442d9d7dc40112fd021
4
- data.tar.gz: acd38d6397e402ea73ff985fe5acfcda26166ed9
3
+ metadata.gz: cfaeae561a0aa0b23662859fa0ec95cf5cedcf48
4
+ data.tar.gz: 07905ce91d1c21b2460308238f48bc9fb426a9e6
5
5
  SHA512:
6
- metadata.gz: 54d6109b36930d19c2f1d0a17f66c7215a5315fe45e17425c2356438566562357fbc5ba4ad6f056ef4c642f7db46921211364e079f46b15a868afe99f7f7e50d
7
- data.tar.gz: ef725709ff54801474564ba87af02cc61dd819b250d19e199703d4b770bc849a74f2bf1dd11d3aef6007a830b13595370c7570fc6c9be74e8dda7d4ca7cf6dd2
6
+ metadata.gz: e4db6b1b79e7eb4c8c6b4844adc409dbff7e30c7ee46c6897c02d77b93dd1faa113ccdfe18c5f48e297599489cdf90147bc304b06905eb5af07bd5148dfe0cf9
7
+ data.tar.gz: 68d43a865cec510d101841d39fabdb92a40e42ed07c9b9b27bd1105cac980da58c0f85810465cbeff1f1d333de39680fd3ec40b43aa5b73d9d5676cdc1cc4d44
data/README.md CHANGED
@@ -25,19 +25,33 @@ for analysis.
25
25
 
26
26
  ![foreman abrt workflow](/extra/foreman_abrt_workflow.png?raw=true)
27
27
 
28
+ ### Network ports
29
+
30
+ Reports from managed hosts are sent to smart-proxy's https port which is 8443
31
+ for standalone Foreman installations and 9090 for Katello.
32
+
33
+ The proxy sends the reports using Foreman's API, which normally runs on
34
+ standard https (port 443).
35
+
28
36
  ## Installation
29
37
 
30
38
  To be able to see ABRT problem reports in your Foreman instance, you need to
31
39
  install the plugin itself, install ABRT plugin for your smart proxies and
32
40
  configure your hosts to send the problem reports to their smart proxy.
33
41
 
42
+ Please note that the configuration is slightly different when using Foreman
43
+ stand-alone and when it is part of Katello. Any configuration specific to
44
+ **Katello** will be explicitly indicated.
45
+
34
46
  Both plugins are available as RPMs in [Foreman YUM repositories](http://yum.theforeman.org/).
35
47
 
36
48
  ### Prerequisites
37
49
 
38
50
  The plugins require both Foreman and smart-proxy to be version 1.7 or later.
39
51
 
40
- The plugins have been tested on Fedora 19, RHEL 6 and RHEL 7.
52
+ The plugins have been tested on Fedora 19, RHEL 6 and RHEL 7. Versions of the
53
+ plugins compatible with Katello are `foreman_abrt-0.0.4` and
54
+ `smart_proxy_abrt-0.0.6`.
41
55
 
42
56
  To have hosts automatically send ureports to Foreman, you need to have ABRT
43
57
  2.1.11 or higher installed on them. RHEL 7 and Fedora 19 and higher satisfy
@@ -63,18 +77,6 @@ You need to install the `rubygem-smart_proxy_abrt` package.
63
77
 
64
78
  The plugin needs some configuration in order to work correctly.
65
79
 
66
- - Edit `/etc/foreman-proxy/settings.yml` to configure the main Foreman host,
67
- which is normally not needed. Assuming Foreman runs on `f19-foreman.tld` the
68
- file should contain following:
69
-
70
- ```
71
- # URL of your foreman instance
72
- :foreman_url: https://f19-foreman.tld
73
- ```
74
- Please note that the `:foreman_url:` setting may be entirely missing in the
75
- file. In that case just add the line to the end of
76
- `/etc/foreman-proxy/settings.yml`.
77
-
78
80
  - Ensure that `/etc/foreman-proxy/settings.d/abrt.yml` contains the following line:
79
81
  ```
80
82
  :enabled: true
@@ -93,13 +95,20 @@ The plugin needs some configuration in order to work correctly.
93
95
  ### Configuring hosts to send problem reports to Foreman
94
96
 
95
97
  This setup needs to be performed on every host that you wish to report its
96
- crashes to Foreman.
98
+ crashes to Foreman. The host has to be managed by Puppet, i.e. host record must
99
+ exist in Foreman web interface.
97
100
 
98
101
  - Make sure that ABRT is installed and running.
99
102
  ```
100
- ~# yum install abrt-cli
101
- ~# systemctl start abrtd
102
- ~# systemctl start abrt-ccpp
103
+ yum install abrt-cli
104
+ systemctl start abrtd abrt-ccpp
105
+ systemctl enable abrtd abrt-ccpp
106
+ ```
107
+
108
+ - Enable auto-reporting by running the following command:
109
+
110
+ ```
111
+ abrt-auto-reporting enabled
103
112
  ```
104
113
 
105
114
  - Configure ABRT reporting destination -
@@ -107,7 +116,7 @@ crashes to Foreman.
107
116
 
108
117
  ```
109
118
  # URL of your foreman-proxy, with /abrt path.
110
- URL = https://f19-smartproxy.tld:8443/abrt
119
+ URL = https://smartproxy.tld:8443/abrt
111
120
  # Verify the server certificate.
112
121
  SSLVerify = yes
113
122
  # This asks puppet config for the path to the ceritificates. you can
@@ -116,28 +125,45 @@ crashes to Foreman.
116
125
  SSLClientAuth = puppet
117
126
  ```
118
127
 
128
+ **Katello:** when using Foreman with Katello, the host needs to be registered
129
+ (using subscription-manager) to your Katello instance. You can find the
130
+ registration instructions on `https://foreman.tld/content_hosts/register`.
131
+ The `/etc/libreport/plugins/ureport.conf` file should instead contain the
132
+ following:
133
+
134
+ ```
135
+ # URL of your foreman-proxy, with /abrt path.
136
+ URL = https://smartproxy.tld:9090/abrt
137
+ # Verify the server certificate.
138
+ SSLVerify = yes
139
+ # Use the subscription management certificates to authenticate to the proxy.
140
+ SSLClientAuth = /etc/pki/consumer/cert.pem:/etc/pki/consumer/key.pem
141
+ ```
142
+
119
143
  - Add the Puppet CA to the list of trusted certificate authorities. This is
120
144
  needed for verifying the validity of smart-proxy's certificate:
121
145
 
122
146
  ```
123
- ~# cp /var/lib/puppet/ssl/certs/ca.pem /etc/pki/ca-trust/source/anchors/
124
- ~# update-ca-trust
147
+ cp /var/lib/puppet/ssl/certs/ca.pem /etc/pki/ca-trust/source/anchors/
148
+ update-ca-trust
125
149
  ```
126
150
 
127
- - Enable auto-reporting by running the following command:
151
+ **Katello:** when using Foreman with Katello, the subscription management
152
+ certificate should be used instead:
128
153
 
129
154
  ```
130
- ~# abrt-auto-reporting enabled
155
+ cp /etc/rhsm/ca/katello-server-ca.pem /etc/pki/ca-trust/source/anchors/
156
+ update-ca-trust
131
157
  ```
132
158
 
133
159
  ### Verifying that the setup works
134
160
 
135
161
  You can verify your setup by crashing something on your managed host. We have a
136
- set of utilities in the Fedora repository especially for this purpose:
162
+ set of utilities in the Fedora/EPEL repository especially for this purpose:
137
163
 
138
164
  ```
139
- ~# yum -y install will-crash
140
- ~$ will_segfault
165
+ yum -y install will-crash
166
+ will_segfault
141
167
  Will segfault.
142
168
  Segmentation fault (core dumped)
143
169
  ```
@@ -149,14 +175,27 @@ default). This means that within half an hour you should be able to see the bug
149
175
  report in the Foreman web interface. You can send the reports to Foreman
150
176
  manually by running the `smart-proxy-abrt-send` command.
151
177
 
152
- If the will-crash package is not available, you can try the following. Please
153
- make sure not to actually report this to `sleep` maintainers, though:
178
+ Please note that you need to enable the
179
+ [EPEL](https://fedoraproject.org/wiki/EPEL) repository if you are using RHEL in
180
+ order to install will-crash. If the will-crash package is not available, you
181
+ can try the following. Please make sure not to actually report this to `sleep`
182
+ maintainers, though:
154
183
 
155
184
  ```
156
- ~$ sleep 1d &
157
- ~$ kill -SEGV $!
185
+ sleep 1d &
186
+ kill -SEGV $!
158
187
  ```
159
188
 
189
+ ### Testing aggregation
190
+
191
+ If you crash the same program twice (on one host) within the same period that
192
+ smart-proxy waits between forwarding the reports to foreman, then only one
193
+ report with count = 2 should appear in the web interface.
194
+
195
+ However, be careful about ABRT's rate limiting - if you crash a program
196
+ and then crash it again sooner that 20 seconds then the second crash is
197
+ simply ignored.
198
+
160
199
  ## Usage
161
200
 
162
201
  The list of received problem reports can be accessed by clicking on *Problem
@@ -197,4 +236,3 @@ GNU General Public License for more details.
197
236
 
198
237
  You should have received a copy of the GNU General Public License
199
238
  along with this program. If not, see <http://www.gnu.org/licenses/>.
200
-
@@ -41,7 +41,7 @@ class AbrtReport < ActiveRecord::Base
41
41
 
42
42
  def self.import(json)
43
43
  reports = []
44
- host = Host.find_by_name(json[:host])
44
+ host = Host.find_by_name(json[:host]) || Host.joins(:provision_interface).where({:nics => {:ip => json[:host]}}).try(:first)
45
45
 
46
46
  # If the host lookup failed, it is possible that we are using subscription management certificates which
47
47
  # have UUID in their CN instead of host's FQDN. Try asking Katello if it knows host with such UUID.
@@ -13,7 +13,7 @@ class CreateAbrtReports < ActiveRecord::Migration
13
13
  t.boolean :response_known
14
14
  t.string :response_bthash
15
15
 
16
- t.timestamps
16
+ t.timestamps :null => false
17
17
  end
18
18
 
19
19
  create_table :abrt_report_response_destinations do |t|
@@ -1,2 +1,3 @@
1
1
  # Create feature for Smart Proxy
2
- Feature.find_or_create_by_name('Abrt')
2
+ f = Feature.where(:name => 'Abrt').first_or_create
3
+ raise "Unable to create Abrt proxy feature: #{format_errors f}" if f.nil? || f.errors.any?
@@ -15,12 +15,14 @@ module ForemanAbrt
15
15
 
16
16
  # Add any db migrations
17
17
  initializer 'foreman_abrt.load_app_instance_data' do |app|
18
- app.config.paths['db/migrate'] += ForemanAbrt::Engine.paths['db/migrate'].existent
18
+ ForemanAbrt::Engine.paths['db/migrate'].existent.each do |path|
19
+ app.config.paths['db/migrate'] << path
20
+ end
19
21
  end
20
22
 
21
23
  initializer 'foreman_abrt.register_plugin', :after=> :finisher_hook do |app|
22
24
  Foreman::Plugin.register :foreman_abrt do
23
- requires_foreman '>= 1.5'
25
+ requires_foreman '>= 1.8'
24
26
 
25
27
  # Add permissions
26
28
  security_block :foreman_abrt do
@@ -1,3 +1,3 @@
1
1
  module ForemanAbrt
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_abrt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Milata
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-15 00:00:00.000000000 Z
11
+ date: 2016-04-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: deface
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  description: Foreman plugin that allows you to see problem reports submitted by Automatic
@@ -32,44 +32,43 @@ executables: []
32
32
  extensions: []
33
33
  extra_rdoc_files: []
34
34
  files:
35
- - app/overrides/add_host_bug_report_tab.rb
36
- - app/assets/stylesheets/abrt_reports.css
35
+ - LICENSE
36
+ - README.md
37
+ - Rakefile
37
38
  - app/assets/javascripts/abrt_reports.js
38
- - app/views/abrt_reports/_host_tab_pane.html.erb
39
- - app/views/abrt_reports/_host_tab.html.erb
40
- - app/views/abrt_reports/_basic_auth_modal.html.erb
41
- - app/views/abrt_reports/index.html.erb
42
- - app/views/abrt_reports/_show_response.html.erb
43
- - app/views/abrt_reports/_list.html.erb
44
- - app/views/abrt_reports/show.html.erb
45
- - app/views/dashboard/_foreman_abrt_widget.html.erb
46
- - app/helpers/abrt_reports_helper.rb
47
- - app/controllers/concerns/foreman_abrt/dashboard_controller_extensions.rb
48
- - app/controllers/api/v2/abrt_reports_controller.rb
39
+ - app/assets/stylesheets/abrt_reports.css
49
40
  - app/controllers/abrt_reports_controller.rb
50
- - app/models/setting/abrt.rb
51
- - app/models/concerns/foreman_abrt/host_extensions.rb
41
+ - app/controllers/api/v2/abrt_reports_controller.rb
42
+ - app/controllers/concerns/foreman_abrt/dashboard_controller_extensions.rb
43
+ - app/helpers/abrt_reports_helper.rb
52
44
  - app/models/abrt_report.rb
53
45
  - app/models/abrt_report_response_destination.rb
54
46
  - app/models/abrt_report_response_solution.rb
47
+ - app/models/concerns/foreman_abrt/host_extensions.rb
48
+ - app/models/setting/abrt.rb
49
+ - app/overrides/add_host_bug_report_tab.rb
50
+ - app/views/abrt_reports/_basic_auth_modal.html.erb
51
+ - app/views/abrt_reports/_host_tab.html.erb
52
+ - app/views/abrt_reports/_host_tab_pane.html.erb
53
+ - app/views/abrt_reports/_list.html.erb
54
+ - app/views/abrt_reports/_show_response.html.erb
55
+ - app/views/abrt_reports/index.html.erb
56
+ - app/views/abrt_reports/show.html.erb
57
+ - app/views/dashboard/_foreman_abrt_widget.html.erb
55
58
  - config/routes.rb
56
59
  - db/migrate/20140414095631_create_abrt_reports.rb
57
60
  - db/migrate/20140909170102_abrt_reports_drop_timestamps.rb
58
61
  - db/seeds.d/75-abrt-seeds.rb
62
+ - lib/foreman_abrt.rb
59
63
  - lib/foreman_abrt/engine.rb
60
64
  - lib/foreman_abrt/version.rb
61
- - lib/foreman_abrt.rb
62
65
  - lib/tasks/foreman_abrt_tasks.rake
63
- - LICENSE
64
- - Rakefile
65
- - README.md
66
- - test/unit/abrt_report_test.rb
67
- - test/unit/helpers/abrt_reports_helper_test.rb
68
- - test/unit/foreman_abrt_test.rb
69
- - test/functional/abrt_reports_controller_test.rb
70
66
  - test/fixtures/abrt_reports.yml
67
+ - test/functional/abrt_reports_controller_test.rb
71
68
  - test/test_plugin_helper.rb
72
- - test/factories/foreman_abrt_factories.rb
69
+ - test/unit/abrt_report_test.rb
70
+ - test/unit/foreman_abrt_test.rb
71
+ - test/unit/helpers/abrt_reports_helper_test.rb
73
72
  homepage: http://github.com/abrt/foreman_abrt
74
73
  licenses:
75
74
  - GPL-3.0
@@ -80,25 +79,24 @@ require_paths:
80
79
  - lib
81
80
  required_ruby_version: !ruby/object:Gem::Requirement
82
81
  requirements:
83
- - - '>='
82
+ - - ">="
84
83
  - !ruby/object:Gem::Version
85
84
  version: '0'
86
85
  required_rubygems_version: !ruby/object:Gem::Requirement
87
86
  requirements:
88
- - - '>='
87
+ - - ">="
89
88
  - !ruby/object:Gem::Version
90
89
  version: '0'
91
90
  requirements: []
92
91
  rubyforge_project:
93
- rubygems_version: 2.1.11
92
+ rubygems_version: 2.4.8
94
93
  signing_key:
95
94
  specification_version: 4
96
95
  summary: Display reports from Automatic Bug Reporting Tool
97
96
  test_files:
98
- - test/unit/abrt_report_test.rb
99
- - test/unit/helpers/abrt_reports_helper_test.rb
100
- - test/unit/foreman_abrt_test.rb
97
+ - test/test_plugin_helper.rb
101
98
  - test/functional/abrt_reports_controller_test.rb
102
99
  - test/fixtures/abrt_reports.yml
103
- - test/test_plugin_helper.rb
104
- - test/factories/foreman_abrt_factories.rb
100
+ - test/unit/abrt_report_test.rb
101
+ - test/unit/foreman_abrt_test.rb
102
+ - test/unit/helpers/abrt_reports_helper_test.rb
@@ -1,5 +0,0 @@
1
- FactoryGirl.define do
2
- factory :host do
3
- name 'foreman_abrt'
4
- end
5
- end