Foreman statistics not working

Problem:
/foreman_statistics/statistics fails.

Expected outcome:

Foreman and Proxy versions:

foreman: 3.8

Foreman and Proxy plugin versions:

|foreman-tasks|8.2.0|
|foreman_ansible|12.0.7|
|foreman_openscap|7.0.0|
|foreman_remote_execution|11.1.0|
|foreman_statistics|2.0.1|
|katello|4.10.0|

Distribution and version:

Rocky Linux 8.8

Other relevant data:

Apparently there are two problems causing this issue:

  1. ActionView::Template::Error (undefined local variable or method `notifications’ for #ActionView::Base:0x00000000050410):

this was already fixed but for some reason the rpm is still being built with an older version

  1. ActionView::Template::Error (render file: should be given the absolute path to a file. ‘layouts/base’ was given instead):

this can be fixed by changing the word file with template in the last line of the same file.

So this file foreman_statistics/app/views/foreman_statistics/layouts/application_react.html.erb ends like this:

<% content_for(:javascripts) do %>
  <%= webpacked_plugins_js_for :foreman_statistics %>
<% end %>
<% content_for(:stylesheets) do %>
  <%= webpacked_plugins_css_for :foreman_statistics %>
<% end %>

<% content_for(:content) do %>
  <div id="organization-id" data-id="<%= Organization.current.id if Organization.current %>" ></div>
  <div id="user-id" data-id="<%= User.current.id if User.current %>" ></div>
  <%= react_component('ForemanStatistics') %>
<% end %>
<%= render template: "layouts/base" %>

It seems there was no release after this was merged. This plugin seems less maintained these days. @evgeni @ekohl @Ron_Lavi as you are the 3 contributors in this plugin and active on the project, could you cut a new release please?

Also @mindo, I’d be interested in your use case for the plugin. What are the statistics you are interested in and why. The functionality has been extracted to a plugin, because it seems it’s value is quite low, we rarely hear about people using it.

Hello Marek,

We basically use it for this graph:

Screenshot_20231113_171553

That allows us to visually see how much CentOS 7 machines we still have to migrate to Rocky Linux before C7 reaches eol.
We also have multiple organizations and locations e those also give us a quick overview of the machines’ distribution.

All the others are not really important for us - and they don’t even appear to be really working. For example, the hardware info shows 100% oVirt, but we have lots of physical machines and VMware VMs.

1 Like

I’ll investigate the render file thing and can do a release afterwards, yeah.

I’ve released 2.1.0

Will see that the pkgs land in 3.8 and 3.7 pockets once built

3 Likes

packages released

2 Likes

Thanks @evgeni !!

Thanks for the feedback, I wonder whether we shouldn’t add something like this to our OS list page. @MariSvirik how would you put a pie chart to general list page? In this case list of operating systems?