Fix README to reflect NocoDB-driven switch inventory

This commit is contained in:
2026-05-05 20:18:58 +00:00
parent b8582a06e9
commit 5dcd908f33
+41 -17
View File
@@ -5,30 +5,38 @@ Discovers switch topology via LLDP, stores in SQLite, and visualises with Cytosc
## Quick Start
### 1. Configure your switches
### 1. Configure
Edit `mapper/config.py`:
Copy `config.py.example` to `config.py` and fill in your values:
```bash
cp config.py.example config.py
nano config.py
```
```python
SWITCHES = [
"192.168.1.1",
"192.168.1.2",
# Add all switch management IPs
]
NOCODB_URL = "http://your-nocodb-host:8080"
NOCODB_TOKEN = "your-api-token"
SSH_USERNAME = "admin"
SSH_PASSWORD = "yourpassword"
SSH_PASSWORD = "your-ssh-password"
SSH_PORT = 22
SSH_TIMEOUT = 30
DEVICE_TYPE = "cisco_ios"
```
Switch IPs are pulled automatically from NocoDB — no manual list needed.
See [NocoDB Requirements](#nocodb-requirements) below.
### 2. Build and run
```bash
docker-compose up --build
docker compose up -d --build
```
### 3. Open the UI
Navigate to: http://localhost:5000
Navigate to: `http://your-host-ip:5000`
Click **Scan Now** to start discovery.
@@ -60,18 +68,34 @@ All files written to `data/exports/`:
Toggle auto-scan on/off from the UI. Set interval (15 min to 6 hours).
State persists across container restarts.
## NocoDB Requirements
Switch inventory is loaded from NocoDB automatically. The table must have:
| Column | Description |
|--------|-------------|
| `IP` | Switch management IP — required |
| `Hostname` | Switch hostname |
| `Active` | Must be `YES` to be included in scans |
| `Dept` | Department code (e.g. `ELEC`, `GW`) — used for filtering |
| `Location` | Physical location label |
| `Model` | Switch model |
| `Manufacturer` | Switch manufacturer |
| `Asset Tag` | Asset tag |
The NocoDB base ID and table ID are hardcoded in `nocodb_client.py` — update them there if you point this at a different NocoDB instance.
## Troubleshooting
**Auth errors**: Check SSH_USERNAME / SSH_PASSWORD in config.py
**No switches loaded**: Check `NOCODB_URL` and `NOCODB_TOKEN` in `config.py`. NocoDB must return at least one row with `Active=YES` and a non-empty `IP`.
**Timeout errors**: Increase SSH_TIMEOUT in config.py (default: 30s)
**Auth errors**: Check `SSH_USERNAME` / `SSH_PASSWORD` in `config.py`.
**Wrong device type**: If your FS switch uses a non-IOS CLI, try changing
DEVICE_TYPE to `"linux"` or `"generic"` in config.py
**Timeout errors**: Increase `SSH_TIMEOUT` in `config.py` (default: 30s).
**No management IP found**: The script looks for Vlan interfaces in
`show ip interface brief`. If your switch uses a different command,
edit `parser.py → parse_mgmt_ip_from_interfaces()`
**Wrong device type**: If your switch uses a non-IOS CLI, try changing `DEVICE_TYPE` to `"linux"` or `"generic"` in `config.py`.
**No management IP found**: The script looks for Vlan interfaces in `show ip interface brief`. If your switch uses a different command, edit `parser.py → parse_mgmt_ip_from_interfaces()`.
## Project Structure