How sufferer-of-his-sins/netwatch works
NetWatch is a C client-server network-device monitoring system. Agents register and send metrics and heartbeats; the server handles device communication, queries and commands, and is documented to persist data in PostgreSQL and send alerts to operators. The operator client offers device views, metric history, alert review, commands, and live alerts. Several listed capabilities are only partially implemented in the sampled code; README-backed edges describe intended product behavior, not verified runtime wiring.
Main entry points: Server_main.c Server runtime · operator_main.c Operator client · Alert.c Alert delivery · Agent_main.c Device agent
Components 22
Client endpoints
- Device agent
agent/src/Agent_main.c - Operator client
operator/src/operator_main.c
Server services
- Server runtime
server/src/Server_main.c - Agent registration
server/src/Register_ack.c - Heartbeat handling
server/src/Heartbeat_ack.c - Metrics and status
server/src - Offline detection
server/src - Alert delivery
server/src/Alert.c - Query handling
server/src/Query_result.c - Command routing
server/src/Command.c
Operator workflows
- Device status list
operator/src/list_device_and_state.c - Device details
operator/src/device_detail .c - Metrics history
operator/src/metrics_history.c - Alert journal
operator/src/allert_journal.c - Device commands
operator/src/sending_command_device.c
Protocol and storage
- Shared protocol types
include/library.h - Agent interface
include/InAgent.h - Operator interface
include/InOperator.h - Server interface
include/InServer.h - Monitoring schema
database/init.sql
Other components
- Network operator
- PostgreSQL
Connections 29
- Operator client → Network operator: presents menu
operator/src/operator_main.c - Operator client → Device status list: offers view
README.md - Operator client → Device details: offers view
README.md - Operator client → Metrics history: offers history
README.md - Operator client → Alert journal: offers journal
README.md - Operator client → Device commands: offers commands
README.md - Device agent → Server runtime: sends telemetry
README.md - Server runtime → Agent registration: handles registration
README.md - Server runtime → Heartbeat handling: handles heartbeat
README.md - Server runtime → Metrics and status: handles metrics
README.md - Server runtime → Offline detection: checks timeouts
README.md - Offline detection → Alert delivery: raises alerts
README.md - Server runtime → Query handling: handles queries
README.md - Operator client → Server runtime: sends queries
README.md - Server runtime → Alert delivery: broadcasts alerts
README.md - Alert delivery → Operator client: sends alerts
README.md - Operator client → Command routing: sends commands
README.md - Command routing → Device agent: forwards commands
README.md - Server runtime → PostgreSQL: persists monitoring data
README.md - Monitoring schema → PostgreSQL: defines tables
README.md - Operator client → Server runtime: uses TCP framing
README.md - Device agent → Shared protocol types: uses shared types
- Operator client → Shared protocol types: uses shared types
- Server runtime → Shared protocol types: uses shared types
- Server runtime → Agent registration: exposes handler
- Server runtime → Heartbeat handling: exposes handler
- Server runtime → Query handling: exposes handler
- Server runtime → Command routing: exposes handler
- Server runtime → Alert delivery: exposes handler