Bug 1757485 - Vnstat fails to log traffic.
Summary: Vnstat fails to log traffic.
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: vnstat
Version: epel7
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Adrian Reber
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-10-01 16:41 UTC by Erik Hedl
Modified: 2019-10-01 21:12 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-10-01 21:12:00 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Erik Hedl 2019-10-01 16:41:04 UTC
Description of problem:

Vnstat fails to log traffic. Queries on any interface result in the error message: "Not enough data available yet.". The underlying problem is that the /usr/lib/systemd/system/vnstat.service file is miss-configured.

Version-Release number of selected component (if applicable):

1.15-2.el7

How reproducible:

100% always fails to report traffic.

Steps to Reproduce:
1. execute query: "vnstat -i <some interface> -<one of h|d|w|m>"
2.
3.

Actual results:
"vnstat -i <some interface> -<one of h|d|w|m>"
<some interface>: Not enough data available yet.

Expected results:
A report to standard out configured per the hour|day|week|month.

Additional info:

Solution: 
1) stop vnstat service.
2) disable vnstat service.
3) remove all files in "/var/lib/vnstat/".
4) edit the /usr/lib/systemd/system/vnstat.service file, replace "vnstat -n" with "vnstat -d". 
5) enable vnstat service.
6) start vnstat service.

Long term solution, change the package to invoke the daemon ( -d option).

Comment 1 Adrian Reber 2019-10-01 16:58:02 UTC
Hmm, this is strange. My vnstat.service files contains the following:

[Service]
User=vnstat
ExecStart=/usr/sbin/vnstatd -n
ExecReload=/bin/kill -HUP $MAINPID

It starts vnstatd (with a trailing d) and not daemonizing a service is the preferred way when using systemd.

As far as I see it, everything is set up correctly with the vnstat service file.


A new installed vnstat creates a /var/lib/vnstat directory which is owned by the user vnstat.

If I start vnstat with 'systemctl start vnstat' and wait 5 minutes the vnstatd daemon collects data and stores it in /var/lib/vnstat which can then be queried using vnstat (without d).

The only thing necessary is to wait 5 minutes or change the configuration file.

Does it work differently for you.


Note You need to log in before you can comment on or make changes to this bug.