How mayssa1232/home_gateway_doctor works
HGW Doctor is a lightweight gateway-health daemon. Its main workflow is to load the TR-181 model, periodically sample system metrics, update the model, and expose it over ubus; the README also documents procd boot and crash-recovery integration. The source excerpt shows CPU and memory sampling and the model/ubus operations, but does not show uptime collection or the contents of the ODL and init files, so those details are represented only at the documented capability level.
Main entry points: main.c HGW Doctor daemon · HGW_doctor.init Service init · HGW_doctor.odl Model definition
Components 10
Health monitoring
- HGW Doctor daemon
src/main.c - Metric sampler
src/main.c - Event loop
src/main.c
TR-181 model
- TR-181 data model
src/main.c - Model definition
odl/HGW_doctor.odl
Gateway integration
- ubus service
- Service init
files/HGW_doctor.init
Other components
- Gateway system
- Linux proc metrics
- procd supervisor
Connections 11
- Gateway system → Linux proc metrics: exposes metrics
- HGW Doctor daemon → Model definition: loads definition
src/main.c - HGW Doctor daemon → TR-181 data model: initializes
src/main.c - HGW Doctor daemon → Metric sampler: starts polling
src/main.c - Metric sampler → Linux proc metrics: reads CPU/RAM
src/main.c - Metric sampler → TR-181 data model: updates metrics
src/main.c - HGW Doctor daemon → ubus service: registers model
src/main.c - HGW Doctor daemon → Event loop: runs
src/main.c - Event loop → ubus service: handles requests
src/main.c - procd supervisor → Service init: supervises service
README.md - Service init → HGW Doctor daemon: starts and recovers
README.md