Sees what the server cannot.
docsis_monitor watches a DOCSIS plant's provisioning traffic on the wire, and says something when it stops looking like a working plant. The provisioning server logs everything it answers, and the console reads those tables. What neither can see is a request that never arrived: a CMTS with a broken relay, a VLAN that stopped trunking, a firewall rule somebody added on Friday. In every one of those the server's tables look quiet and healthy, because nothing reached the server to be logged. The only place it is visible is the wire.
pnet_datalink: no libpcap, no C library, filtering in-process
setcap on the binary, or root; --check says whether a host can capture at all
Repository: github.com/mmqr-developer/docsis_monitor · The four DOCSIS projects also have a site of their own at docsis-admin.com.
Quiet, unanswered, working
It counts the DHCP and TFTP packets crossing one interface, in both directions, per conversation and per CMTS. Every report_every seconds it writes what it saw to the log and judges each interface. The plant's state is the worst of them: one CMTS out of twelve gone quiet is an outage for everybody behind it, and a threshold over the whole plant averages that away.
Quiet
Nothing has arrived from that CMTS for longer than it is allowed to be silent. The relay is broken, the VLAN is not trunking, or something between the plant and the server has changed.
Unanswered
Requests are arriving and fewer than min_answered of them are being answered. A server that is up, listening, and refusing or failing every request — which, from a modem's side, is a server that is down.
Working
Neither. With no trap receiver and no mail recipient configured it says nothing at all: the state is already on the report line, and a monitor that logs its own inaction every window is a monitor whose log nobody reads.
Per CMTS, and both directions
resend_after seconds, and a change always goes out, including the recovery. The subject carries the whole finding — which host, which state, and the counts behind it — because that is all a phone shows, and "DOCSIS alert" makes somebody open the mail to find out whether to get up.
--adaptation 60 watches for an hour, raises no alarms, and writes into the log what every relaying interface did with a suggested idle_seconds and the arithmetic behind it, ending in a per_relay block to paste into the configuration. Where it saw too little to say anything honest, it says so rather than writing today's outage into the configuration as tomorrow's normal.
Three, under one enterprise
Build, grant the capture, watch first
A capture socket belongs to root or to a binary holding CAP_NET_RAW. The capture is opened before the fork, so a permission problem is answered on the terminal rather than in a log file belonging to a process that has already exited.
./build.sh # checks, then a static build with the time compiled in sudo setcap cap_net_raw,cap_net_admin=eip /path/to/docsis_monitor docsis_monitor --check # reads the config, opens the capture, exits docsis_monitor --adaptation 60 # watches for an hour and suggests the thresholds docsis_monitor # detaches, logs to ~/logs/docsis_monitor.log docsis_monitor --nofork # stays on the terminal
Everything is in ~/config/docsis_monitor.json, or /etc/docsis_monitor.json for a system service. The example file in the repository is checked by the test suite against the code that reads it. A key the program does not know is printed at startup rather than refused — on a monitor, a setting that silently does nothing is an alarm that never fires, and that looks exactly like a plant that is working.