Command line
The subcommands, flags, configuration file and environment variables of shellgraph.
shellgraph login
Tests a collector token and keeps it in the configuration file.
shellgraph login --server https://shellgraph.example.net --token <token>
| Flag | Default | Description |
|---|---|---|
--server | (required) | Server URL. |
--token | (required) | Collector token. Create it in the server UI. |
--insecure-http | off | Accept an http:// URL that is not localhost or 127.0.0.1. |
shellgraph scan
Scans one VLAN and sends one report.
shellgraph scan --env Production --vlan app-10
| Flag | Default | Description |
|---|---|---|
--env | menu | Environment name or ID. Without it, the collector shows a menu. |
--vlan | menu | VLAN name or ID. Without it, the collector shows a menu. |
--concurrency | 32 | Number of hosts to scan at the same time. |
--samples | 3 | Number of socket samples on each host. More samples find more short connections. |
--interval | 5s | Time between two samples. |
--dry-run | off | Print the report as JSON and do not send it. |
--allow-large | off | Allow a VLAN with more than 4096 addresses. |
--insecure-http | off | Accept an http:// server URL that is not localhost or 127.0.0.1. |
A scan of a /24 VLAN with the default flags takes approximately 15 to 30 seconds. If you stop the scan (Ctrl-C), the collector sends nothing.
shellgraph probe
Collects one host and prints it as JSON. It does not use the server.
shellgraph probe -i ~/.ssh/id_ed25519 shellgraph@10.0.10.12
| Flag | Default | Description |
|---|---|---|
-i | ssh-agent | Private key file. A key with a passphrase must be in the ssh-agent. |
-p | 22 | SSH port. |
-samples | 1 | Number of socket samples. |
-interval | 5s | Time between two samples. |
-no-sudo | off | Do not use sudo for ss. |
-raw | off | Print the raw output of the collection script, not the result. |
shellgraph version
Prints the version.
Configuration
shellgraph login writes the server URL and the token to a file with mode 0600:
| System | File |
|---|---|
| Linux | ~/.config/shellgraph/config.json |
| macOS | ~/Library/Application Support/shellgraph/config.json |
Environment variables
| Variable | Description |
|---|---|
SHELLGRAPH_SERVER | Server URL. It overrides the configuration file. |
SHELLGRAPH_TOKEN | Collector token. It overrides the configuration file. |