Skip to content

Latest commit

 

History

History

onhubdump

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

onhubdump

onhubdump will download, parse, and print a JSON version of the OnHub diagnostic report. It's a command from the onhub Go package.

Installation

go get github.com/benmanns/onhub/cmd/onhubdump

Running

onhubdump

This returns a JSON dump of the data from http://192.168.86.1/api/v1/diagnostic-report.

If you use a different subnet for your router:

onhubdump http://192.168.85.1/api/v1/diagnostic-report

If you want to run against a local, already downloaded dump:

onhubdump ./path/to/diagnostic-report

You will likely want to either save a copy of the diagnostic report or save a copy of the parsed output from onhubdump rather than re-running the command as generating the report takes a few seconds each time.

curl -o diagnostic-report http://192.168.86.1/api/v1/diagnostic-report
onhubdump ./diagnostic-report

Alternatively:

onhubdump > diagnostic-report.json

Use the jq tool to format and manipulate output on the command line.

Unbuffered:

onhubdump | jq

Buffered report:

curl -o diagnostic-report http://192.168.86.1/api/v1/diagnostic-report
onhubdump ./diagnostic-report | jq

Buffered output:

onhubdump > diagnostic-report.json
jq < diagnostic-report.json

Example outputs

Note: these examples are unbuffered, but I recommend you use onhubdump ./your-report | ... or jq ... < your-report.json to avoid taxing your router.

Get version

onhubdump | jq '.version'
"8350.53.0 (Official Build) stable-channel whirlwind"

List file paths

onhubdump | jq '.files | .[] | .path'
"/etc/resolv.conf"
"/sys/firmware/log"
"/tmp/debug-log"
"/var/log/boot.log"
"/var/log/net.log"
"/var/log/net.1.log"
"/var/log/update_engine/update_engine.XXXXXXXX-XXXXXX"
"/var/log/webservd/YYYY-MM-DD.log"
"/var/log/webservd/YYYY-MM-DD.log"
"/var/lib/ap/monitor/wan_idle_usage"
"/var/log/messages"
"/var/log/messages.1"

Output network config without escaping

onhubdump | jq -r '.networkConfig'
local_network {
  ip_address: "192.168.86.1"
  netmask: "255.255.255.0"
}
wireless_network {
...

List commands

onhubdump | jq '.commandOutputs | .[] | .command'
"/bin/ifconfig"
"/usr/sbin/iw dev wlan-2400mhz station dump"
"/usr/sbin/iw dev wlan-5000mhz station dump"
"/usr/sbin/iw dev"
"/sbin/brctl showstp br-lan"
"/usr/sbin/ethtool -S wan0"
"/usr/sbin/ethtool -S lan0"
"/bin/route -n"
"/bin/ps auxwwf"
"/sbin/tc -s qdisc show dev wan0"
"/bin/cat /dev/ecm/ecm_db"
"/usr/sbin/iw dev mesh-5000mhz mpath dump"
"/usr/sbin/iw dev mesh-5000mhz mpp dump"
"/usr/sbin/iw dev mesh-5000mhz station dump"

Get Upload/Download speed

onhubdump | jq '.infoJSON._apCloudStorage._wanSpeedTestResults | { up: ._uploadSpeedBytesPerSecond, down: ._downloadSpeedBytesPerSecond }'
{
  "up": 649257,
  "down": 10526829
}

Show clients

onhubdump | jq '.infoJSON._apState._stations | .[] | { name: ._dhcpHostname, connected: ._connected }'
{
  "name": "My-Computer",
  "connected": true
}
{
  "name": "My-Phone",
  "connected": true
}
{
  "name": "My-Tablet",
  "connected": false
}
...

Show names of connected clients

onhubdump | jq -r '.infoJSON._apState._stations | .[] | select(._connected) | ._dhcpHostname'
My-Computer
My-Phone
...