There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

[SOLVED] Monitoring Daily Data Usage on Linux

[SOLVED] Hurray! I did it!

https://lemmy.ml/pictrs/image/72225811-5394-4758-a7c9-d29270650aac.png


Solution: You need to have Generic monitor xfce link installed [available almost on every DE out there]

Two finger Tap on Panel Panel (dropdown) > Panel Preferences > Items > Add Item > Generic Monitor

https://lemmy.ml/pictrs/image/18b70e4f-70ef-4775-ba3f-986452c18fb2.png

In generic monitor give the exact location of the script like I have done here (also copy other details too)

https://lemmy.ml/pictrs/image/384ee3c6-687b-4097-b4c1-618f00e767df.png

Now save

Here’s what is in the trial file


<span style="color:#323232;">#!/bin/bash
</span><span style="color:#323232;">eleven=$(vnstat --json | jq --arg day "$(date +'%d')" --arg month "$(date +'%m')" '.interfaces[0].traffic.day[] | select(.date.day == ($day | tonumber) and .date.month == ($month | tonumber)) | (.rx + .tx) / (1024*1024*1024)')
</span><span style="color:#323232;">rounded_eleven=$(printf "%.2f" "$eleven")
</span><span style="color:#323232;">
</span><span style="color:#323232;">echo " $rounded_eleven GB"
</span>

And that’ about it, for Network Usage Gouger you need Network Monitor Package xfce4-netload-pluginYou can see more into here

Adios!


[ORIGINAL POST]

edit: I am open to installing other packages, I ain’t married to any of these packages.

https://lemmy.ml/pictrs/image/83a73e16-4c23-4e95-8f15-45aef6877f3c.png

I have installed vnstat package and it’s quite handy. I have a few questions about it though.

  1. What is rx & tx mean in this package? rx stands for received``tx stands for transmission

Is there a command to check data usage on my system using this? I mean, I want to create a Add an item to my panel which will show me my daily data usage updating it every minute. Basically, I want to to see what the arrow points to on the panel next to my date and I want it to update it every minute. I have 1.5GBs of data a day and I usually am not able to use it efficiently or I use too early and spent hours without data. So, I want to try and handle this problem by monitoring my data.


Note: I want to measure gauge data speed here, not do a speed test on how fast my internet is.

Also, I want to monitor the instantaneous rate of data usage and for that package bwm-ng does a great job, but I want to see in the panel and I want it to update every 0.5 s how can I achieve this?

I would like for a command to either view red arrow or the black arrow with the right mark depending upon which of them is instantaneous data speedhttps://lemmy.ml/pictrs/image/02bbfd0e-ccb9-4a83-afc6-8c30e7788316.png


Note to Future self: rx : received``tx : transmission``lo : local loopback``wlan0 : ethernet

IsoKiero ,

I want to create a Add an item to my panel

On which environment? I’m pretty sure there’s option on most of the window managers to display output of an command on a panel and (while it might need some scripting) it should be easy(ish, YMMV) to implement that.

Subject6051 OP ,

MX Linux xfce

I know it can be done because I have done it for something else. I don’t know the commands to view those particular columns in the command tho.

IsoKiero ,

I’m not familiar with vnstat, but man page mentions --oneline -parameter, so something like vnstat --oneline|cut -d’;’ -f6 might be pretty close and you could format that as you wish with sed or awk, shell script or even python if you like.

Subject6051 OP ,

thank you very much! it works!

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines