Debugging
Debugging
This guide helps diagnose and resolve common HookProbe issues.
Quick Diagnostics
Health Check
hookprobe-ctl health --verboseService Status
hookprobe-ctl statussystemctl status hookprobe-agent.serviceView Logs
hookprobe-ctl logs -fjournalctl -u hookprobe-agent.service --since "1 hour ago"Common Issues
Service Won’t Start
Symptoms:
hookprobe-ctl statusshows “stopped”- Service fails to start
Diagnostics:
# Check statussystemctl status hookprobe-agent.service
# View detailed errorsjournalctl -u hookprobe-agent.service -n 100
# Check provisionsystemctl status hookprobe-provision.serviceCommon Causes:
-
Missing dependencies
Terminal window sudo apt install -y podman openvswitch-switchsudo systemctl start hookprobe-provision.service -
Port conflict
Terminal window sudo ss -tlnp | grep 8888# Kill conflicting process or change port -
Permission issues
Terminal window sudo chown -R root:root /opt/hookprobesudo chmod 755 /opt/hookprobe
XDP Not Loading
Symptoms:
- No XDP in
ip link show hookprobe-ctl metrics | grep xdpshows zeros
Diagnostics:
# Check kernel version (need 5.4+)uname -r
# Check NIC driverethtool -i eth0 | grep driver
# Check XDP programsbpftool prog listSolutions:
-
Wrong mode
Terminal window # Try generic modeXDP_MODE="skb"sudo systemctl restart hookprobe-agent.service -
Unsupported NIC
- Some NICs only support generic XDP
- Check NIC compatibility
-
Kernel too old
Terminal window # Upgrade kernel (Ubuntu)sudo apt install linux-generic-hwe-22.04sudo reboot
High QSecBit Score
Symptoms:
- Score stuck in AMBER or RED
- False positives
Diagnostics:
# View score breakdownhookprobe-ctl metrics | jq '.qsecbit'
# Check which component is highhookprobe-ctl metrics | jq '.qsecbit.components'Analysis:
| High Component | Likely Cause |
|---|---|
| threats | Active attack or false positive |
| mobile | Untrusted network (normal on public WiFi) |
| ids | IDS rules triggering (review alerts) |
| xdp | High packet rate (DDoS or busy network) |
| dnsxai | Many blocked domains (check if legitimate) |
Solutions:
-
Review alerts
Terminal window hookprobe-ctl logs | grep alert -
Adjust thresholds
/etc/hookprobe/network-config.sh QSECBIT_AMBER_THRESHOLD=0.50QSECBIT_RED_THRESHOLD=0.75 -
Whitelist false positives
/etc/hookprobe/dnsxai.yaml whitelist:- "legitimate-domain.com"
High Memory Usage
Symptoms:
- System sluggish
- OOM kills in logs
Diagnostics:
# Check memory usagefree -h
# Check HookProbe processesps aux | grep hookprobe
# Check container memorypodman stats --no-streamSolutions:
-
Set memory limits
Terminal window sudo systemctl edit hookprobe-agent.service[Service]MemoryMax=1G -
Reduce log retention
logging:max_size_mb: 50max_files: 5 -
Switch to efficiency mode
Terminal window hookprobe-ctl hotshot --mode efficiency
WiFi Hotspot Not Working (Guardian)
Symptoms:
- Can’t see “HookProbe-Guardian” WiFi
- Clients can’t connect
Diagnostics:
# Check hostapdsystemctl status hostapdjournalctl -u hostapd -n 50
# Check WiFi interfacesiw dev
# Check DHCPsystemctl status dnsmasqSolutions:
-
Wrong country code
Terminal window # Check/set WiFi countrysudo raspi-config # Localisation Options -
Interface not available
Terminal window # Check WiFi adaptersiw dev# Restart networkingsudo systemctl restart NetworkManager -
Channel conflict
Terminal window # Edit hostapd.confchannel=6 # Try different channel
Mesh Connection Failed
Symptoms:
hookprobe-ctl mesh statusshows disconnected- No peers visible
Diagnostics:
# Check mesh statushookprobe-ctl mesh status
# Check HTP connectivitync -vuz validator1.hookprobe.mesh 8144
# Check gossip portnc -vz validator1.hookprobe.mesh 7946Solutions:
-
Firewall blocking
Terminal window sudo ufw allow 8144/udpsudo ufw allow 7946/tcpsudo ufw allow 7946/udp -
Wrong bootstrap nodes
/etc/hookprobe/dsm.yaml gossip:bootstrap_nodes:- "validator1.hookprobe.mesh:7946" -
Network issue
Terminal window # Test DNS resolutiondig validator1.hookprobe.mesh# Test connectivityping validator1.hookprobe.mesh
Log Analysis
Log Locations
| Log | Path |
|---|---|
| Agent | /var/log/hookprobe/agent.log |
| Provision | /var/log/hookprobe/provision.log |
| Update | /var/log/hookprobe/update.log |
| NAPSE | /var/log/napse/events.json |
Search Logs
# Find errorsgrep -i error /var/log/hookprobe/agent.log
# Find specific eventgrep "QSecBit" /var/log/hookprobe/agent.log | tail -20
# JSON log analysiscat /var/log/hookprobe/agent.log | jq 'select(.level=="ERROR")'Log Levels
# Enable debug loggingsudo systemctl edit hookprobe-agent.service
[Service]Environment="LOG_LEVEL=DEBUG"
sudo systemctl daemon-reloadsudo systemctl restart hookprobe-agent.serviceDebug Mode
Enable Debug Output
# Run agent in foreground with debugsudo /opt/hookprobe/agent/main.py --debug --foregroundDebug Endpoints
# Debug metricscurl http://localhost:8888/debug/metrics
# Debug statecurl http://localhost:8888/debug/state
# Debug connectionscurl http://localhost:8888/debug/connectionsForensic Analysis
Capture State
# Create debug bundlehookprobe-ctl debug-bundle --output /tmp/debug-$(date +%Y%m%d).tar.gzWhat’s Included
- Configuration files
- Recent logs
- System information
- Network state
- Service status
- Metrics snapshot
Getting Help
Before Reporting
- Check this debugging guide
- Create debug bundle
- Note steps to reproduce
Report Issues
- GitHub: https://github.com/hookprobe/hookprobe/issues
- Email: [email protected]
Include
- Debug bundle
- HookProbe version
- OS and kernel version
- Steps to reproduce
- Expected vs actual behavior
Next Steps
- Configuration - Review settings
- CLI Reference - Command help
- Architecture - System understanding