Clean up of Compliance Reports

Hello,

Is there a rake task or some other possibility to clean up the compliance
reports? Something like "older then …".

Thank you,
Cristian Falcas

> Hello,
>
> Is there a rake task or some other possibility to clean up the compliance
> reports? Something like "older then …".

Looking at the reports:expire task, I think you can do this to
expire all reports older than 30 days:

foreman-rake reports:expire report_type=ArfReport days=30

··· On Fri, Mar 17, 2017 at 10:07 AM, Cristian Falcas wrote:

Thank you,
Cristian Falcas


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.

There is the error thrown when running the command. It looks like there is
no report type ArfReport.

foreman-rake reports:expire report_type=ArfReport days=30

Could not find a report of type ArfReport, please check spelling /
underscore errors
rake aborted!
NameError: uninitialized constant ArfReport
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/inflector/methods.rb:261:in
const_get' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/inflector/methods.rb:261:inblock in constantize'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/inflector/methods.rb:259:in
each' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/inflector/methods.rb:259:ininject'
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/inflector/methods.rb:259:in
constantize' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/core_ext/string/inflections.rb:66:inconstantize'
/usr/share/foreman/lib/tasks/reports.rake:22:in report_type&#39; /usr/share/foreman/lib/tasks/reports.rake:34:inblock (2 levels) in <top
(required)>'
Tasks: TOP => reports:expire
(See full trace by running task with --trace)

··· On Fri, Mar 17, 2017 at 10:00 PM, Stephen Benjamin wrote:

On Fri, Mar 17, 2017 at 10:07 AM, Cristian Falcas > cristi.falcas@gmail.com wrote:

Hello,

Is there a rake task or some other possibility to clean up the compliance
reports? Something like “older then …”.

Looking at the reports:expire task, I think you can do this to
expire all reports older than 30 days:

foreman-rake reports:expire report_type=ArfReport days=30

Thank you,
Cristian Falcas


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.

Also "foreman-rake reports:expire days=30" doesn't expire arf_reports.

··· On Mon, Mar 20, 2017 at 12:17 PM, Cristian Falcas wrote:

There is the error thrown when running the command. It looks like there
is no report type ArfReport.

foreman-rake reports:expire report_type=ArfReport days=30

Could not find a report of type ArfReport, please check spelling /
underscore errors
rake aborted!
NameError: uninitialized constant ArfReport
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-
4.2.5.1/lib/active_support/inflector/methods.rb:261:in const_get' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport- 4.2.5.1/lib/active_support/inflector/methods.rb:261:inblock in
constantize’
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-
4.2.5.1/lib/active_support/inflector/methods.rb:259:in each' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport- 4.2.5.1/lib/active_support/inflector/methods.rb:259:ininject’
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-
4.2.5.1/lib/active_support/inflector/methods.rb:259:in constantize' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport- 4.2.5.1/lib/active_support/core_ext/string/inflections.rb:66:inconstantize’
/usr/share/foreman/lib/tasks/reports.rake:22:in report_type' /usr/share/foreman/lib/tasks/reports.rake:34:inblock (2 levels) in <top
(required)>'
Tasks: TOP => reports:expire
(See full trace by running task with --trace)

On Fri, Mar 17, 2017 at 10:00 PM, Stephen Benjamin stephen@redhat.com > wrote:

On Fri, Mar 17, 2017 at 10:07 AM, Cristian Falcas >> cristi.falcas@gmail.com wrote:

Hello,

Is there a rake task or some other possibility to clean up the
compliance
reports? Something like “older then …”.

Looking at the reports:expire task, I think you can do this to
expire all reports older than 30 days:

foreman-rake reports:expire report_type=ArfReport days=30

Thank you,
Cristian Falcas


You received this message because you are subscribed to the Google
Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send
an
email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.

Hi,
try the following command:

foreman-rake reports:expire report_type=ForemanOpenscap::ArfReport days=30

