cn-tool
cn-tool looks up addresses, subnets, DNS names and sites in Infoblox, pings and monitors hosts, and searches local device configurations. It is for network engineers and system administrators, and has three interfaces over one configuration file: a local browser interface, an interactive terminal menu and a command line for scripts.
Quick start
pip install "cn-tool[webui]" # or: pipx install "cn-tool[webui]"
cn init # writes ~/.cn and never overwrites one
cn doctor # checks the configuration and the Infoblox connection
cn-web # opens the browser interface on 127.0.0.1
Between cn init and cn doctor, open ~/.cn (%USERPROFILE%\.cn on Windows) and set
endpoint under [api] to the WAPI URL of your grid. Ping and Monitor work without Infoblox.
Without the [webui] extra you get the menu (cn) and the command line only.
On Windows, cn-web --create-shortcut adds a cn-tool Web shortcut to the Start menu and the
Desktop (-c FILE for another configuration file, --console to keep a console window). Where policy
(AppLocker, WDAC, antivirus) blocks cn.exe and cn-web.exe, start cn-tool through the signed
python.exe of the environment it is installed in; the commands and options are the same:
python -m cn_tool.webui # instead of cn-web
python -m cn_tool.webui --create-shortcut # a shortcut that starts the signed pythonw.exe
python -m cn_tool ip 10.1.2.3 # instead of cn ip 10.1.2.3
Use that environment's full path to python.exe (no Activate.ps1 needed); see
Starting on a managed Windows PC.
Command line
$ cn ping 127.0.0.1 --tcp 22,443
PING
╷ ╷ ╷ ╷
Host │ Address │ Result │ TCP 22 │ TCP 443
╶───────────┼───────────┼────────┼────────┼─────────╴
127.0.0.1 │ 127.0.0.1 │ OK │ closed │ closed
╵ ╵ ╵ ╵
cn ip 192.0.2.5 --format json # one address: subnet, DNS name, status
cn subnet 192.0.2.0/24 --available # a subnet, and its addresses with no record
cn monitor 192.0.2.0/28 --every 1m --for 2h
cn diff router01 --since 24h # configuration changes of a device
Results go to stdout, progress and errors to stderr, and a command never prompts without a
terminal. cn alone opens the menu; cn --help lists the commands.
Features
- Infoblox lookups: IPv4 and IPv6 addresses, subnets, DNS names and sites, with network views, DHCP data and extensible attributes.
- Ping and Monitor: ICMP and TCP checks of hosts and subnets, repeated rounds with a stored history, and a map of every address in the browser.
- Unused addresses: the addresses of a subnet with no Infoblox record, and the monitored addresses that never replied.
- Device configurations: search a local repository, list what changed (
cn diff) and compare snapshots in a terminal browser. - Output: table, JSON, Markdown or CSV on the command line; an Excel report, with optional email delivery.
- Optional integrations: Active Directory subnets, SD-WAN YAML search and device inventory over SSH.
Requirements
- Python 3.10 or newer (tested on 3.10, 3.12, 3.13 and 3.14).
- Linux, macOS, or Windows 10 and 11 (x64).
- For Infoblox lookups: a WAPI URL and an account that may use the API and read the data.
- For ICMP: the
pingcommand of the system. For the browser interface: a current browser.
cn-tool reads from Infoblox and never changes it. Reports can hold sensitive network data and keep earlier results, so review one before you share it. A list of unused addresses is a lead to check, not proof that an address is free.
Documentation
This README and the guides describe the current source, 0.15.0; check cn --version and
choose the matching tag for an installed release. The menu and the command line are as in
0.8.4; release 0.9.0 added the browser tools beyond Subnets, and 0.10.0 the unused
address lists. The documentation index
and the WebUI guide
give the version scope in full.
| Guide | Covers |
|---|---|
| Installation | pipx, virtual environments, release archives, upgrades, first run |
| Install with your own Python | A Python in /opt with a virtual environment in your home |
| Windows | PowerShell, managed PCs and the cn-tool Web shortcut, scheduled tasks |
| Browser interface | Every page, keyboard shortcuts, reports, Stop and Quit |
| Command line | Commands, input files, output formats, exit statuses, cn doctor |
| Infoblox | Access and setup, network views, IPv6, unused addresses |
| Ping and monitoring | Probe limits, history, reruns and deletion |
| Configuration | File precedence, every setting, reports |
| Credentials | Infoblox and device accounts, environment variables, GPG files |
| Integrations | Active Directory, email, SD-WAN YAML, device inventory |
| Configuration history | cn diff, repository layout, the terminal browser |
| Release notes | Changes and upgrade notes for each release |
Releases · Issues · PyPI · Apache-2.0 license
Metadata
Release files for cn-tool 0.15.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cn_tool-0.15.0.tar.gz | 1.2 MB | Without provenance | Details for cn_tool-0.15.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cn_tool-0.15.0-py3-none-any.whl | Python 3 | none | any | Details for cn_tool-0.15.0-py3-none-any.whl |
Total release size: 2.2 MB
Release files / cn_tool-0.15.0.tar.gz
| Download URL | cn_tool-0.15.0.tar.gz |
|---|---|
| Size | 1.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8c06b0dc68d1c31762f676f5b471883828e08d481b0b5ea21ad4c11146501ae0
|
|
BLAKE2b-256 checksum How to use checksums |
ddfca1c714281da5e9480a89523137abb9500b2ce7236dc17dcf05e11222fb81
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / cn_tool-0.15.0-py3-none-any.whl
| Download URL | cn_tool-0.15.0-py3-none-any.whl |
|---|---|
| Size | 997.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8f6cf6263a75ed0f5586a51990dd6e90921c4eeef3422b432defe14ebeb9262b
|
|
BLAKE2b-256 checksum How to use checksums |
686db9f373c283ca690b4614937a58ee9ad89a31573cb73a84414f7fb07dc7e5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Security for cn-tool 0.15.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.