How to remove default dashboards

Is there a way to remove (some of) the default dashboard?
I defined my own and don’t really need the default ones …

When you navigate to “Dashboard” > “Settings” is a trash bin icon on the right of every dashboard and dashlet, clicking it will create an entry in /etc/icingaweb2/dashboards/YOURUSER/dashboard.ini so the dashboard is not show to you any longer!

You can also do this globally but this requires some coding like https://github.com/Thomas-Gelf/icingaweb2-module-enforceddashboard

1 Like

oh, that removes the whole dashboard, not just the dashlet …

you don’t happen to know if there is also a way to re-order dashboards?
especially changing the one shown first would be nice :slight_smile:

The order of the sections in the file does matter, but not sure if you can simply use this to reorder the default ones.

nope, i tried … too bad :slight_smile:

Hi, you can reorder the defaults, but need to adjust the “/usr/share/icingaweb2/modules/monitoring/configuration.php” file. Of course “warranty lost” and if update performed, the file will be most-likely updated too … but worth to try :wink:

BTW, if interested, I managed to include one more level/layer > now there are “configuration.php” as default-default and user’s ‘/etc/icingaweb2/dashboards//dashboard.ini’ config files for dashboards.
I inserted “my-default” - means: I have “default-defalut”, “my-default” and “user’s dashboard” now.

to include one more “local-default” level edit “/usr/share/php/Icinga/Web/Widget/Dashboard.php”:

  • add “$this->loadUserDashboardsFromFile('/etc/icingaweb2/dashboards/defaultdashboard.ini', $navigation);

as

    protected function loadUserDashboards(Navigation $navigation)
    {
        $this->loadUserDashboardsFromFile('/etc/icingaweb2/dashboards/defaultdashboard.ini', $navigation);
        foreach (DashboardConfig::listConfigFilesForUser($this->user) as $file) {
            $this->loadUserDashboardsFromFile($file, $navigation);
        }
    }
  • modify $panes[$key]->setUserWidget();
    to
    if (strpos($file, 'defaultdashboard.ini') === false) { $panes[$key]->setUserWidget(); }

  • same for $dashlet->setUserWidget();
    to
    if (strpos($file, 'defaultdashboard.ini') === false) { $dashlet->setUserWidget(); }

  • don’t forget to create /etc/icingaweb2/dashboards/defaultdashboard.ini :slight_smile: