hulxv / vnstat-client Goto Github PK
View Code? Open in Web Editor NEWGUI Client for vnStat Network Monitor for Linux or GNU/Linux
Home Page: https://hulxv.github.io/vnstat-client/
License: GNU General Public License v2.0
GUI Client for vnStat Network Monitor for Linux or GNU/Linux
Home Page: https://hulxv.github.io/vnstat-client/
License: GNU General Public License v2.0
to cover wider distributions. Is it possible to get this app in Flatpak/Snap/Appimage?
Hello,
I cant find any information about website or app.
Hello,
This startup error only appears when vnstat is install from source or from debian repo.
The error will disappear the moment I uninstall vnstat.
This is the console log:
ahmad@pop-os:~$ vnstat-client
10:38:59.303 › [PRODUCTION] vnStat Client is Running.
libva error: /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so init failed
[5071:0108/103859.397433:ERROR:sandbox_linux.cc(374)] InitializeSandbox() called with multiple threads in process gpu-process.
10:38:59.910 › Getting data...
10:38:59.911 › Checking for update
10:38:59.922 › Error: Error: ENOENT: no such file or directory, open '/opt/vnstat-client/resources/app-update.yml'
(node:5032) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open '/opt/vnstat-client/resources/app-update.yml'
(Use `vnstat-client --trace-warnings ...` to show where the warning was created)
(node:5032) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
10:38:59.949 › vnStat isn't installed, You should download and setup it before using this client.
10:39:04.481 › vnStat-client has been closed.
The issue about the update doesn't go no matter what.
Describe the bug
the app doesn't work on my device vnstat v2.9
info:
> vnstat-client
(node:6408) UnhandledPromiseRejectionWarning: TypeError: Cannot read properties of undefined (reading 'replace')
at At.db (/opt/vnstat-client/resources/app.asar/app/background.js:1:52509)
at Tt.init (/opt/vnstat-client/resources/app.asar/app/background.js:1:53548)
at /opt/vnstat-client/resources/app.asar/app/background.js:1:54337
at /opt/vnstat-client/resources/app.asar/app/background.js:1:63127
at Object.<anonymous> (/opt/vnstat-client/resources/app.asar/app/background.js:1:63148)
at Module._compile (node:internal/modules/cjs/loader:1110:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1140:10)
at Module.load (node:internal/modules/cjs/loader:982:32)
at Module._load (node:internal/modules/cjs/loader:823:12)
at Function.c._load (node:electron/js2c/asar_bundle:5:13331)
(Use `vnstat-client --trace-warnings ...` to show where the warning was created)
(node:6408) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
16:56:36.577 › [PRODUCTION] vnStat Client is Running.
libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
[6444:0226/165636.634266:ERROR:sandbox_linux.cc(374)] InitializeSandbox() called with multiple threads in process gpu-process.
16:56:37.208 › Getting data...
16:56:37.209 › TypeError: Cannot read properties of undefined (reading 'replace')
at At.db (/opt/vnstat-client/resources/app.asar/app/background.js:1:52509)
at Tt.init (/opt/vnstat-client/resources/app.asar/app/background.js:1:53548)
at /opt/vnstat-client/resources/app.asar/app/background.js:1:54337
at /opt/vnstat-client/resources/app.asar/app/background.js:1:63127
at Object.<anonymous> (/opt/vnstat-client/resources/app.asar/app/background.js:1:63148)
at Module._compile (node:internal/modules/cjs/loader:1110:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1140:10)
at Module.load (node:internal/modules/cjs/loader:982:32)
at Module._load (node:internal/modules/cjs/loader:823:12)
at Function.c._load (node:electron/js2c/asar_bundle:5:13331)
(node:6408) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 1)
(node:6408) UnhandledPromiseRejectionWarning: TypeError: Cannot read properties of undefined (reading 'replace')
at At.db (/opt/vnstat-client/resources/app.asar/app/background.js:1:52509)
at Tt.init (/opt/vnstat-client/resources/app.asar/app/background.js:1:53548)
at /opt/vnstat-client/resources/app.asar/app/background.js:1:58865
at processTicksAndRejections (node:internal/process/task_queues:96:5)
(node:6408) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 4)
> uname -a
Linux aliahmed-h310ms2v 5.15.21-1-MANJARO #1 SMP PREEMPT Sun Feb 6 12:21:42 UTC 2022 x86_64 GNU/Linux
> vnstat -v
vnStat 2.9 by Teemu Toivola <tst at iki dot fi>
> vnstat
rx / tx / total / estimated
enp1s0:
2022-02 10.06 GiB / 7.94 GiB / 18.00 GiB / 19.60 GiB
yesterday 942.62 MiB / 45.25 MiB / 987.87 MiB
today 74.28 MiB / 5.13 MiB / 79.41 MiB / 112.66 MiB
wlp0s20f0u5:
2022-02 8.47 GiB / 3.84 GiB / 12.31 GiB / 13.41 GiB
yesterday 0 B / 0 B / 0 B
today 0 B / 0 B / 0 B / --
To Reproduce
open app
Note when i click on Refresh button this appers
16:57:40.452 › Getting data...
16:57:40.453 › Cannot read properties of undefined (reading 'replace')
16:57:40.454 › TypeError: Cannot read properties of undefined (reading 'replace')
at At.db (/opt/vnstat-client/resources/app.asar/app/background.js:1:52509)
at Object.Month (/opt/vnstat-client/resources/app.asar/app/background.js:1:45322)
at Object.getData (/opt/vnstat-client/resources/app.asar/app/background.js:1:45140)
at IpcMainImpl.<anonymous> (/opt/vnstat-client/resources/app.asar/app/background.js:1:57500)
at IpcMainImpl.emit (node:events:394:28)
at Object.<anonymous> (node:electron/js2c/browser_init:165:9959)
at Object.emit (node:events:394:28)
16:57:40.454 › TypeError: Cannot read properties of undefined (reading 'replace')
at At.db (/opt/vnstat-client/resources/app.asar/app/background.js:1:52509)
at Object.Month (/opt/vnstat-client/resources/app.asar/app/background.js:1:45322)
at Object.getData (/opt/vnstat-client/resources/app.asar/app/background.js:1:45140)
at IpcMainImpl.<anonymous> (/opt/vnstat-client/resources/app.asar/app/background.js:1:57500)
at IpcMainImpl.emit (node:events:394:28)
at Object.<anonymous> (node:electron/js2c/browser_init:165:9959)
at Object.emit (node:events:394:28)
16:57:40.466 › TypeError: Cannot read properties of undefined (reading 'replace')
at Object.db (/opt/vnstat-client/resources/app.asar/app/background.js:1:52509)
at Object.interfaces (/opt/vnstat-client/resources/app.asar/app/background.js:1:52824)
at IpcMainImpl.<anonymous> (/opt/vnstat-client/resources/app.asar/app/background.js:1:57708)
at IpcMainImpl.emit (node:events:394:28)
at Object.<anonymous> (node:electron/js2c/browser_init:165:9959)
at Object.emit (node:events:394:28)
16:57:40.467 › TypeError: Cannot read properties of undefined (reading 'replace')
at Object.db (/opt/vnstat-client/resources/app.asar/app/background.js:1:52509)
at IpcMainImpl.<anonymous> (/opt/vnstat-client/resources/app.asar/app/background.js:1:57900)
at IpcMainImpl.emit (node:events:394:28)
at Object.<anonymous> (node:electron/js2c/browser_init:165:9959)
at Object.emit (node:events:394:28)
Expected behavior
show data
Desktop (please complete the following information):
Hello, first of all, greet you, and thank you, as well as vergoh.
I should create 2 separate inssues, but since I opened one, I'm going to mention them both here
Describe the solution you'd like
1 - Is there any way to host this repo as a web service?, example ip_public:3444/login ?
2 - The only thing missing, for this to be perfect, is being able to read data from other servers with vnstat installed
Describe alternatives you've considered
A kind of agent could be used that imports the data to the app, or simply, a vnstat-client.conf , where you can specify the IP of the servers, and their credentials, or at least a private key to be able to connect and collect the data
Additional context
It will be necessary to take into account, if an agent has to be created that sends the data to the client, or take security measures in case of configuring with credentials
happy Hackin :)
No Data is Found
TypeError: Cannot read properties of undefined (reading 'replace')
at Object.db (/opt/vnstat-client/resources/app.asar/app/background.js:1:52509)
at IpcMainImpl.<anonymous> (/opt/vnstat-client/resources/app.asar/app/background.js:1:57900)
at IpcMainImpl.emit (node:events:394:28)
at Object.<anonymous> (node:electron/js2c/browser_init:165:9959)
at Object.emit (node:events:394:28)
Install from: yay
vnstat systemctl already running
● vnstat.service● vnstat.service - vnStat network traffic monitor
Loaded: loaded (/usr/lib/systemd/system/vnstat.service; enabled; v>
Active: active (running) since Sat 2022-02-19 23:15:43 +06; 1h 27m>
Docs: man:vnstatd(8)
man:vnstat(1)
man:vnstat.conf(5)
Main PID: 479 (vnstatd)
Tasks: 1 (limit: 9361)
Memory: 4.1M
CPU: 302ms
CGroup: /system.slice/vnstat.service
└─479 /usr/sbin/vnstatd -n - vnStat network traffic monitor
Loaded: loaded (/usr/lib/systemd/system/vnstat.service; enabled; v>
Active: active (running) since Sat 2022-02-19 23:15:43 +06; 1h 27m>
Docs: man:vnstatd(8)
man:vnstat(1)
man:vnstat.conf(5)
Main PID: 479 (vnstatd)
Tasks: 1 (limit: 9361)
Memory: 4.1M
CPU: 302ms
CGroup: /system.slice/vnstat.service
└─479 /usr/sbin/vnstatd -n
Describe the bug
i get No Data Is Found
error when using v22.5.28
but it works fine in v.22.2.11
Note i seen #7 and removed the semi-colon
To Reproduce
$ vnstat
rx / tx / total / estimated
enp1s0:
2022-06 477.38 MiB / 67.75 MiB / 545.12 MiB / 9.85 GiB
yesterday 202.12 MiB / 9.24 MiB / 211.36 MiB
today 275.25 MiB / 58.51 MiB / 333.77 MiB / 537.01 MiB
wlx503eaad59786:
2022-06 0 B / 0 B / 0 B / --
yesterday 0 B / 0 B / 0 B
today 0 B / 0 B / 0 B / --
$ cat /etc/vnstat.conf
# vnStat 2.9 configuration file
#
# lines starting with # or ; are comments, everything has default
# values, remove ; before each option to change its value
# default interface (leave empty for automatic selection)
;Interface "enp1s0"
# location of the database directory
DatabaseDir "/var/lib/vnstat"
# locale (LC_ALL) ("-" = use system locale)
;Locale "-"
# date output formats for -d, -m, -t and -w
;DayFormat "%Y-%m-%d"
;MonthFormat "%Y-%m"
;TopFormat "%Y-%m-%d"
# characters used for visuals
;RXCharacter "%"
;TXCharacter ":"
;RXHourCharacter "r"
;TXHourCharacter "t"
# how units are prefixed when traffic is shown
# 0 = IEC standard prefixes (KiB/MiB/GiB...)
# 1 = old style binary prefixes (KB/MB/GB...)
# 2 = SI decimal prefixes (kB/MB/GB...)
;UnitMode 0
# used rate unit (0 = bytes, 1 = bits)
;RateUnit 1
# how units are prefixed when traffic rate is shown in bits
# 0 = IEC binary prefixes (Kibit/s...)
# 1 = SI decimal prefixes (kbit/s...)
;RateUnitMode 1
# output style
# 0 = minimal & narrow, 1 = bar column visible
# 2 = same as 1 except rate in summary
# 3 = rate column visible
;OutputStyle 3
;EstimateBarVisible 1
# number of decimals to use in outputs
;DefaultDecimals 2
;HourlyDecimals 1
# spacer for separating hourly sections (0 = none, 1 = '|', 2 = '][', 3 = '[ ]')
;HourlySectionStyle 2
# how many seconds should sampling for -tr take by default
;Sampletime 5
# default query mode
# 0 = normal, 1 = days, 2 = months, 3 = top, 5 = short
# 7 = hours, 8 = xml, 9 = one line, 10 = json
;QueryMode 0
# default list output entry limits (0 = all)
;List5Mins 24
;ListHours 24
;ListDays 30
;ListMonths 12
;ListYears 0
;ListTop 10
# how to match interface given for query to interface in database
# 0 = case sensitive exact match to interface name
# 1 = method 0 followed by case sensitive exact match of alias
# 2 = method 1 followed by case insensitive exact match of alias
# 3 = method 2 followed by case insensitive beginning match of alias
;InterfaceMatchMethod 3
# vnstatd
##
# switch to given user when started as root (leave empty to disable)
;DaemonUser ""
# switch to given group when started as root (leave empty to disable)
;DaemonGroup ""
# try to detect interface maximum bandwidth, 0 = disable feature
# MaxBandwidth will be used as fallback value when enabled
;BandwidthDetection 1
# maximum bandwidth (Mbit) for all interfaces, 0 = disable feature
# (unless interface specific limit is given)
;MaxBandwidth 1000
# interface specific limits
# example 8Mbit limit for eth0 (remove # to activate):
#MaxBWeth0 8
# data retention durations (-1 = unlimited, 0 = feature disabled)
;5MinuteHours 48
;HourlyDays 4
;DailyDays 62
;MonthlyMonths 25
;YearlyYears -1
;TopDayEntries 20
# how often (in seconds) interface data is updated
;UpdateInterval 20
# how often (in seconds) interface status changes are checked
;PollInterval 5
# how often (in minutes) data is saved to database
;SaveInterval 5
# how often (in minutes) data is saved when all interface are offline
;OfflineSaveInterval 30
# rescan database after save for new interfaces to be monitored (1 = enabled, 0 = disabled)
;RescanDatabaseOnSave 1
# automatically start monitoring all interfaces not found in the database
# (1 = enabled, 0 = disabled)
;AlwaysAddNewInterfaces 0
# on which day should months change
;MonthRotate 1
;MonthRotateAffectsYears 0
# filesystem disk space check (1 = enabled, 0 = disabled)
;CheckDiskSpace 1
# how much the boot time can variate between updates (seconds)
;BootVariation 15
# create database entries even when there is no traffic (1 = enabled, 0 = disabled)
;TrafficlessEntries 1
# how many minutes to wait during daemon startup for system clock to
# sync time if most recent database update appears to be in the future
;TimeSyncWait 5
# how often (in minutes) bandwidth detection is done when
# BandwidthDetection is enabled (0 = disabled)
;BandwidthDetectionInterval 5
# force data save when interface status changes (1 = enabled, 0 = disabled)
;SaveOnStatusChange 1
# enable / disable logging (0 = disabled, 1 = logfile, 2 = syslog)
;UseLogging 2
# create dirs if needed (1 = enabled, 0 = disabled)
;CreateDirs 1
# update ownership of files if needed (1 = enabled, 0 = disabled)
;UpdateFileOwner 1
# file used for logging if UseLogging is set to 1
;LogFile "/var/log/vnstat/vnstat.log"
# file used as daemon pid / lock file
;PidFile "/run/vnstat/vnstat.pid"
# 1 = 64-bit, 0 = 32-bit, -1 = old style logic, -2 = automatic detection
;64bitInterfaceCounters -2
# use SQLite Write-Ahead Logging mode (1 = enabled, 0 = disabled)
;DatabaseWriteAheadLogging 0
# change the setting of the SQLite "synchronous" flag
# (-1 = auto, 0 = off, 1, = normal, 2 = full, 3 = extra)
;DatabaseSynchronous -1
# database uses UTC instead of local timezone (1 = enabled, 0 = disabled)
;UseUTC 0
# vnstati
##
# title timestamp format
;HeaderFormat "%Y-%m-%d %H:%M"
# show hours with rate (1 = enabled, 0 = disabled)
;HourlyRate 1
# show rate in summary (1 = enabled, 0 = disabled)
;SummaryRate 1
# transparent background (1 = enabled, 0 = disabled)
;TransparentBg 0
# image size control
;LargeFonts 0
;LineSpacingAdjustment 0
;ImageScale 100
# 5 minutes graph size control
;5MinuteGraphResultCount 576
;5MinuteGraphHeight 300
# hourly graph mode (0 = 24 hour sliding window, 1 = begins from midnight)
;HourlyGraphMode 0
# horizontal/vertical summary graph (0 = hours, 1 = 5 minutes)
;SummaryGraph 0
# traffic estimate bar style
# (0 = not shown, 1 = continuation of existing bar, 2 = separate bar)
;EstimateStyle 1
# bar column in list outputs shows rate if OutputStyle is 3
# (1 = enabled, 0 = disabled)
;BarColumnShowsRate 0
# image colors
;CBackground "FFFFFF"
;CEdge "AEAEAE"
;CHeader "606060"
;CHeaderTitle "FFFFFF"
;CHeaderDate "FFFFFF"
;CText "000000"
;CLine "B0B0B0"
;CLineL "-"
;CRx "92CF00"
;CTx "606060"
;CRxD "-"
;CTxD "-"
Expected behavior
A clear and concise description of what you expected to happen.
Desktop (please complete the following information):
Are you considering in making a docker image?
I would love to have this Client running in a Container, to be able to access it via browser!
Problem:
Here is the error that pops up when I run the app:
***@***:~$ vnstat-client
20:40:26.790 › [PRODUCTION] vnStat Client is Running.
20:40:27.350 › Getting data...
20:40:27.351 › APPIMAGE env is not defined, current application is not an AppImage
20:40:27.457 › Error: Command failed:
if grep -q "$(systemctl is-active vnstat)" <<< "active" ;
then echo "true"
else echo "false"
fi
/bin/sh: 2: Syntax error: redirection unexpected
at ChildProcess.exithandler (node:child_process:408:12)
at ChildProcess.emit (node:events:526:28)
at maybeClose (node:internal/child_process:1092:16)
at Socket.<anonymous> (node:internal/child_process:451:11)
at Socket.emit (node:events:526:28)
at Pipe.<anonymous> (node:net:687:12)
20:40:27.461 › Getting data is successfully
20:40:29.980 › vnStat-client has been closed.
And the app is unable to read data from the database however vnstat works perfectly and shows data in the terminal.
Possible solution:
After some research, it looks like that the script is using Dash instead of Bash (because I use Ubuntu) so it may solve the problem if Bash is used instead of using the default shell in the script.
This may not be the best solution and you should consider other possible solutions if found.
I am not an expert in Linux, I tried to compile this in a docker container, but it get failed every time with lot's of module error, no matter what I do, result is same.
Will there be a version available for ARM64, which can be download and install directly?
Regards,
Saugata D.
Describe the bug
Open vnstat-client. View chart. See no data for today 8/26. See tiny data for 25th which on mouseover shows it applies to 25th, but its actually the 26th data.
Tooltip is also going off the app window.
Happening on desktop computer.
OS: Garuda Linux x86_64
Kernel: 6.1.46-1-lts
The table does show the correct data and applies the same usage showing under the 25th on chart the 26th on table.
Otherwise great app. Thank you.
First month user. month has just changed to august. cannot see previous months usage history. cannot find any referral on the main toolbar menu.
current page shows only This month current use and Yesterday.
Month button only shows current date/month. ideally this would show previous months in calendar form, so that you can choose which month you want to view.
Hello, first of all, thanks for your work.
/vnstat
, just return raw json result of vnstat --json
. Beside, basic auth like username/password is engough for current server.vnstat --json
will produce a jsonversion
key with eunm value: 1
, 2
.
vnstatversion
, jsonversion
, interfaces
, summary
and daily traffic
is contains.vnstat jsonverion 1
https://github.com/IITII/VNSTAT-DASHBOARD
https://iitii.github.io/VNSTAT-DASHBOARD/
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.