How to start Vnstat?

Post here if you are a new Porteus member and you're looking for some help.
bakunin
White ninja
White ninja
Posts: 16
Joined: 16 Jul 2022, 15:52
Distribution: porteus 5

How to start Vnstat?

Post#1 by bakunin » 16 Jul 2022, 15:57

Hi,
Proton 5 Mate. Runs on a USB stick. Works very well, but I need to monitor my data usage.
I downloaded vnstat, which I use on Ubuntu Mate and AntiX, from slackfinder.com, put it into the modules folder and converted it to xzm. So far so good.
When I’m trying to get vnstat to work, however, I get the message:

Error. Failed to open database “/var/lib/vnstat/vnstat.db” in read only mode.
The vnstat daemon should have created the database when started.
Check that it is configured and running. See also “man vnstatd”

I know that vnstat needs to be configured at the first use, but none of the ways I did it in Ubuntu and Antix works with Porteus. Command “vnstat –config” results in “file for –config missing”.
I guess the daemon has not even started.
I tried things I found in another post to start the daemon:

“chmod / 0755/ etc/rc.d/rc.vnstat”

but it gives
“chmod: cannot access ‘etc/rc.d/rc.vnstat’: No such file or directory.

Any help? I am not married to vnstat, so if there is another simple way to monitor usage, applets or appimages or whatever, please advise. “Mate System monitor “ will show usage, but it will not retain it, and if I forget to check it out before disconnecting wifi, it is gone. I forget almost always…..

beny
Full of knowledge
Full of knowledge
Posts: 2086
Joined: 02 Jan 2011, 11:33
Location: italy

How to start Vnstat?

Post#2 by beny » 16 Jul 2022, 21:08

hi run /usr/sbin/vnstatd --initdb that create an empty database in /var/lib/vnstat,after you can run daemon in rc.d try if work for you.
guest@porteus:~$ sudo sh '/etc/rc.d/rc.vnstat' start
Starting the vnstat daemon...
No interfaces found in database, adding available interfaces...
Interface "eth0" added with 100 Mbit bandwidth limit.
-> 1 new interface found.
Limits can be modified using the configuration file. See "man vnstat.conf".
Unwanted interfaces can be removed from monitoring with "vnstat --remove".
guest@porteus:~$

bakunin
White ninja
White ninja
Posts: 16
Joined: 16 Jul 2022, 15:52
Distribution: porteus 5

How to start Vnstat?

Post#3 by bakunin » 17 Jul 2022, 15:01

I could not make it work. You'll have to excuse my ignorance. I am not sure what you mean by "run", typing that in terminal gives a "command not found".
So I navigated as superuser to "sbin" folder, and created an empty file named "vnstatd --initdb" manually. Then I typed the "sudo sh '/etc/rc.d/rc.vnstat start"
and it gives "/etc/rc.d/rc.vnstat: No such file or directory. What am I doing wrong?

beny
Full of knowledge
Full of knowledge
Posts: 2086
Joined: 02 Jan 2011, 11:33
Location: italy

How to start Vnstat?

Post#4 by beny » 17 Jul 2022, 16:35

hi open a terminal or console and write: /usr/sbin/vnstatd --initdb is an executable, this make an empty database that is mandatory for vnstat,when you start a script in rc.d you have to put always the sh before or the script fail to run:guest@porteus:~$ sudo sh '/etc/rc.d/rc.vnstat' start,

bakunin
White ninja
White ninja
Posts: 16
Joined: 16 Jul 2022, 15:52
Distribution: porteus 5

How to start Vnstat?

Post#5 by bakunin » 17 Jul 2022, 17:15

Hi,
writing "/usr/sbin/vnstatd --initdb " in terminal gives "Error: Failed to open database "/var/lib/vnstat/vnstat.db" in read/write mode."
Exiting..."
sudo /usr/sbin/vnstatd --initdb asks for password, then it will just start blinking indefinitely.

bakunin
White ninja
White ninja
Posts: 16
Joined: 16 Jul 2022, 15:52
Distribution: porteus 5

How to start Vnstat?

Post#6 by bakunin » 17 Jul 2022, 17:17

And after "sudo sh '/etc/rc.d/rc.vnstat' start" will give: sh: /etc/rc.d/rc.vnstat: No such file or directory

beny
Full of knowledge
Full of knowledge
Posts: 2086
Joined: 02 Jan 2011, 11:33
Location: italy

How to start Vnstat?

Post#7 by beny » 17 Jul 2022, 17:20

suoperuser or root you need to be:
sudo '/usr/sbin/vnstatd' --initdb
guest@porteus:~$ sudo sh '/etc/rc.d/rc.vnstat' start
Starting the vnstat daemon...
No interfaces found in database, adding available interfaces...
Interface "eth0" added with 100 Mbit bandwidth limit.
-> 1 new interface found.
Limits can be modified using the configuration file. See "man vnstat.conf".
Unwanted interfaces can be removed from monitoring with "vnstat --remove".
guest@porteus:~$

bakunin
White ninja
White ninja
Posts: 16
Joined: 16 Jul 2022, 15:52
Distribution: porteus 5

How to start Vnstat?

Post#8 by bakunin » 17 Jul 2022, 17:29

guest@porteus:~$ sudo '/usr/sbin/vnstatd' --initdb
Password:
guest@porteus:~$ : sudo sh '/etc/rc.d/rc.vnstat' start
guest@porteus:~$ vnstat
Error: Unable to discover suitable interface from database.
guest@porteus:~$ sudo sh '/etc/rc.d/rc.vnstat' start
sh: /etc/rc.d/rc.vnstat: No such file or directory

beny
Full of knowledge
Full of knowledge
Posts: 2086
Joined: 02 Jan 2011, 11:33
Location: italy

How to start Vnstat?

Post#9 by beny » 17 Jul 2022, 17:31

you have this:/var/lib/vnstat/vnstat.db
i have downloded this version:/mnt/sdg1/porteus/modules/vnstat-2.9-x86_64-1smt.txz

bakunin
White ninja
White ninja
Posts: 16
Joined: 16 Jul 2022, 15:52
Distribution: porteus 5

How to start Vnstat?

Post#10 by bakunin » 17 Jul 2022, 17:37

Yes, it looks like it is there

beny
Full of knowledge
Full of knowledge
Posts: 2086
Joined: 02 Jan 2011, 11:33
Location: italy

How to start Vnstat?

Post#11 by beny » 17 Jul 2022, 17:46

we need blaze i have a porteus 5 stock so is strange that your software fail the location is modules and if the device isn't linked into the database the deamon do not start. take a look at /mnt/live/memory/images/vnstat-2.9-x86_64-1smt.xzm if all the directory are loaded you can see all the modules loaded and running.

bakunin
White ninja
White ninja
Posts: 16
Joined: 16 Jul 2022, 15:52
Distribution: porteus 5

How to start Vnstat?

Post#12 by bakunin » 17 Jul 2022, 17:52

Soory, I'm not sure how to look at that

bakunin
White ninja
White ninja
Posts: 16
Joined: 16 Jul 2022, 15:52
Distribution: porteus 5

How to start Vnstat?

Post#13 by bakunin » 17 Jul 2022, 18:00

I have a different version: vnstat-2.9-x86_64-1cf.xzm
guest@porteus:~$ mnt/live/memory/images/vnstat-2.9-x86_64-1cf.xzm
bash: mnt/live/memory/images/vnstat-2.9-x86_64-1cf.xzm: No such file or directory
however, the module is marked as active in the module folder

beny
Full of knowledge
Full of knowledge
Posts: 2086
Joined: 02 Jan 2011, 11:33
Location: italy

How to start Vnstat?

Post#14 by beny » 17 Jul 2022, 18:01

sorry me too you have to talk with Blaze that is a porteus crew guy and maybe help you to choose other software for your need
ps: the software that you have downloaded is for a slackware current not slackware 15 so you have to search a slackware 15 package i told you because the cf on the package is of a guy that run only a slackware current that is another system so with pkgfinder search for a slackware 15 package that fit your system.
Last edited by beny on 17 Jul 2022, 18:10, edited 1 time in total.

bakunin
White ninja
White ninja
Posts: 16
Joined: 16 Jul 2022, 15:52
Distribution: porteus 5

How to start Vnstat?

Post#15 by bakunin » 17 Jul 2022, 18:04

Well thanks a lot anyway for trying

Post Reply