Skip to content
CanopyX

Status matrix

A state for each pair of two sets, with totals, grouping and sorting on both axes and both axes windowed.

CanopyMatrix60 servers by 14 servicesDocumentation for the status matrix

3 demos

Services by server Open this demo full screen

A state for each pair of two sets, with totals, grouping and sorting on both axes and both axes windowed.

Build one like it

The smallest complete version, in each language CanopyX supports for this view. The demo above is the same API with more data.

using CanopyX;
using CanopyX.Html;

var matrix = new CanopyMatrix("services", "Services by server");
matrix
    .State("critical", "Critical", CanopyTone.Danger, CanopyMatrixSymbol.Cross,
        attention: true)
    .State("warning", "Warning", CanopyTone.Warning, CanopyMatrixSymbol.Warning,
        attention: true)
    .State("ok", "Running", CanopyTone.Success, CanopyMatrixSymbol.Check)
    .State("absent", "Not installed", CanopyTone.Muted, CanopyMatrixSymbol.Dash);
matrix.Rows.Title = "Server";
matrix.Rows.Attribute("site", "Site", facet: true);
matrix.Rows.GroupBy = "site";
matrix.Columns.Title = "Service";
foreach (var (id, label) in new[] {
    ("dns", "DNS"), ("ldap", "LDAP"),
    ("smb", "File sharing"), ("backup", "Backup agent")
}) {
    matrix.Columns.Item(id, label);
}

var services = new[] { "dns", "ldap", "smb", "backup" };
foreach (var (server, site, states) in new[] {
    ("SRV-OSL-01", "Oslo", "ok ok ok ok"),
    ("SRV-OSL-02", "Oslo", "ok warning ok critical"),
    ("SRV-LYO-01", "Lyon", "ok ok warning ok"),
    ("SRV-LYO-02", "Lyon", "absent absent ok ok")
}) {
    var row = server.ToLowerInvariant();
    matrix.Rows.Item(row, server, item => item.Value("site", site));
    var cells = states.Split(' ');
    for (var i = 0; i < services.Length; i++) {
        var cell = matrix.Set(row, services[i], cells[i]);
        if (cells[i] == "critical") cell.Title = "Probes failing: 3/3.";
    }
}
matrix.SaveHtmlPage("matrix.html");

Run this snippet (status matrix, C#)Its output, generated with the site.

Try this in the demo

  1. Attention first

    Turn on Only problems.

    Rows and columns without a critical or warning cell fold away, and the totals follow.

  2. Grouping on an axis

    Collapse a site.

    The heading keeps its server count and its totals while its rows are hidden.

  3. Both axes windowed

    Search for a service or a server, then scroll both ways.

    Only the cells on screen are in the page, so wide matrices stay quick.