vnstat not updating
I installed vnstat on my Ubuntu 14.04 server to track my internet usage (I have a limited monthly transfer). The database never updates, however. I've tried uninstalling/reinstalling, but that doesn't work. What do I need to do to get vnstat to update and be accurate?
networking 14.04 vnstat
add a comment |
I installed vnstat on my Ubuntu 14.04 server to track my internet usage (I have a limited monthly transfer). The database never updates, however. I've tried uninstalling/reinstalling, but that doesn't work. What do I need to do to get vnstat to update and be accurate?
networking 14.04 vnstat
add a comment |
I installed vnstat on my Ubuntu 14.04 server to track my internet usage (I have a limited monthly transfer). The database never updates, however. I've tried uninstalling/reinstalling, but that doesn't work. What do I need to do to get vnstat to update and be accurate?
networking 14.04 vnstat
I installed vnstat on my Ubuntu 14.04 server to track my internet usage (I have a limited monthly transfer). The database never updates, however. I've tried uninstalling/reinstalling, but that doesn't work. What do I need to do to get vnstat to update and be accurate?
networking 14.04 vnstat
networking 14.04 vnstat
asked Jul 21 '14 at 14:39
vaindilvaindil
2633618
2633618
add a comment |
add a comment |
6 Answers
6
active
oldest
votes
Run
sudo chown -R vnstat:vnstat /var/lib/vnstat
This fixed my problem on Ubuntu 14.04.
Make sure you have following files in that folder and have proper ownership.
boby@fwhlin:/var/lib/vnstat$ ls -la
total 16
drwxr-xrwx 2 vnstat vnstat 4096 May 16 01:50 .
drwxr-xr-x 78 root root 4096 Jul 22 15:14 ..
-rw-r--rwx 1 vnstat vnstat 2792 Jul 26 00:26 eth0
-rw-rw-r-- 1 vnstat vnstat 2792 Jul 26 00:26 .eth0
boby@fwhlin:/var/lib/vnstat$
.eth0 is temp file, that may disappear sometimes.
add a comment |
After installing vnstat
the database need to be created (one time). To create the database you can use the update switch, which create new database in the base of no database. Create DB: sudo vnstat -i eth0 -u
where eth0 is the name of the network interface. If you are unsure update for all interfaces by sudo vnstat -u
. After sometime (1 minute) you can view the details vnstat -i eth0
or simply vnstat
.
Update
It seems vnstat
not running ! . Start the daemon by running sudo /etc/init.d/vnstat start
and check for the result after 5 minutes.
Example
sudo vnstat -u -i eth0
Error: Unable to read database “/var/lib/vnstat/eth0.
Info: -> A new database has been created.
sudo /etc/init.d/vnstat start
- Starting vnStat daemon vnstatd [ OK ]
Once database have been initialiase, its ready to monitor bandwidth usage. You can view the report by invoke command vnstat
.
@Vaindil, did you tried this?
– totti
Jul 27 '14 at 12:04
1
Yes, I did do this after I installed vnstat. Doingvnstat
does show the output, but it shows that the database hasn't been updated in weeks.
– vaindil
Jul 28 '14 at 15:42
Doesvnstat
running ? What's the output ofps aux | grep vnstat
– totti
Jul 28 '14 at 15:56
steven 6475 0.0 0.1 11744 916 pts/0 S+ 13:35 0:00 grep --color=auto vnstat
(vnstat
shows up red in the terminal, if it matters or helps)
– vaindil
Jul 30 '14 at 17:36
When attempting to runsudo /etc/init.d/vnstat start
, I get the following:Starting vnStat daemon: vnstatd.
/pidfile: No such file or directory
and then it sits as if it's doing something, but it sits indefinitely.
– vaindil
Jul 31 '14 at 18:14
add a comment |
Are you sure that vnstatd
is running, i.e. the daemon (background process) that does the data collection? If not, check with
ps aux | grep vnstatd
You should see it there.
For me, after upgrading to 14.04 vnstatd
kept crashing on start-up.
My solution was to remove the folder it uses to store its data (/var/lib/vnstat
) and create a new empty directory instead. You may need to run vnstatd
manually once to create the database after that:
vnstatd -n -s
Apart from that, I also needed to apply
sudo chown -R vnstat:vnstat /var/lib/vnstat
as suggested by HostOnNet.
add a comment |
Same issues here.
After checking the details it turned out that the databases for the different devices (eth0, ppp0, wlan0
, etc.) were created in /var/lib/vnstat
but these files were owned by the USER.
After
sudo chown -R vnstat:vnstat /var/lib/vnstat
it seems to be ok. I also had to check the default interface in /etc/vnstat.conf
- it was the wrong one for me, so I just changed it.
I forgat to add that I let run "vnstat -u -i wlan0" (and same for the other devices) as ROOT. This could also cause issues with permission. And one more thing: You have to check whether you are using systemd, init or upstart and start the daemon according to this.
– bradley
Jan 19 '16 at 14:36
add a comment |
Sorry I had to make this its own answer instead of editing Boby's since my edit was rejected :|
By default, when you install vnstat, it auto starts a vnstatd daemon, which collects metrics every 30 seconds and "updates them" (for all local devices) every 5 minutes. So in essence, after installing vnstat packet, you should start to see metrics 5 minutes later.
Appears to sometimes be a problem with the install package however. It sometimes seems to create /var/lib/vnstat directory in such a way that it isn't writable by user vnstat so vnstat program only works when run as root (the daemon runs as user vnstat).
You can check if this is your problem by running this:
ll /var/lib | grep vnstat
drwxr-xr-x 2 root root 4096 Oct 25 2014 vnstat
If it is owned by root (as it is in this example), then that may be your problem. You can also look for the cause in your /var/log/syslog file, it'll probably have lines like this:
Jul 27 22:06:19 xxx vnstatd[13276]: Error: Unable to open database "/var/lib/vnstat/eth0" for writing: Permission denied
Run
sudo chown -R vnstat:vnstat /var/lib/vnstat
This fixed my problem on Ubuntu 15.10.
Make sure you have following files in that folder and have proper ownership, should look like this when you're done:
/var/lib/vnstat$ ls -la
total 16
drwxr-xrwx 2 vnstat vnstat 4096 May 16 01:50 .
drwxr-xr-x 78 root root 4096 Jul 22 15:14 ..
-rw-r--rwx 1 vnstat vnstat 2792 Jul 26 00:26 eth0
-rw-rw-r-- 1 vnstat vnstat 2792 Jul 26 00:26 .eth0
You may need to restart your vnstat daemon via sudo /etc/init.d/vnstat restart
if it died from its initial failed startup attempt. You should start getting data for all devices in 5 minutes after the fix.
add a comment |
Try to output some from this help:
$ vnstat --help
vnStat 1.11 by Teemu Toivola
-q, --query query database
-h, --hours show hours
-d, --days show days
-m, --months show months
-w, --weeks show weeks
-t, --top10 show top10
-s, --short use short output
-u, --update update database
-i, --iface select interface (default: eth0)
-?, --help short help
-v, --version show version
-tr, --traffic calculate traffic
-ru, --rateunit swap configured rate unit
-l, --live show transfer rate in real time
See also "--longhelp" for complete options list and "man vnstat".
READ MORE
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f500663%2fvnstat-not-updating%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
6 Answers
6
active
oldest
votes
6 Answers
6
active
oldest
votes
active
oldest
votes
active
oldest
votes
Run
sudo chown -R vnstat:vnstat /var/lib/vnstat
This fixed my problem on Ubuntu 14.04.
Make sure you have following files in that folder and have proper ownership.
boby@fwhlin:/var/lib/vnstat$ ls -la
total 16
drwxr-xrwx 2 vnstat vnstat 4096 May 16 01:50 .
drwxr-xr-x 78 root root 4096 Jul 22 15:14 ..
-rw-r--rwx 1 vnstat vnstat 2792 Jul 26 00:26 eth0
-rw-rw-r-- 1 vnstat vnstat 2792 Jul 26 00:26 .eth0
boby@fwhlin:/var/lib/vnstat$
.eth0 is temp file, that may disappear sometimes.
add a comment |
Run
sudo chown -R vnstat:vnstat /var/lib/vnstat
This fixed my problem on Ubuntu 14.04.
Make sure you have following files in that folder and have proper ownership.
boby@fwhlin:/var/lib/vnstat$ ls -la
total 16
drwxr-xrwx 2 vnstat vnstat 4096 May 16 01:50 .
drwxr-xr-x 78 root root 4096 Jul 22 15:14 ..
-rw-r--rwx 1 vnstat vnstat 2792 Jul 26 00:26 eth0
-rw-rw-r-- 1 vnstat vnstat 2792 Jul 26 00:26 .eth0
boby@fwhlin:/var/lib/vnstat$
.eth0 is temp file, that may disappear sometimes.
add a comment |
Run
sudo chown -R vnstat:vnstat /var/lib/vnstat
This fixed my problem on Ubuntu 14.04.
Make sure you have following files in that folder and have proper ownership.
boby@fwhlin:/var/lib/vnstat$ ls -la
total 16
drwxr-xrwx 2 vnstat vnstat 4096 May 16 01:50 .
drwxr-xr-x 78 root root 4096 Jul 22 15:14 ..
-rw-r--rwx 1 vnstat vnstat 2792 Jul 26 00:26 eth0
-rw-rw-r-- 1 vnstat vnstat 2792 Jul 26 00:26 .eth0
boby@fwhlin:/var/lib/vnstat$
.eth0 is temp file, that may disappear sometimes.
Run
sudo chown -R vnstat:vnstat /var/lib/vnstat
This fixed my problem on Ubuntu 14.04.
Make sure you have following files in that folder and have proper ownership.
boby@fwhlin:/var/lib/vnstat$ ls -la
total 16
drwxr-xrwx 2 vnstat vnstat 4096 May 16 01:50 .
drwxr-xr-x 78 root root 4096 Jul 22 15:14 ..
-rw-r--rwx 1 vnstat vnstat 2792 Jul 26 00:26 eth0
-rw-rw-r-- 1 vnstat vnstat 2792 Jul 26 00:26 .eth0
boby@fwhlin:/var/lib/vnstat$
.eth0 is temp file, that may disappear sometimes.
answered Jul 25 '14 at 18:59
Yujin BobyYujin Boby
1616
1616
add a comment |
add a comment |
After installing vnstat
the database need to be created (one time). To create the database you can use the update switch, which create new database in the base of no database. Create DB: sudo vnstat -i eth0 -u
where eth0 is the name of the network interface. If you are unsure update for all interfaces by sudo vnstat -u
. After sometime (1 minute) you can view the details vnstat -i eth0
or simply vnstat
.
Update
It seems vnstat
not running ! . Start the daemon by running sudo /etc/init.d/vnstat start
and check for the result after 5 minutes.
Example
sudo vnstat -u -i eth0
Error: Unable to read database “/var/lib/vnstat/eth0.
Info: -> A new database has been created.
sudo /etc/init.d/vnstat start
- Starting vnStat daemon vnstatd [ OK ]
Once database have been initialiase, its ready to monitor bandwidth usage. You can view the report by invoke command vnstat
.
@Vaindil, did you tried this?
– totti
Jul 27 '14 at 12:04
1
Yes, I did do this after I installed vnstat. Doingvnstat
does show the output, but it shows that the database hasn't been updated in weeks.
– vaindil
Jul 28 '14 at 15:42
Doesvnstat
running ? What's the output ofps aux | grep vnstat
– totti
Jul 28 '14 at 15:56
steven 6475 0.0 0.1 11744 916 pts/0 S+ 13:35 0:00 grep --color=auto vnstat
(vnstat
shows up red in the terminal, if it matters or helps)
– vaindil
Jul 30 '14 at 17:36
When attempting to runsudo /etc/init.d/vnstat start
, I get the following:Starting vnStat daemon: vnstatd.
/pidfile: No such file or directory
and then it sits as if it's doing something, but it sits indefinitely.
– vaindil
Jul 31 '14 at 18:14
add a comment |
After installing vnstat
the database need to be created (one time). To create the database you can use the update switch, which create new database in the base of no database. Create DB: sudo vnstat -i eth0 -u
where eth0 is the name of the network interface. If you are unsure update for all interfaces by sudo vnstat -u
. After sometime (1 minute) you can view the details vnstat -i eth0
or simply vnstat
.
Update
It seems vnstat
not running ! . Start the daemon by running sudo /etc/init.d/vnstat start
and check for the result after 5 minutes.
Example
sudo vnstat -u -i eth0
Error: Unable to read database “/var/lib/vnstat/eth0.
Info: -> A new database has been created.
sudo /etc/init.d/vnstat start
- Starting vnStat daemon vnstatd [ OK ]
Once database have been initialiase, its ready to monitor bandwidth usage. You can view the report by invoke command vnstat
.
@Vaindil, did you tried this?
– totti
Jul 27 '14 at 12:04
1
Yes, I did do this after I installed vnstat. Doingvnstat
does show the output, but it shows that the database hasn't been updated in weeks.
– vaindil
Jul 28 '14 at 15:42
Doesvnstat
running ? What's the output ofps aux | grep vnstat
– totti
Jul 28 '14 at 15:56
steven 6475 0.0 0.1 11744 916 pts/0 S+ 13:35 0:00 grep --color=auto vnstat
(vnstat
shows up red in the terminal, if it matters or helps)
– vaindil
Jul 30 '14 at 17:36
When attempting to runsudo /etc/init.d/vnstat start
, I get the following:Starting vnStat daemon: vnstatd.
/pidfile: No such file or directory
and then it sits as if it's doing something, but it sits indefinitely.
– vaindil
Jul 31 '14 at 18:14
add a comment |
After installing vnstat
the database need to be created (one time). To create the database you can use the update switch, which create new database in the base of no database. Create DB: sudo vnstat -i eth0 -u
where eth0 is the name of the network interface. If you are unsure update for all interfaces by sudo vnstat -u
. After sometime (1 minute) you can view the details vnstat -i eth0
or simply vnstat
.
Update
It seems vnstat
not running ! . Start the daemon by running sudo /etc/init.d/vnstat start
and check for the result after 5 minutes.
Example
sudo vnstat -u -i eth0
Error: Unable to read database “/var/lib/vnstat/eth0.
Info: -> A new database has been created.
sudo /etc/init.d/vnstat start
- Starting vnStat daemon vnstatd [ OK ]
Once database have been initialiase, its ready to monitor bandwidth usage. You can view the report by invoke command vnstat
.
After installing vnstat
the database need to be created (one time). To create the database you can use the update switch, which create new database in the base of no database. Create DB: sudo vnstat -i eth0 -u
where eth0 is the name of the network interface. If you are unsure update for all interfaces by sudo vnstat -u
. After sometime (1 minute) you can view the details vnstat -i eth0
or simply vnstat
.
Update
It seems vnstat
not running ! . Start the daemon by running sudo /etc/init.d/vnstat start
and check for the result after 5 minutes.
Example
sudo vnstat -u -i eth0
Error: Unable to read database “/var/lib/vnstat/eth0.
Info: -> A new database has been created.
sudo /etc/init.d/vnstat start
- Starting vnStat daemon vnstatd [ OK ]
Once database have been initialiase, its ready to monitor bandwidth usage. You can view the report by invoke command vnstat
.
edited Jul 31 '14 at 5:51
answered Jul 24 '14 at 6:58
tottitotti
5,02013042
5,02013042
@Vaindil, did you tried this?
– totti
Jul 27 '14 at 12:04
1
Yes, I did do this after I installed vnstat. Doingvnstat
does show the output, but it shows that the database hasn't been updated in weeks.
– vaindil
Jul 28 '14 at 15:42
Doesvnstat
running ? What's the output ofps aux | grep vnstat
– totti
Jul 28 '14 at 15:56
steven 6475 0.0 0.1 11744 916 pts/0 S+ 13:35 0:00 grep --color=auto vnstat
(vnstat
shows up red in the terminal, if it matters or helps)
– vaindil
Jul 30 '14 at 17:36
When attempting to runsudo /etc/init.d/vnstat start
, I get the following:Starting vnStat daemon: vnstatd.
/pidfile: No such file or directory
and then it sits as if it's doing something, but it sits indefinitely.
– vaindil
Jul 31 '14 at 18:14
add a comment |
@Vaindil, did you tried this?
– totti
Jul 27 '14 at 12:04
1
Yes, I did do this after I installed vnstat. Doingvnstat
does show the output, but it shows that the database hasn't been updated in weeks.
– vaindil
Jul 28 '14 at 15:42
Doesvnstat
running ? What's the output ofps aux | grep vnstat
– totti
Jul 28 '14 at 15:56
steven 6475 0.0 0.1 11744 916 pts/0 S+ 13:35 0:00 grep --color=auto vnstat
(vnstat
shows up red in the terminal, if it matters or helps)
– vaindil
Jul 30 '14 at 17:36
When attempting to runsudo /etc/init.d/vnstat start
, I get the following:Starting vnStat daemon: vnstatd.
/pidfile: No such file or directory
and then it sits as if it's doing something, but it sits indefinitely.
– vaindil
Jul 31 '14 at 18:14
@Vaindil, did you tried this?
– totti
Jul 27 '14 at 12:04
@Vaindil, did you tried this?
– totti
Jul 27 '14 at 12:04
1
1
Yes, I did do this after I installed vnstat. Doing
vnstat
does show the output, but it shows that the database hasn't been updated in weeks.– vaindil
Jul 28 '14 at 15:42
Yes, I did do this after I installed vnstat. Doing
vnstat
does show the output, but it shows that the database hasn't been updated in weeks.– vaindil
Jul 28 '14 at 15:42
Does
vnstat
running ? What's the output of ps aux | grep vnstat
– totti
Jul 28 '14 at 15:56
Does
vnstat
running ? What's the output of ps aux | grep vnstat
– totti
Jul 28 '14 at 15:56
steven 6475 0.0 0.1 11744 916 pts/0 S+ 13:35 0:00 grep --color=auto vnstat
(vnstat
shows up red in the terminal, if it matters or helps)– vaindil
Jul 30 '14 at 17:36
steven 6475 0.0 0.1 11744 916 pts/0 S+ 13:35 0:00 grep --color=auto vnstat
(vnstat
shows up red in the terminal, if it matters or helps)– vaindil
Jul 30 '14 at 17:36
When attempting to run
sudo /etc/init.d/vnstat start
, I get the following: Starting vnStat daemon: vnstatd.
/ pidfile: No such file or directory
and then it sits as if it's doing something, but it sits indefinitely.– vaindil
Jul 31 '14 at 18:14
When attempting to run
sudo /etc/init.d/vnstat start
, I get the following: Starting vnStat daemon: vnstatd.
/ pidfile: No such file or directory
and then it sits as if it's doing something, but it sits indefinitely.– vaindil
Jul 31 '14 at 18:14
add a comment |
Are you sure that vnstatd
is running, i.e. the daemon (background process) that does the data collection? If not, check with
ps aux | grep vnstatd
You should see it there.
For me, after upgrading to 14.04 vnstatd
kept crashing on start-up.
My solution was to remove the folder it uses to store its data (/var/lib/vnstat
) and create a new empty directory instead. You may need to run vnstatd
manually once to create the database after that:
vnstatd -n -s
Apart from that, I also needed to apply
sudo chown -R vnstat:vnstat /var/lib/vnstat
as suggested by HostOnNet.
add a comment |
Are you sure that vnstatd
is running, i.e. the daemon (background process) that does the data collection? If not, check with
ps aux | grep vnstatd
You should see it there.
For me, after upgrading to 14.04 vnstatd
kept crashing on start-up.
My solution was to remove the folder it uses to store its data (/var/lib/vnstat
) and create a new empty directory instead. You may need to run vnstatd
manually once to create the database after that:
vnstatd -n -s
Apart from that, I also needed to apply
sudo chown -R vnstat:vnstat /var/lib/vnstat
as suggested by HostOnNet.
add a comment |
Are you sure that vnstatd
is running, i.e. the daemon (background process) that does the data collection? If not, check with
ps aux | grep vnstatd
You should see it there.
For me, after upgrading to 14.04 vnstatd
kept crashing on start-up.
My solution was to remove the folder it uses to store its data (/var/lib/vnstat
) and create a new empty directory instead. You may need to run vnstatd
manually once to create the database after that:
vnstatd -n -s
Apart from that, I also needed to apply
sudo chown -R vnstat:vnstat /var/lib/vnstat
as suggested by HostOnNet.
Are you sure that vnstatd
is running, i.e. the daemon (background process) that does the data collection? If not, check with
ps aux | grep vnstatd
You should see it there.
For me, after upgrading to 14.04 vnstatd
kept crashing on start-up.
My solution was to remove the folder it uses to store its data (/var/lib/vnstat
) and create a new empty directory instead. You may need to run vnstatd
manually once to create the database after that:
vnstatd -n -s
Apart from that, I also needed to apply
sudo chown -R vnstat:vnstat /var/lib/vnstat
as suggested by HostOnNet.
edited Mar 10 '15 at 17:19
answered Mar 9 '15 at 8:34
fuenfundachtzigfuenfundachtzig
24128
24128
add a comment |
add a comment |
Same issues here.
After checking the details it turned out that the databases for the different devices (eth0, ppp0, wlan0
, etc.) were created in /var/lib/vnstat
but these files were owned by the USER.
After
sudo chown -R vnstat:vnstat /var/lib/vnstat
it seems to be ok. I also had to check the default interface in /etc/vnstat.conf
- it was the wrong one for me, so I just changed it.
I forgat to add that I let run "vnstat -u -i wlan0" (and same for the other devices) as ROOT. This could also cause issues with permission. And one more thing: You have to check whether you are using systemd, init or upstart and start the daemon according to this.
– bradley
Jan 19 '16 at 14:36
add a comment |
Same issues here.
After checking the details it turned out that the databases for the different devices (eth0, ppp0, wlan0
, etc.) were created in /var/lib/vnstat
but these files were owned by the USER.
After
sudo chown -R vnstat:vnstat /var/lib/vnstat
it seems to be ok. I also had to check the default interface in /etc/vnstat.conf
- it was the wrong one for me, so I just changed it.
I forgat to add that I let run "vnstat -u -i wlan0" (and same for the other devices) as ROOT. This could also cause issues with permission. And one more thing: You have to check whether you are using systemd, init or upstart and start the daemon according to this.
– bradley
Jan 19 '16 at 14:36
add a comment |
Same issues here.
After checking the details it turned out that the databases for the different devices (eth0, ppp0, wlan0
, etc.) were created in /var/lib/vnstat
but these files were owned by the USER.
After
sudo chown -R vnstat:vnstat /var/lib/vnstat
it seems to be ok. I also had to check the default interface in /etc/vnstat.conf
- it was the wrong one for me, so I just changed it.
Same issues here.
After checking the details it turned out that the databases for the different devices (eth0, ppp0, wlan0
, etc.) were created in /var/lib/vnstat
but these files were owned by the USER.
After
sudo chown -R vnstat:vnstat /var/lib/vnstat
it seems to be ok. I also had to check the default interface in /etc/vnstat.conf
- it was the wrong one for me, so I just changed it.
edited Jan 19 '16 at 18:29
Mudit Kapil
1,22552040
1,22552040
answered Jan 19 '16 at 14:03
bradleybradley
111
111
I forgat to add that I let run "vnstat -u -i wlan0" (and same for the other devices) as ROOT. This could also cause issues with permission. And one more thing: You have to check whether you are using systemd, init or upstart and start the daemon according to this.
– bradley
Jan 19 '16 at 14:36
add a comment |
I forgat to add that I let run "vnstat -u -i wlan0" (and same for the other devices) as ROOT. This could also cause issues with permission. And one more thing: You have to check whether you are using systemd, init or upstart and start the daemon according to this.
– bradley
Jan 19 '16 at 14:36
I forgat to add that I let run "vnstat -u -i wlan0" (and same for the other devices) as ROOT. This could also cause issues with permission. And one more thing: You have to check whether you are using systemd, init or upstart and start the daemon according to this.
– bradley
Jan 19 '16 at 14:36
I forgat to add that I let run "vnstat -u -i wlan0" (and same for the other devices) as ROOT. This could also cause issues with permission. And one more thing: You have to check whether you are using systemd, init or upstart and start the daemon according to this.
– bradley
Jan 19 '16 at 14:36
add a comment |
Sorry I had to make this its own answer instead of editing Boby's since my edit was rejected :|
By default, when you install vnstat, it auto starts a vnstatd daemon, which collects metrics every 30 seconds and "updates them" (for all local devices) every 5 minutes. So in essence, after installing vnstat packet, you should start to see metrics 5 minutes later.
Appears to sometimes be a problem with the install package however. It sometimes seems to create /var/lib/vnstat directory in such a way that it isn't writable by user vnstat so vnstat program only works when run as root (the daemon runs as user vnstat).
You can check if this is your problem by running this:
ll /var/lib | grep vnstat
drwxr-xr-x 2 root root 4096 Oct 25 2014 vnstat
If it is owned by root (as it is in this example), then that may be your problem. You can also look for the cause in your /var/log/syslog file, it'll probably have lines like this:
Jul 27 22:06:19 xxx vnstatd[13276]: Error: Unable to open database "/var/lib/vnstat/eth0" for writing: Permission denied
Run
sudo chown -R vnstat:vnstat /var/lib/vnstat
This fixed my problem on Ubuntu 15.10.
Make sure you have following files in that folder and have proper ownership, should look like this when you're done:
/var/lib/vnstat$ ls -la
total 16
drwxr-xrwx 2 vnstat vnstat 4096 May 16 01:50 .
drwxr-xr-x 78 root root 4096 Jul 22 15:14 ..
-rw-r--rwx 1 vnstat vnstat 2792 Jul 26 00:26 eth0
-rw-rw-r-- 1 vnstat vnstat 2792 Jul 26 00:26 .eth0
You may need to restart your vnstat daemon via sudo /etc/init.d/vnstat restart
if it died from its initial failed startup attempt. You should start getting data for all devices in 5 minutes after the fix.
add a comment |
Sorry I had to make this its own answer instead of editing Boby's since my edit was rejected :|
By default, when you install vnstat, it auto starts a vnstatd daemon, which collects metrics every 30 seconds and "updates them" (for all local devices) every 5 minutes. So in essence, after installing vnstat packet, you should start to see metrics 5 minutes later.
Appears to sometimes be a problem with the install package however. It sometimes seems to create /var/lib/vnstat directory in such a way that it isn't writable by user vnstat so vnstat program only works when run as root (the daemon runs as user vnstat).
You can check if this is your problem by running this:
ll /var/lib | grep vnstat
drwxr-xr-x 2 root root 4096 Oct 25 2014 vnstat
If it is owned by root (as it is in this example), then that may be your problem. You can also look for the cause in your /var/log/syslog file, it'll probably have lines like this:
Jul 27 22:06:19 xxx vnstatd[13276]: Error: Unable to open database "/var/lib/vnstat/eth0" for writing: Permission denied
Run
sudo chown -R vnstat:vnstat /var/lib/vnstat
This fixed my problem on Ubuntu 15.10.
Make sure you have following files in that folder and have proper ownership, should look like this when you're done:
/var/lib/vnstat$ ls -la
total 16
drwxr-xrwx 2 vnstat vnstat 4096 May 16 01:50 .
drwxr-xr-x 78 root root 4096 Jul 22 15:14 ..
-rw-r--rwx 1 vnstat vnstat 2792 Jul 26 00:26 eth0
-rw-rw-r-- 1 vnstat vnstat 2792 Jul 26 00:26 .eth0
You may need to restart your vnstat daemon via sudo /etc/init.d/vnstat restart
if it died from its initial failed startup attempt. You should start getting data for all devices in 5 minutes after the fix.
add a comment |
Sorry I had to make this its own answer instead of editing Boby's since my edit was rejected :|
By default, when you install vnstat, it auto starts a vnstatd daemon, which collects metrics every 30 seconds and "updates them" (for all local devices) every 5 minutes. So in essence, after installing vnstat packet, you should start to see metrics 5 minutes later.
Appears to sometimes be a problem with the install package however. It sometimes seems to create /var/lib/vnstat directory in such a way that it isn't writable by user vnstat so vnstat program only works when run as root (the daemon runs as user vnstat).
You can check if this is your problem by running this:
ll /var/lib | grep vnstat
drwxr-xr-x 2 root root 4096 Oct 25 2014 vnstat
If it is owned by root (as it is in this example), then that may be your problem. You can also look for the cause in your /var/log/syslog file, it'll probably have lines like this:
Jul 27 22:06:19 xxx vnstatd[13276]: Error: Unable to open database "/var/lib/vnstat/eth0" for writing: Permission denied
Run
sudo chown -R vnstat:vnstat /var/lib/vnstat
This fixed my problem on Ubuntu 15.10.
Make sure you have following files in that folder and have proper ownership, should look like this when you're done:
/var/lib/vnstat$ ls -la
total 16
drwxr-xrwx 2 vnstat vnstat 4096 May 16 01:50 .
drwxr-xr-x 78 root root 4096 Jul 22 15:14 ..
-rw-r--rwx 1 vnstat vnstat 2792 Jul 26 00:26 eth0
-rw-rw-r-- 1 vnstat vnstat 2792 Jul 26 00:26 .eth0
You may need to restart your vnstat daemon via sudo /etc/init.d/vnstat restart
if it died from its initial failed startup attempt. You should start getting data for all devices in 5 minutes after the fix.
Sorry I had to make this its own answer instead of editing Boby's since my edit was rejected :|
By default, when you install vnstat, it auto starts a vnstatd daemon, which collects metrics every 30 seconds and "updates them" (for all local devices) every 5 minutes. So in essence, after installing vnstat packet, you should start to see metrics 5 minutes later.
Appears to sometimes be a problem with the install package however. It sometimes seems to create /var/lib/vnstat directory in such a way that it isn't writable by user vnstat so vnstat program only works when run as root (the daemon runs as user vnstat).
You can check if this is your problem by running this:
ll /var/lib | grep vnstat
drwxr-xr-x 2 root root 4096 Oct 25 2014 vnstat
If it is owned by root (as it is in this example), then that may be your problem. You can also look for the cause in your /var/log/syslog file, it'll probably have lines like this:
Jul 27 22:06:19 xxx vnstatd[13276]: Error: Unable to open database "/var/lib/vnstat/eth0" for writing: Permission denied
Run
sudo chown -R vnstat:vnstat /var/lib/vnstat
This fixed my problem on Ubuntu 15.10.
Make sure you have following files in that folder and have proper ownership, should look like this when you're done:
/var/lib/vnstat$ ls -la
total 16
drwxr-xrwx 2 vnstat vnstat 4096 May 16 01:50 .
drwxr-xr-x 78 root root 4096 Jul 22 15:14 ..
-rw-r--rwx 1 vnstat vnstat 2792 Jul 26 00:26 eth0
-rw-rw-r-- 1 vnstat vnstat 2792 Jul 26 00:26 .eth0
You may need to restart your vnstat daemon via sudo /etc/init.d/vnstat restart
if it died from its initial failed startup attempt. You should start getting data for all devices in 5 minutes after the fix.
edited Sep 15 '17 at 16:44
answered Jul 28 '16 at 16:51
rogerdpackrogerdpack
476513
476513
add a comment |
add a comment |
Try to output some from this help:
$ vnstat --help
vnStat 1.11 by Teemu Toivola
-q, --query query database
-h, --hours show hours
-d, --days show days
-m, --months show months
-w, --weeks show weeks
-t, --top10 show top10
-s, --short use short output
-u, --update update database
-i, --iface select interface (default: eth0)
-?, --help short help
-v, --version show version
-tr, --traffic calculate traffic
-ru, --rateunit swap configured rate unit
-l, --live show transfer rate in real time
See also "--longhelp" for complete options list and "man vnstat".
READ MORE
add a comment |
Try to output some from this help:
$ vnstat --help
vnStat 1.11 by Teemu Toivola
-q, --query query database
-h, --hours show hours
-d, --days show days
-m, --months show months
-w, --weeks show weeks
-t, --top10 show top10
-s, --short use short output
-u, --update update database
-i, --iface select interface (default: eth0)
-?, --help short help
-v, --version show version
-tr, --traffic calculate traffic
-ru, --rateunit swap configured rate unit
-l, --live show transfer rate in real time
See also "--longhelp" for complete options list and "man vnstat".
READ MORE
add a comment |
Try to output some from this help:
$ vnstat --help
vnStat 1.11 by Teemu Toivola
-q, --query query database
-h, --hours show hours
-d, --days show days
-m, --months show months
-w, --weeks show weeks
-t, --top10 show top10
-s, --short use short output
-u, --update update database
-i, --iface select interface (default: eth0)
-?, --help short help
-v, --version show version
-tr, --traffic calculate traffic
-ru, --rateunit swap configured rate unit
-l, --live show transfer rate in real time
See also "--longhelp" for complete options list and "man vnstat".
READ MORE
Try to output some from this help:
$ vnstat --help
vnStat 1.11 by Teemu Toivola
-q, --query query database
-h, --hours show hours
-d, --days show days
-m, --months show months
-w, --weeks show weeks
-t, --top10 show top10
-s, --short use short output
-u, --update update database
-i, --iface select interface (default: eth0)
-?, --help short help
-v, --version show version
-tr, --traffic calculate traffic
-ru, --rateunit swap configured rate unit
-l, --live show transfer rate in real time
See also "--longhelp" for complete options list and "man vnstat".
READ MORE
answered Jul 23 '14 at 20:29
swiftswift
2,96621743
2,96621743
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f500663%2fvnstat-not-updating%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown