Repository navigation
Releases
v0.2.0
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_bytesNew 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|wanfor sites, and--durationor--start/--endwithin 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.--pointsprints every value, top N metrics print as a table, and-o json|yamlprints 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,--adminor--text.-o wideadds 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--deviceto keep one AP.get nac-rulesanddescribe nac-rule: NAC rules in evaluation order, with their tags shown by name.describeshows 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 Xis a health summary: counters, devices not connected, unacknowledged alarms and SLE scores over--duration.describe device Xadds the ports that are up (switches and WAN edges), the unacknowledged alarms naming the device and its last events.describe port DEVICE:PORTadds the neighbor device, the device'sport_configentry, the wired clients on the port and its last events.describe clientnow 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 indescribe clientandget 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 auditadds 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 impactedadds 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 mxedgenow works for Mist Edges assigned to a site, and shows whether an edge is org- or site-level.describe deviceanddescribe portreject an invalid time window (bad--duration,--start/--end, or a start after the end) before spending any API call.getcommands also refuse an empty window up front.get config-history --devicefinds the device's site by itself, so--siteis 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.
troubleshootneeds a Marvis subscription on the org.
Changelog
- 8910806: Add describe alarm, fix describe mxedge for site-level edges, require --source on get events (#29) (@tmunzer-AIDE)
- 1e2651d: Add describe nac-client MAC: last verdict, matched rule, labels, events (#39) (@tmunzer-AIDE)
- 5a6cd8b: Add describe sle METRIC: success rate and ranked classifiers (#35) (@tmunzer-AIDE)
- 020dd95: Add get audit-logs: who changed what, by site, admin or message (#30) (@tmunzer-AIDE)
- e5a9a10: Add get config-history: the configurations Mist pushed to a site's APs (#32) (@tmunzer-AIDE)
- cfb6479: Add get licenses (#34) (@tmunzer-AIDE)
- d8e2f05: Add get nac-rules and describe nac-rule (#33) (@tmunzer-AIDE)
- 10fbe84: Add mistctl insights: metrics over time by object name (#36) (@tmunzer-AIDE)
- f20f4d0: Add troubleshoot (Marvis) for clients, devices and sites (#31) (@tmunzer-AIDE)
- 48a8055: Fix time window checks in describe, paged insight series, config-history by MAC (#44) (@tmunzer-AIDE)
- c76cc75: Richer Homebrew tap and Scoop bucket READMEs, kept in sync by release-repos (#27) (@tmunzer-AIDE)
- 52261c8: describe client: accept a hostname, and complete client hostnames (#28) (@tmunzer-AIDE)
- b8a4dad: describe device: ports up, alarms naming the device and last events (#40) (@tmunzer-AIDE)
- 75bb9b8: describe port: neighbor device, port_config, wired clients and events (#38) (@tmunzer-AIDE)
- c5912c2: describe site: health summary (devices down, open alarms, SLE scores) (#37) (@tmunzer-AIDE)
v0.1.1
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.
getlists resources,describeshows one object with its config and stats, and-o table|wide|json|yaml|namecontrols 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-resourcesfor 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-contextor--context. TheMIST_APITOKEN,MIST_HOSTandMIST_ORG_IDenvironment variables are honored. - API budget awareness.
mistctl usageshows 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 7dSee 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
- 126daf5: Release from the maintainer's Mac: sign and notarize with the local keychain (#26) (@tmunzer-AIDE)
- dd44f9b: ci: pin macOS runner and add job timeout (#24) (@tmunzer-AIDE)
- 844f595: release-secrets: prompt for missing files and IDs, expand ~ in paths (#25) (@tmunzer-AIDE)