[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-115666":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":8,"htmlUrl":8,"language":9,"languages":8,"totalLinesOfCode":8,"stars":10,"forks":11,"watchers":12,"openIssues":13,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":12,"stars7d":15,"stars30d":15,"stars90d":14,"forks30d":14,"starsTrendScore":16,"compositeScore":17,"rankGlobal":8,"rankLanguage":8,"license":8,"archived":18,"fork":18,"defaultBranch":19,"hasWiki":20,"hasPages":18,"topics":21,"createdAt":8,"pushedAt":22,"updatedAt":23,"readmeContent":24,"aiSummary":25,"trendingCount":14,"starSnapshotCount":14,"syncStatus":26,"lastSyncTime":27,"discoverSource":28},115666,"NetCable-v1","Joao-Monticelli\u002FNetCable-v1","Joao-Monticelli",null,"JavaScript",82,4,1,3,0,28,16,54.9,false,"main",true,[],"2026-11-18 12:01:59","2026-11-23 15:01:13","# NetCable — self-hosted network map & monitoring\n\n![Status](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fstatus-beta-blue)\n![License](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-MIT-green)\n![Docker](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fdocker-amd64%20%7C%20arm64-2496ED)\n![CI](https:\u002F\u002Fgithub.com\u002FJoao-Monticelli\u002FNetCable-v1\u002Factions\u002Fworkflows\u002Fdocker-build.yml\u002Fbadge.svg)\n\n**English** · [Português](README.pt-BR.md)\n\n\u003Cimg width=\"1920\" alt=\"NetCable\" src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002F91e328d3-c12c-4d81-887d-38ea06ef9e4c\" \u002F>\n\nNetCable is an open-source, self-hosted tool to **draw your network and keep an eye on it**.\nDrag devices onto a canvas, mount them in racks that look like the real thing, cable port to\nport, and NetCable pings everything in the background and tells you (email, Telegram, webhook)\nwhen something goes down.\n\nIt runs as **one Docker container** on anything: a mini PC, a VM, a NAS, a Raspberry Pi.\n\n> ⚠️ Beta: under active development. Feedback and issues are very welcome.\n\n## Features\n\n- 📡 **Network discovery** — scan a range (e.g. `192.168.1.0\u002F24`), see who answered with hostname, open ports and a suggested type, and add them to the map in one click.\n- 🗺️ **Visual map** — drag & drop devices, draw cables, labels, search (`Ctrl+K`) and hover highlighting.\n- 🧭 **Shortcuts between maps** — build an overview map (HQ → branches → datacenter); each shortcut shows the live online\u002Foffline count of its map, turns red when something is down there and opens it on double-click.\n- 🗄️ **Realistic racks** — 4U to 48U racks; switches, servers, NAS, patch panels, UPS… snap to U positions.\n- 🧩 **Device model library** — register your real gear (e.g. “4× RJ45 + 2× SFP, 1U”) and its front panel is drawn with exactly those ports.\n- 🔌 **Port-to-port cables** — connect switch port 12 to firewall eth3; ports show as in use with tooltips.\n- 📡 **Server-side monitoring** — TCP (80\u002F443\u002F22) + ICMP in parallel, or SNMPv3; works with no browser open.\n- 🚨 **Alerts** — email, Discord, ntfy, Telegram and webhook on down\u002Fup, grouped per cycle, per-device on\u002Foff.\n- 🧠 **Smart alerts** — set each device's uplink (or compute them from the cables): when a switch dies you get **one** alert listing what is behind it, and those devices turn amber (*unreachable*) on the map. **Maintenance windows** mute a device or a whole map for a while.\n- 🌡️ **SNMP metrics** — CPU, memory, temperature, uptime and per-port link\u002Ftraffic for SNMPv3 devices, with charts, real port LEDs on the rack and temperature\u002FCPU alerts.\n- 📊 **Uptime & latency** — availability %, outages, latency chart (24 h \u002F 7 d \u002F 30 d) and a daily email report.\n- 👥 **Team roles** — Admin, Editor and Viewer (great for a NOC TV).\n- 📺 **Public link & TV mode** — read-only, auto-refreshing, full screen, revocable secret link.\n- 💾 **Backups** — daily `.zip` (all maps + model catalog + full database) to a folder you choose; export\u002Fimport single maps as JSON.\n- 🌐 **English \u002F Português** — per user; also applies to emails and API errors.\n\n## Quick start (Docker)\n\n```yaml\n# docker-compose.yml\nservices:\n  netcable:\n    image: ghcr.io\u002Fjoao-monticelli\u002Fnetcable:latest\n    container_name: netcable\n    restart: unless-stopped\n    ports:\n      - \"8080:8080\"\n    volumes:\n      - .\u002Fdata:\u002Fapp\u002Fdata      # database, secret key and backups\n    environment:\n      - TZ=America\u002FNew_York\n```\n\n```bash\ndocker compose up -d\n```\n\nOpen `http:\u002F\u002FSERVER-IP:8080`. On the first visit NetCable asks you to **create the admin account** —\nthere are no default passwords. A secret key is generated automatically in the data folder.\n\nOr with plain Docker:\n\n```bash\ndocker run -d --name netcable -p 8080:8080 -v netcable-data:\u002Fapp\u002Fdata --restart unless-stopped ghcr.io\u002Fjoao-monticelli\u002Fnetcable:latest\n```\n\nImages are published for **amd64** and **arm64** (Raspberry Pi 4\u002F5). Pin a version with\n`ghcr.io\u002Fjoao-monticelli\u002Fnetcable:1.0.0` if you prefer controlled upgrades.\n\n### TrueNAS SCALE\n\nApps → Discover Apps → Custom App → *Install via YAML* and paste [`install\u002FtrueNAS.yml`](install\u002FtrueNAS.yml)\n(change the pool path). Details in [INSTALL.md](INSTALL.md).\n\n## Configuration\n\nEverything is optional. Email (SMTP), users, backups and languages are configured in the web UI (⚙️ menu).\n\n| Variable | Default | Description |\n|---|---|---|\n| `TZ` | `America\u002FSao_Paulo` | Default time zone for reports and backups |\n| `MONITOR_INTERVAL` | `15` | Seconds between monitoring cycles (`0` disables) |\n| `MONITOR_FAILURE_THRESHOLD` | `2` | Consecutive failures before a device is marked offline |\n| `HISTORY_RETENTION_DAYS` | `30` | Days of history kept (`0` = forever) |\n| `TELEGRAM_BOT_TOKEN` \u002F `TELEGRAM_CHAT_ID` | — | Telegram alerts (also configurable in ⚙️ → Alert channels) |\n| `DISCORD_WEBHOOK_URL` | — | Discord channel webhook |\n| `NTFY_URL` \u002F `NTFY_TOKEN` | — | ntfy topic (e.g. `https:\u002F\u002Fntfy.sh\u002Fmy-secret-topic`) and optional token |\n| `ALERT_WEBHOOK_URL` | — | Receives a JSON POST on down\u002Fup |\n| `ALERT_LANGUAGE` | `en` | Language of the channel messages (`en` or `pt`) |\n\nValues set in the UI take precedence over the environment variables.\n| `ADMIN_USER` \u002F `ADMIN_PASSWORD` | — | Create or recover an admin from the environment (instead of the first-run screen) |\n| `SECRET_KEY` | auto | Overrides the key stored in `data\u002Fsecret.key` |\n| `SNMP_METRICS_INTERVAL` | `60` | Seconds between SNMP metric collections (`0` disables) |\n| `PORT` | `8080` | Port NetCable listens on inside the container; only useful with `network_mode: host` |\n| `DISCOVERY_ALLOW_PUBLIC` | — | `1` allows network discovery on public IP ranges |\n| `DISCOVERY_TIMEOUT` \u002F `DISCOVERY_WORKERS` | `0.8` \u002F `128` | Per-probe timeout (s) and parallel probes during discovery |\n\n## Large networks: shortcuts between maps\n\nSplit a big network into several maps (one per site, floor or rack room) and create an **overview map** with shortcuts:\n**Add → type \"Shortcut to another map\"**, pick the target map. The shortcut shows how many devices are online\u002Foffline over there,\nturns red when anything is down, and **double-click** (or a single click in view mode) opens that map. Shortcuts can be cabled\nlike any device (e.g. the WAN link between two sites) and are kept in backups\u002Fexports (re-linked by map name on import).\n\n## Network discovery\n\nClick the 📡 radar button in the editor toolbar, enter a range (`192.168.1.0\u002F24`, `10.0.0.10-10.0.0.60` or a single IP) and **Scan**.\nThe NetCable server pings every address and checks common ports (SSH, HTTP\u002FS, SMB, RDP, DNS, printers, cameras, Proxmox, Synology),\nthen lists what answered with its reverse-DNS name and a suggested type (from the open ports and hints in the name, such as\n`printer`, `cam`, `sw-`, `ap-`, `nas`; phones, VoIP and IoT devices, or anything without evidence, are suggested as **Other**). Devices already on a map are flagged and unchecked.\nPick what you want, adjust names\u002Ftypes and click **Add to the map**, then save.\n\n- Only private ranges (10\u002F8, 172.16\u002F12, 192.168\u002F16, 100.64\u002F10) of up to 1024 addresses are allowed. Set `DISCOVERY_ALLOW_PUBLIC=1` to scan public ranges in a lab.\n- In Docker the default bridge network can reach your LAN, so scanning works. **MAC addresses** are only shown with host networking,\n  because in bridge mode the container cannot see your LAN's ARP table. To enable it, replace `ports:` with `network_mode: host`\n  and, if port 8080 is already taken on the host, set `PORT` (e.g. `PORT=3080` on TrueNAS):\n\n  ```yaml\n  services:\n    netcable:\n      image: ghcr.io\u002Fjoao-monticelli\u002Fnetcable:latest\n      network_mode: host        # instead of ports:\n      environment:\n        - PORT=3080             # NetCable listens here: http:\u002F\u002FSERVER-IP:3080\n  ```\n- Editors and admins can scan; viewers cannot.\n\n## SNMP metrics\n\nFor devices monitored with **SNMPv3**, NetCable collects every minute (`SNMP_METRICS_INTERVAL`):\n\n| Metric | Sources (first that answers) |\n|---|---|\n| CPU | HOST-RESOURCES `hrProcessorLoad`, Cisco `cpmCPUTotal5minRev`, UCD `ssCpuIdle` (Linux\u002FNAS) |\n| Memory | HOST-RESOURCES `hrStorageRam`, UCD `memTotalReal\u002FmemAvailReal`, Cisco memory pools |\n| Temperature | ENTITY-SENSOR (°C sensors), LM-SENSORS, MikroTik, Cisco `ciscoEnvMonTemperature` (highest sensor) |\n| Ports | IF-MIB: name, description (alias), link status, speed, traffic (64-bit counters) and errors |\n\n- On the map: temperature and CPU next to the device; in racks, **port N lights up with the real link of the N-th physical interface** (RJ45 first, then SFP) and the tooltip shows name, description, speed and traffic.\n- Click **View metrics** in the device (or click the device in view mode) for charts (1 h \u002F 24 h \u002F 7 days, also as a table) and the port table.\n- **Alerts:** ⚙️ → Alert channels → *Temperature and CPU limits* (default 75 °C and 95%; `0` disables). An alert fires after 3 readings in a row above the limit and again when it returns to normal. Maintenance windows mute them too.\n- SNMPv3 **context** is optional (some devices use one per VRF\u002Finstance).\n- Tested against a simulated SNMPv3 agent ([snmpsim](https:\u002F\u002Fgithub.com\u002Fetingof\u002Fsnmpsim)) in CI; please open an issue with your device model if a metric shows \"—\".\n\n## Smart alerts\n\n- **Uplink (depends on):** open a device and pick the device it depends on (e.g. the switch it is plugged into).\n  Faster: open your gateway\u002Ffirewall and click **Use as root and compute uplinks from cables** — NetCable walks the cables and fills in every uplink. Save the map.\n- When an uplink goes down, devices behind it are shown in **amber (unreachable)**, don't send their own alert and are listed in the uplink's alert\n  (*\"Core switch OFFLINE — 12 devices behind it unreachable: …\"*). When it comes back, one recovery alert lists them too.\n- **Maintenance:** 🔧 in the toolbar mutes the whole map for 1–24 h; inside a device you can mute just that device.\n  Monitoring and history keep running; devices that went down during maintenance don't send a \"back online\" alert afterwards.\n- **Channels:** ⚙️ → **Alert channels** (admins) for Discord, ntfy (push notifications on your phone), Telegram and a generic JSON webhook, each with a *Test* button. Tokens and URLs are stored encrypted.\n\n## Backups & restore\n\n- ⚙️ → **Backup** (admins): daily time, how many files to keep, destination folder and a *Back up now* button.\n  In Docker the folder must be inside a mounted volume (default `\u002Fapp\u002Fdata\u002Fbackups`; mount another volume to send them to your NAS).\n- Each `.zip` contains `netcable.db` (everything: users, history, settings), one JSON per map and the model catalog.\n- **Restore maps:** on the projects screen click **Import** and choose the `.zip` (or a single map `.json`). Imports always create new projects; nothing is overwritten.\n- **Restore everything:** stop the container and replace `data\u002Fnetcable.db` with the one inside the `.zip`.\n\nThe database is also copied automatically to `data\u002Fbackups\u002F` before any schema upgrade.\n\n## Upgrading\n\n```bash\ndocker compose pull && docker compose up -d\n```\n\nDatabase migrations run automatically. Upgrading from the old two-container setup\n(`netcable-backend` + `netcable-frontend`)? Point the compose file to the single image above and keep\nthe same data folder mounted at `\u002Fapp\u002Fdata`.\n\n## Development\n\n```bash\n# API (http:\u002F\u002Flocalhost:8000)\ncd backend && python -m venv venv && venv\u002Fbin\u002Fpip install -r requirements.txt\nvenv\u002Fbin\u002Fuvicorn app.main:app --reload\n\n# UI (http:\u002F\u002Flocalhost:5173, proxies \u002Fapi to :8000)\ncd frontend && npm install && npm run dev\n\n# Tests\ncd backend && venv\u002Fbin\u002Fpytest -q\ncd qa && npm install && npm run qa      # end-to-end robot, report in qa\u002Frelatorios\u002F\n```\n\nStack: React 18, Vite, React Flow · FastAPI, SQLAlchemy, SQLite · Docker, GitHub Actions.\n\n### Project layout\n\n| Path | What lives there |\n|---|---|\n| `backend\u002Fapp\u002Fmain.py` | FastAPI app: REST API, auth, background monitoring loop, serves the built UI |\n| `backend\u002Fapp\u002Fmodels.py`, `schemas.py`, `crud.py`, `database.py`, `migracoes.py` | Database models, API schemas, queries and automatic migrations (SQLite) |\n| `backend\u002Fapp\u002Fping_service.py`, `snmp_service.py`, `metricas_snmp.py` | Reachability checks, SNMP queries and SNMP metrics collection |\n| `backend\u002Fapp\u002Falerts.py`, `regras_alerta.py`, `email_service.py` | Alert channels (Telegram, Discord, ntfy, webhook, email) and smart alert rules |\n| `backend\u002Fapp\u002Fdescoberta.py`, `backup.py`, `i18n.py` | Network discovery, backups\u002Frestore, server-side translations |\n| `backend\u002Ftests\u002F` | pytest suite (plus an SNMPv3 simulator used in CI) |\n| `frontend\u002Fsrc\u002Fpages\u002F` | Screens: login, projects, map editor, public shared view |\n| `frontend\u002Fsrc\u002Fcomponents\u002F` | Network map (React Flow), racks, charts, sidebar and all modals |\n| `frontend\u002Fsrc\u002Fi18n\u002F` | UI translations (English and Portuguese) |\n| `qa\u002F` | End-to-end QA robot ([qa\u002FREADME.md](qa\u002FREADME.md)) |\n| `install\u002F` | Ready-made compose file for TrueNAS SCALE |\n\n## Contributing\n\nIssues and pull requests are welcome — bug reports with screenshots help a lot.\nSee the [CHANGELOG](CHANGELOG.md) for what changed in each version.\n\n## License\n\nMIT\n","NetCable 是一个开源、自托管的网络拓扑可视化与监控工具，用于绘制物理\u002F逻辑网络结构并持续监测设备连通性与性能。核心功能包括：基于 IP 段的自动网络发现、拖拽式拓扑图与真实感机架建模、端口级物理连线模拟、后台多协议（ICMP\u002FTCP\u002FSNMPv3）主动探测、智能依赖告警（基于电缆关系聚合故障影响）、多通道通知（Telegram\u002FDiscord\u002F邮件\u002FWebhook）及带历史图表的 SNMP 指标采集。适用于中小型企业IT团队、网络管理员及NOCC环境，部署轻量（单容器），支持树状地图跳转与只读大屏模式。",2,"2026-11-24 04:51:44","CREATED_QUERY"]