Welcome to docs.opsview.com

Viewport templates

There are two types of viewport templates:

  • viewports
  • viewport summaries

The techniques are similar, though the data available is slightly different.

Create a controller

Create the controller in opsview-web/lib/Opsview/Web/Controller/Viewport/Style/{name}.pm. The contents must contain:

package Opsview::Web::Controller::Viewport::Style::group_by_host;
use strict;
use warnings;
use base qw/Catalyst::Controller/;
__PACKAGE__->config(
        description => "Group by host",
);
sub override :Private {};
1;

The example is for group_by_host. Set the description field - this will be used to construct the edit list. In the override routine, you can change the data that you receive from the stash, or setup whatever methods you want.

See group_by_service for an example of munging the status data so that it is ordered by service, rather than by host.

See opsview-web/lib/Opsview/Web/Controller/Viewport/Summarystyle/tagcloud.pm for an example of override which sets up a new object into the stash.

Create the template

Place your Template Toolkit file in opsview-web/root/viewport/style/{name}.

By default, Opsview will look for a template with the same name as the style.