Martineau
Part of the Furniture
Hello,
Wondering how to enterpret the stats (which by the way have not produced any negative numbers!)
For example 2 consecutive statistics:
Code:Jun 21 18:59:00 RT-AC86U-D7D8 (wg_manager.sh): 676 Clients [97m2[95m, Servers [97m0 Jun 21 18:59:01 RT-AC86U-D7D8 (wg_manager.sh): 676 wg11:[97m transfer: 13.41 GiB received, 688.76 MiB sent [97m2 days 08:54:10 from 2021-06-19 10:04:51 >>>>>>[0m Jun 21 18:59:01 RT-AC86U-D7D8 (wg_manager.sh): 676 wg11: period : 6.41 GiB received, 311.53 MiB sent (Rx=6885967133;Tx=326662880) Jun 21 18:59:02 RT-AC86U-D7D8 (wg_manager.sh): 676 wg12:[97m transfer: 373.07 MiB received, 14.10 MiB sent [97m2 days 08:54:09 from 2021-06-19 10:04:53 >>>>>>[0m Jun 21 18:59:02 RT-AC86U-D7D8 (wg_manager.sh): 676 wg12: period : 107.78 MiB received, 7.46 MiB sent (Rx=113020599;Tx=7825491) Jun 21 19:59:00 RT-AC86U-D7D8 (wg_manager.sh): 3564 Clients [97m2[95m, Servers [97m0 Jun 21 19:59:01 RT-AC86U-D7D8 (wg_manager.sh): 3564 wg11:[97m transfer: 13.44 GiB received, 691.04 MiB sent [97m2 days 09:54:10 from 2021-06-19 10:04:51 >>>>>>[0m Jun 21 19:59:01 RT-AC86U-D7D8 (wg_manager.sh): 3564 wg11: period : 7.03 GiB received, 379.51 MiB sent (Rx=7545122982;Tx=397945079) Jun 21 19:59:02 RT-AC86U-D7D8 (wg_manager.sh): 3564 wg12:[97m transfer: 373.08 MiB received, 14.10 MiB sent [97m2 days 09:54:09 from 2021-06-19 10:04:53 >>>>>>[0m Jun 21 19:59:02 RT-AC86U-D7D8 (wg_manager.sh): 3564 wg12: period : 265.30 MiB received, 6.64 MiB sent (Rx=278182135;Tx=6959431)
What is the relation between transfer and period, I thoughts period was since last stats but wg11 above is
1: 13.41 GiB received - Period: 6.41 GiB
2: 13.44 GiB received - Period: 7.03 GiB
How come the Period numbers increase faster than transfer... or could someone explain the mechanism. Or are there some arithmetic/logic error?
//Zeb
Edit: aah, get it... 13.44-6.41=7.03 only delta values stored in database so period = transfer - prevDelta.
@ZebMcKayhan
I've uploaded
wg_manager
v4.11b7 with a patch to correct the traffic metrics.You need to manually issue the following commands:
Code:
sqlite3 /opt/etc/wireguard.d/WireGuard.db "ALTER TABLE traffic ADD COLUMN rxtotal UNSIGNED BIG INT;"
sqlite3 /opt/etc/wireguard.d/WireGuard.db "ALTER TABLE traffic ADD COLUMN txtotal UNSIGNED BIG INT;"
Code:
e = Exit Script [?]
E:Option ==> uf dev
You may check the corrected metrics by manually requesting the stats (rather than wait until the scheduled cron job executes 'xx:59')
Code:
e = Exit Script [?]
E:Option ==> generatestats
Code:
e = Exit Script [?]
E:Option ==> diag sql traffic
DEBUG: SQL '/opt/etc/wireguard.d/WireGuard.db'
Table:traffic
Peer Timestamp RX TX RX Total TX Total
<snip>
wg11 2021-06-22 19:15:57 * * * *
wg11 2021-06-22 19:16:14 0 0 0 0
wg11 2021-06-22 19:16:33 52132 18319 52132 18319
wg11 2021-06-22 19:17:22 25610 61604 77742 79923
wg11 2021-06-22 19:29:36 1841152 645049 1918894 724972
wg11 2021-06-22 19:31:11 115343 41809 2034237 766781
wg11 2021-06-22 19:38:14 2348811 1686887 4383048 2453668
So the 3rd record shows the metrics produced by the first manually executed
generatestats
command, and the 4th record shows the results of the second generatestats
command Hopefully it can be seen that the RX Total (77742) matches the sum of the two previous 'period/interval' RX values (52132 + 25610)