Skip to content

Releases

v0.2.0

Choose a tag to compare

@tmunzer-AIDE tmunzer-AIDE released this 18 Nov 17:24
v0.2.0
48a8055

mistctl v0.2.0

This release turns describe into a troubleshooting tool. It also adds Marvis troubleshooting, insight metrics over time, and four new resource types: audit logs, config history, NAC rules and licenses. mistctl is still read-only.

$ mistctl describe site HQ
$ mistctl troubleshoot client aa:bb:cc:dd:ee:ff
$ mistctl insights switch sw-core cpu rx_bytes

New commands

  • mistctl troubleshoot client MAC | device NAME | site [NAME]. Shows what Marvis found for a client, a device or a site: each finding with its explanation and recommendation. Use --type wireless|wired|wan for sites, and --duration or --start/--end within the last 7 days. API warnings, such as a missing Marvis subscription, go to stderr. This needs a Marvis subscription.
  • mistctl insights site|client|ap|switch|gateway|mxedge [NAME] [METRIC...]. Shows Mist insight metrics without building the request by hand. Objects are found by name, so the site is looked up for you. A few useful metrics are shown when you name none. The interval is picked from the window, and each series gets one summary line with a trend. --points prints every value, top N metrics print as a table, and -o json|yaml prints the raw API answer. Metric names, device names and client hostnames tab-complete. mistctl insights metrics [KIND] lists the metrics of each kind of object.

New resources

  • get audit-logs: who changed what, filtered by --site, --admin or --text. -o wide adds the source IP, user agent and device name.
  • get config-history --site X: the configurations Mist pushed to a site's APs (version, SSIDs, band and channel), with --device to keep one AP.
  • get nac-rules and describe nac-rule: NAC rules in evaluation order, with their tags shown by name. describe shows what each referenced tag matches or assigns.
  • get licenses: entitled, used and available per license type for the org. With --site, it shows the site's usage next to the org entitlement.

Richer describe

Each new view states how many API calls it costs, in --help and in the README. A section that cannot be read is reported on its own line and does not fail the command.

  • describe site X is a health summary: counters, devices not connected, unacknowledged alarms and SLE scores over --duration.
  • describe device X adds the ports that are up (switches and WAN edges), the unacknowledged alarms naming the device and its last events.
  • describe port DEVICE:PORT adds the neighbor device, the device's port_config entry, the wired clients on the port and its last events.
  • describe client now takes a hostname as well as a MAC. A hostname shared by several clients lists their MACs so you can pick one. Client hostnames tab-complete in describe client and get clients.
  • describe alarm ID (new) finds the alarm and adds its definition, the current state of the affected devices, their events around the alarm, the email recipients and webhooks it goes to, and the 30-day count of that alarm type. --with audit adds the configuration changes of the hour before.
  • describe sle METRIC --site X (new) shows a metric's success rate and the classifiers behind the degraded part, ranked. --with impacted adds the most affected clients and devices.
  • describe nac-client MAC (new) explains the last NAC verdict: the matched rule with its tags by name, the user MAC labels and the last authentication events.

Fixes

  • describe mxedge now works for Mist Edges assigned to a site, and shows whether an edge is org- or site-level.
  • describe device and describe port reject an invalid time window (bad --duration, --start/--end, or a start after the end) before spending any API call. get commands also refuse an empty window up front.
  • get config-history --device finds the device's site by itself, so --site is no longer needed.
  • Long insight series are read across every page. An incomplete series prints a warning and exits non-zero.
  • The Homebrew tap and Scoop bucket READMEs now cover install, upgrade, uninstall, completions and a quick start.

Install

Platform Command
macOS / Linux (Homebrew) brew upgrade --cask mistctl or brew install --cask tmunzer-AIDE/tap/mistctl
Windows (Scoop) scoop update mistctl or scoop bucket add mistctl https://github.com/tmunzer-AIDE/scoop-bucket then scoop install mistctl
Debian / Ubuntu, RHEL / Fedora, Alpine .deb, .rpm and .apk packages below
Any platform Archives below, or go install github.com/tmunzer-AIDE/mistctl/cmd/mistctl@v0.2.0

The macOS binaries are signed with a Developer ID certificate and notarized by Apple. Each archive has an SBOM, and checksums.txt lists the SHA-256 of every file.

