More Tools for Monitoring WireGuard Data Usage

We recently added a few more tools to Pro Custodibus for monitoring WireGuard data usage that I wanted to share.

Peer Selection

One new feature is the ability to select specific peers for which to compare usage. On the Pro Custodibus dashboard page, we’ve always shown you the data usage of the 10 most recently-used peers:

screenshot of dashboard
Figure 1. Pro Custodibus Dashboard

But now, if you click the Select Peers icon of the Bytes Sent and Received by Peer panel, you can select the specific peers you want to compare:

screenshot highlighting the select-peers icon
Figure 2. Select Peers Icon

This will take you to the Peer Timelines page:

screenshot of peer timelines page
Figure 3. Peer Timelines Page

On this page, use the filter field on the Peers panel to search for specific peers. Click the checkbox for a peer, and it will chart the usage for the peer:

screenshot of peer timelines page with one selection
Figure 4. Peers Filtered and Selected

You can continue to add more peers to the chart by searching for other peers, and selecting the checkboxes next to them:

screenshot of peer timelines page with three selections
Figure 5. More Peers Filtered and Selected

Like the dashboard, can expand the chart’s time range on this page up to 90 days, by adjusting the dropdown in the top-right of the page:

screenshot of peer timelines page with ninety days of usage
Figure 6. 90 Days of Usage

Monthly Summaries

Another new feature is the ability to download a monthly summary of the usage of all peers monitored by Pro Custodibus. You can access this feature by clicking the Download Summary icon of the Bytes Sent and Received by Peer panel on the dashboard:

screenshot highlighting the download-summary icon
Figure 7. Download Summary Icon

This will display a progress dialog while the report is being generated:

screenshot highlighting the download-progress dialog
Figure 8. Download Progress Dialog

Once complete, you can view the downloaded “monthly-peer-summary.csv” file in spreadsheet program like Excel:

screenshot of monthly-summary spreadsheet
Figure 9. Monthly Summary Spreadsheet

This file will include summaries from the current month and the previous two months. For each month, it will include a “Sent” column, a “Received” column, and an “IPs” column:

Sent

Total bytes sent to the peer during the month.

Received

Total bytes received from the peer during the month.

IPs

Total different IP addresses used by the peer during the month.

Tip

You can use a formula like =ROUND(CONVERT(C3, "byte", "Gibyte"), 2) & " GB" in your spreadsheet program to convert a big byte count, like “41124944395”, into an easier-to-read value, like “38.3 GB”.

Alternatively, on Linux you can use the numfmt utility to pre-process specific columns of a CSV file to produce a friendlier byte value display:

$ cat monthly-peer-summary.csv | numfmt --header --field=3,4,6,7,9,10 --delimiter=, --invalid=ignore --to=iec --suffix=B --format=%.2f
Public Key,Peer Name,November Sent,November Received,November IPs,December Sent,December Received,December IPs,January Sent,January Received,January IPs
nYk64E1I5TJYvD6LzuXH+2cIL2/4gseu8oO+RS6BClc=,Adam's Laptop (corp),,,,,,,,,
guSdN7ffCjJRK8eHbGiBgHzhh9CwSw7gWsnxTAAKohk=,Adam's Laptop (dev),38.31GB,38.57GB,2,39.93GB,40.91GB,4,39.22GB,38.53GB,2
wqYJSJtMLT6iFgOcwTCCJ77YulPmZs4pKH3b4yCV2GA=,Adam's Laptop (prod),,,,,,,1.44GB,969.65MB,1
...

Bulk Rename

A related feature is you can now set friendly names for peer by bulk upload. If you navigate to the peers list (by way of the Peers link in the Administration panel of the Admin page), you can click the Bulk Rename icon of the Peers panel:

screenshot highlighting the bulk-rename icon
Figure 10. Bulk Rename Icon

This will navigate you to a page where you can paste in as many rows as you want of peer public-key/peer-name pairs, into a CSV field:

screenshot highlighting the bulk-rename form
Figure 11. Bulk Rename Form

For example, you can copy the first two columns of rows (Public Key and Peer Name) directly out of the Monthly Summaries spreadsheet from above, and paste them into the CSV field of this Rename Peers form:

screenshot showing content pasted into the bulk-rename form
Figure 12. Bulk Rename Content

When you do that, the form will parse the pasted content (tab-separated rows work as well as comma-separated ones), and show you a table of the key/name pairs it parsed. If the table looks good to you, click the Update button of the form to submit your changes. Pro Custodibus will update its record for each included peer with the new name you supplied. See the Bulk Rename Documentation for more info.

Also see the Friendly Names for WireGuard Peers article for a guide to updating WireGuard peer names one-by-one; and see the WireGuard Usage Monitoring article for some other ways you can monitor WireGuard usage with Pro Custodibus.