puppetexplorer icon indicating copy to clipboard operation
puppetexplorer copied to clipboard

Show Fact counts on the Dashboard

Open elofu17 opened this issue 8 years ago • 1 comments

Request:

If https://github.com/dalen/puppetexplorer/issues/67 (a new facts drill down page) is fixed, it would also be nice if the Dashboard tab could show cells linking to said page.

The cell itself should simply show a count() of the unique number of values for that fact.

In the dashboard code you need to add something to distinguish between the current querys, whom are directed at the nodes page, to a cell that is instead pointing at the fact page.

  dashboard_panels   => [
    {
      'name'  => 'Nodes with failures',
      'type'  => 'danger',
      'query' => '#node.latest_report_status="failed"'
    },
    {
      'name'  => 'Uptime',
      'type'  => 'info',
      'fact' => 'uptime_days'
    },
    ...and so on...

The keynames 'query' and 'fact' are mutually exclusive, you can only set one.

/Elof

elofu17 avatar May 24 '17 11:05 elofu17

The above code would show a dashboard with two panels. The first panel show the number of failed nodes and it links to the nodes page (https://puppetexplorer.foo.bar.se/#/nodes?query=.....). The second panel show the number of unique uptimes (in days) of all my machines. This panel links to the new fact-drilldown page (https://puppetexplorer.foo.bar.se/#/factdrilldown?fact=.....).

So if I have 10 puppet nodes where 9 of them were just patched and rebooted, the Uptime panel might show "3". When I click on this panel, the drilldown-page show me the details of the 3 uptimes:

node      uptime_days
----------------------
server1   1
server2   0
server3   0
server4   0
server5   0
server6   0
server7   0
server8   0
server9   0
server10  23

When I think I'm done patching, puppetexplorer indicates to me that server10 has probably not been patched yet, that server1 was patched yesterday and servers 2-9 was patched today.

elofu17 avatar Aug 16 '17 15:08 elofu17