Known limitations

  • mistctl api <path> (raw access to any GET endpoint) is still on the roadmap.
  • Windows binaries are not Authenticode-signed, so a browser download may show a SmartScreen prompt. Installing through Scoop is not affected.
  • troubleshoot needs a Marvis subscription on the org.

Changelog

v0.1.1

Choose a tag to compare

@tmunzer-AIDE tmunzer-AIDE released this 18 Nov 01:40
v0.1.1
126daf5

mistctl v0.1.1

First release of mistctl, a read-only, kubectl-style command line client for the Juniper Mist API, built on mistapi-go.

$ mistctl get devices --site HQ
NAME       TYPE     MODEL    MAC            IP          STATUS         VERSION   UPTIME
ap-lobby   ap       AP45     5c5b35000001   10.0.0.10   connected      0.14.1    1d1h
sw-core    switch   EX4100   5c5b35000002   -           disconnected   -         -

Highlights

  • kubectl-style commands. get lists resources, describe shows one object with its config and stats, and -o table|wide|json|yaml|name controls the output. Objects can be referred to by name, ID or MAC address in any format.
  • 38 curated resource types. These cover orgs, sites, devices, inventory, clients (wireless and wired merged by MAC), NAC and WAN clients, WLANs and templates, networks, EVPN topologies, maps, settings, alarms and events, SLEs, RRM, ports, BGP/OSPF peers, tunnels and Mist Edges. Run mistctl api-resources for the list and the API endpoints behind each one.
  • Wired clients show where they really are. A wired client's row shows only its access switch and port. Uplinks between org switches, stale locations and busy trunk ports are filtered out.
  • Remote shell: mistctl attach DEVICE. Opens an interactive Junos shell on a switch or gateway through the Mist cloud, including one member of an SRX HA cluster (--node node1). Type ~. at the start of a line to quit.
  • Contexts, like kubeconfig. Each context stores a cloud, a token (or the name of an environment variable holding it), a default org and a default site. Switch with config use-context or --context. The MIST_APITOKEN, MIST_HOST and MIST_ORG_ID environment variables are honored.
  • API budget awareness. mistctl usage shows the calls left in the current hourly window. A local name/ID cache keeps tab-completion and name lookups from spending that budget.
  • Shell completion for bash, zsh, fish and PowerShell, with dynamic completion of org, site and device names. Release packages install it automatically.

Read-only by design

Every API request goes through a transport that refuses anything other than GET before it leaves your machine. The single allow-listed exception is the POST that opens the attach remote shell. mistctl cannot restrict what is typed inside that shell, so use an API token with the Observer (read-only) role. mistctl whoami and mistctl attach warn when the token can do more than read.

The shell websocket must use wss:// on the selected cloud's own hosts, and the token is never sent anywhere else. Terminal control characters coming from the API are escaped in table output.

Install

Platform Command
macOS / Linux (Homebrew) brew install --cask tmunzer-AIDE/tap/mistctl
Windows (Scoop) scoop bucket add mistctl https://github.com/tmunzer-AIDE/scoop-bucket then scoop install mistctl
Debian / Ubuntu, RHEL / Fedora, Alpine .deb, .rpm and .apk packages below
Any platform Archives below, or go install github.com/tmunzer-AIDE/mistctl/cmd/mistctl@v0.1.0

Binaries are built for Linux, macOS and Windows on amd64 and arm64. The macOS binaries are signed with a Developer ID certificate and notarized by Apple. Each archive has an SBOM, and checksums.txt lists the SHA-256 of every file.

Quick start

echo "$MIST_TOKEN" | mistctl config set-context prod --cloud global01 --token-stdin --org "ACME"
mistctl whoami
mistctl get sites -o wide
mistctl get devices -A --status disconnected
mistctl get clients --type wired --site HQ
mistctl describe device sw-core
mistctl get alarms --severity critical --duration 7d

See the README for every command, resource and flag.

Known limitations

  • mistctl api <path> (raw access to any GET endpoint) is not in this release yet; it is on the roadmap.
  • Windows binaries are not Authenticode-signed, so a browser download may show a SmartScreen prompt. Installing through Scoop is not affected.
  • winget support is pending review of the package submission.

Support is best-effort open source. Issues and pull requests are welcome.

Changelog