Skip to content
ConsoleMonster

Host and port matrix

Put application connectivity and its exceptions on one screen, with host, port and status columns.

Demos Dashboards

Use it when a group of hosts needs a readable overview of required application ports.

  • Static
  • 100×24
  • PowerShell 7.4+
  • .NET 8.0+
Host and port matrix 100×2424-bitFull

How it's built

The whole program in one file, with its sample data at the top. It drew the recording above; both languages draw the same cells.

PowerShellport-matrix.ps1View on GitHub
# See which application ports are healthy across a group of hosts.
param([switch] $StaticSnapshot, [ValidateRange(0, 0)][int] $Step = 0)
Import-Module ConsoleMonster

# Data: synthetic observations; no DNS, ping, socket or network operation runs here.
$hosts = @('web-01', 'web-02', 'api-01', 'sql-01', 'cache-01')
$ports = @('HTTPS 443', 'SQL 5432', 'Cache 6379')
$states = @(
    'Pass', 'Skip', 'Skip'
    'Pass', 'Skip', 'Skip'
    'Pass', 'Fail', 'Warn'
    'Skip', 'Pass', 'Skip'
    'Skip', 'Skip', 'Pass'
)

# Layout: a compact map provides the overview; a table explains exceptions.
$report = New-ConsoleRows -Gap 1 {
    New-ConsoleRule '[bold]Application connectivity[/] [muted]· core services[/]'
    New-ConsolePanel -Title ($ports -join '   |   ') {
        New-ConsoleCellMap -Status $states -Columns 3 -RowLabels $hosts -LegendLines 2
    }
    New-ConsolePanel -Title 'Exceptions to investigate' {
        New-ConsoleStatusList {
            New-ConsoleStatusItem 'api-01 → SQL 5432' -Status Fail -Detail 'Connection refused · check listener and access policy'
            New-ConsoleStatusItem 'api-01 → Cache 6379' -Status Warn -Detail '180 ms · expected under 50 ms'
        }
    }
    '[muted]Skipped cells are ports that host does not need.[/]'
}

# Behaviour: print the collected observations once; collectors belong before the layout.
$report | Write-ConsoleWidget
C#Program.csView on GitHub
// See which application ports are healthy across a group of hosts.
using ConsoleMonster;
using ConsoleMonster.Layout;
using ConsoleMonster.Styling;
using ConsoleMonster.Widgets;

// Data: synthetic observations; no DNS, ping, socket or network operation runs here.
string[] hosts = { "web-01", "web-02", "api-01", "sql-01", "cache-01" };
string[] ports = { "HTTPS 443", "SQL 5432", "Cache 6379" };
StatusKind[] states = {
    StatusKind.Pass, StatusKind.Skip, StatusKind.Skip,
    StatusKind.Pass, StatusKind.Skip, StatusKind.Skip,
    StatusKind.Pass, StatusKind.Fail, StatusKind.Warn,
    StatusKind.Skip, StatusKind.Pass, StatusKind.Skip,
    StatusKind.Skip, StatusKind.Skip, StatusKind.Pass
};

// Layout: a compact map provides the overview; a table explains exceptions.
CellMap map = new CellMap { Columns = 3, LegendLines = 2 };
foreach (string host in hosts) map.RowLabels.Add(host);
foreach (StatusKind state in states) map.Add(state);
StatusList exceptions = new StatusList()
    .Add("api-01 → SQL 5432", StatusKind.Fail, "Connection refused · check listener and access policy")
    .Add("api-01 → Cache 6379", StatusKind.Warn, "180 ms · expected under 50 ms");
Rows report = new Rows(new Rule("[bold]Application connectivity[/] [muted]· core services[/]"),
    new Panel(map, string.Join("   |   ", ports)),
    new Panel(exceptions, "Exceptions to investigate"),
    new TextBlock("[muted]Skipped cells are ports that host does not need.[/]")) { Gap = 1 };

// Behaviour: print the collected observations once; collectors belong before the layout.
Terminal.Write(report);

Run it yourself

Three steps in PowerShell, four in C#. Every command copies with one click.

  1. Install the module

    Once. Windows PowerShell 5.1 or PowerShell 7 on Windows, macOS or Linux.

    Install-Module ConsoleMonster -Scope CurrentUser
  2. Save the program

    Download it, or copy it from above into port-matrix.ps1.

  3. Run it

    From the folder you saved it in.

    ./port-matrix.ps1
  1. Create a project

    A plain console app; .NET 8 or later.

    dotnet new console -n Portmatrix; cd Portmatrix
  2. Add ConsoleMonster

    The only package the program needs.

    dotnet add package ConsoleMonster
  3. Replace Program.cs

    Download it, or copy the program from above.

  4. Run it

    dotnet run

Or skip the copying. Every demo ships with the module and the project template.

Show-ConsoleDemo port-matrix
Get-ConsoleDemo port-matrix -Path ./port-matrix.ps1
dotnet new install ConsoleMonster.Templates
dotnet new consolemonster --demo port-matrix -n Portmatrix

Make it yours

Start with these, then read the rest of the file.

  1. Replace the inline observations with results collected separately from the layout.

  2. List the ports each host actually needs and keep unused cells marked Skip.

  3. Add latency budgets and actionable details for failed or slow observations.

More dashboards

All demos