··· On Monday, March 20, 2017 at 11:21:41 AM UTC+1, Cristian Falcas wrote: > > Also "foreman-rake reports:expire days=30" doesn't expire arf_reports. > > On Mon, Mar 20, 2017 at 12:17 PM, Cristian Falcas > wrote: > >> There is the error thrown when running the command. It looks like there >> is no report type ArfReport. >> >> # foreman-rake reports:expire report_type=ArfReport days=30 >> >> Could not find a report of type ArfReport, please check spelling / >> underscore errors >> rake aborted! >> NameError: uninitialized constant ArfReport >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport- >> 4.2.5.1/lib/active_support/inflector/methods.rb:261:in `const_get' >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport- >> 4.2.5.1/lib/active_support/inflector/methods.rb:261:in `block in >> constantize' >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport- >> 4.2.5.1/lib/active_support/inflector/methods.rb:259:in `each' >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport- >> 4.2.5.1/lib/active_support/inflector/methods.rb:259:in `inject' >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport- >> 4.2.5.1/lib/active_support/inflector/methods.rb:259:in `constantize' >> /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport- >> 4.2.5.1/lib/active_support/core_ext/string/inflections.rb:66:in >> `constantize' >> /usr/share/foreman/lib/tasks/reports.rake:22:in `report_type' >> /usr/share/foreman/lib/tasks/reports.rake:34:in `block (2 levels) in > (required)>' >> Tasks: TOP => reports:expire >> (See full trace by running task with --trace) >> >> >> On Fri, Mar 17, 2017 at 10:00 PM, Stephen Benjamin > > wrote: >> >>> On Fri, Mar 17, 2017 at 10:07 AM, Cristian Falcas >>> <cristi...@gmail.com > wrote: >>> > Hello, >>> > >>> > Is there a rake task or some other possibility to clean up the >>> compliance >>> > reports? Something like "older then ...". >>> >>> Looking at the reports:expire task, I *think* you can do this to >>> expire all reports older than 30 days: >>> >>> foreman-rake reports:expire report_type=ArfReport days=30 >>> >>> >>> > Thank you, >>> > Cristian Falcas >>> > >>> > -- >>> > You received this message because you are subscribed to the Google >>> Groups >>> > "Foreman users" group. >>> > To unsubscribe from this group and stop receiving emails from it, send >>> an >>> > email to foreman-user...@googlegroups.com . >>> > To post to this group, send email to forema...@googlegroups.com >>> . >>> > Visit this group at https://groups.google.com/group/foreman-users. >>> > For more options, visit https://groups.google.com/d/optout. >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Foreman users" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to foreman-user...@googlegroups.com . >>> To post to this group, send email to forema...@googlegroups.com >>> . >>> Visit this group at https://groups.google.com/group/foreman-users. >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> >

It's working,

Thank you

··· On Tue, Mar 21, 2017 at 8:54 AM, wrote:

Hi,
try the following command:

foreman-rake reports:expire report_type=ForemanOpenscap::ArfReport days=30

On Monday, March 20, 2017 at 11:21:41 AM UTC+1, Cristian Falcas wrote:

Also “foreman-rake reports:expire days=30” doesn’t expire arf_reports.

On Mon, Mar 20, 2017 at 12:17 PM, Cristian Falcas cristi...@gmail.com >> wrote:

There is the error thrown when running the command. It looks like there
is no report type ArfReport.

foreman-rake reports:expire report_type=ArfReport days=30

Could not find a report of type ArfReport, please check spelling /
underscore errors
rake aborted!
NameError: uninitialized constant ArfReport
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.
2.5.1/lib/active_support/inflector/methods.rb:261:in const_get' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4. 2.5.1/lib/active_support/inflector/methods.rb:261:inblock in
constantize’
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.
2.5.1/lib/active_support/inflector/methods.rb:259:in each' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4. 2.5.1/lib/active_support/inflector/methods.rb:259:ininject’
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.
2.5.1/lib/active_support/inflector/methods.rb:259:in constantize' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4. 2.5.1/lib/active_support/core_ext/string/inflections.rb:66:inconstantize’
/usr/share/foreman/lib/tasks/reports.rake:22:in report_type' /usr/share/foreman/lib/tasks/reports.rake:34:inblock (2 levels) in
<top (required)>'
Tasks: TOP => reports:expire
(See full trace by running task with --trace)

On Fri, Mar 17, 2017 at 10:00 PM, Stephen Benjamin ste...@redhat.com >>> wrote:

On Fri, Mar 17, 2017 at 10:07 AM, Cristian Falcas >>>> cristi...@gmail.com wrote:

Hello,

Is there a rake task or some other possibility to clean up the
compliance
reports? Something like “older then …”.

Looking at the reports:expire task, I think you can do this to
expire all reports older than 30 days:

foreman-rake reports:expire report_type=ArfReport days=30

Thank you,
Cristian Falcas


You received this message because you are subscribed to the Google
Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it,
send an
email to foreman-user...@googlegroups.com.
To post to this group, send email to forema...@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


You received this message because you are subscribed to the Google
Groups “Foreman users” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to foreman-user...@googlegroups.com.
To post to this group, send email to forema...@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.


You received this message because you are subscribed to the Google Groups
"Foreman users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.