/dsctl command line

dsctl command line

dsctl is a command-line interface for querying the DataSabi collector directly from a terminal. It ships with the datasabi-collector package and is installed at /usr/bin/dsctl.

You must be in the datasabi group to use it. If you get a "permission denied" error, see Troubleshooting.

Commands

ping

Check that the collector is running and get its version:

terminal
dsctl ping
collector 0.1.6 (protocol 1) is running

summary

Print per-app usage totals for a time range:

terminal
dsctl summary today
dsctl summary week
dsctl summary month

Example output:

terminal
Total: 1.2 GB  (down 1.1 GB, up 87 MB)
     1  Firefox                  743 MB
     2  Google Chrome            301 MB
     3  System updates (apt)      89 MB

live

Show the current upload and download rate for each active process:

terminal
dsctl live
down 2.1 MB/s  up 145 KB/s
  Firefox                          down 1.9 MB/s  up  88 KB/s
  Google Chrome                    down 178 KB/s  up  57 KB/s

networks

List all known networks and how they are treated:

terminal
dsctl networks
   1  wlan0      Airtel-5G      detected metered  override auto    => metered  (active)
   2  eth0       Home-Fibre     detected no       override auto    => unlimited

set-network

Override the metered status of a network:

terminal
dsctl set-network 2 metered      # force metered
dsctl set-network 2 unlimited    # force unlimited
dsctl set-network 2 auto         # back to automatic detection

Use the network id from dsctl networks.

watch

Stream live rates and alert events until you press Ctrl+C:

terminal
dsctl watch

alert-config

Show the current alert rules and whether quiet mode is active:

terminal
dsctl alert-config
Quiet mode: off
Alert rules:
    1  50 MB in 15 min
    2  150 MB in 60 min

set-alert

Add or update an alert rule (threshold in MB, window in minutes):

terminal
dsctl set-alert 100 30     # 100 MB in 30 minutes
dsctl set-alert 200 60     # 200 MB in an hour

Rules need at least 1 MB and a window of 1–1440 minutes (since collector 0.1.6); anything else is refused with an error. Setting a window that already has a rule updates that rule.

delete-alert

Remove an alert rule by its id (from dsctl alert-config):

terminal
dsctl delete-alert 1

quiet

Silence all alerts for a number of hours. Pass 0 to clear quiet mode:

terminal
dsctl quiet 4      # silence for 4 hours
dsctl quiet 0      # resume alerts

JSON output

Any command can output raw JSON with --json:

terminal
dsctl summary today --json
dsctl networks --json

Custom socket path

If the collector is running on a non-default socket, pass --socket:

terminal
dsctl --socket /path/to/collector.sock ping

Next steps

Issue with this page? Email isaac@arkodeon.com