Bug 25417 - Traffic accounting data not displayed in Network Monitor because not enabled
Summary: Traffic accounting data not displayed in Network Monitor because not enabled
Status: NEW
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 7
Hardware: x86_64 Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Mageia tools maintainers
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-07 21:25 CEST by Jim fenton
Modified: 2019-09-11 07:40 CEST (History)
3 users (show)

See Also:
Source RPM: net_monitor-0.25-1.mga7.src.rpm
CVE:
Status comment:


Attachments
picture (62.81 KB, image/png)
2019-09-07 23:56 CEST, Marek Laane
Details

Description Jim fenton 2019-09-07 21:25:52 CEST
Description of problem: The Network Monitor does not display traffic accounting data. It shows a message that "Network accounting is not enabled for this interface."  VNSTAT is running and logging data as verified by running from command line.  The live Traffic Statistics and Interface Settings work correctly.  


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


How reproducible: Always.  I have this problem on both x86_64 and i586 systems with both wired and wireless networks.  All were clean installs (not upgrades).


Steps to Reproduce:
1. Set up network interface with network accounting enabled
2. Ensure VNSTAT service running
3. Transmit/receive network data
4. Run VNSTAT from command line and verify data logged
5. Open Network Monitor and observe no accounting data available
Comment 1 Lewis Smith 2019-09-07 21:58:44 CEST
This package is described as:
"net_monitor - Network monitoring tool​                                                                                                                         
This is a network monitoring tool, intended to replace the old net_monitor from drakx-net. It supports graphical network monitoring and some advanced features, such as network profiling, activity monitoring, detailed logging and network traffic statistics with help of vnstat reporting."
[Which you say work].

Jim, can you clarify what you mean by "Traffic accounting data"; and what makes you to believe that net_monitor should provide it? For I can find no reference to it: there is no man page, and nothing in /usr/share/doc/net_monitor/* .

Is the lack you describe new in Mageia 7, but which was present in Mageia 6?

CC: (none) => lewyssmith

Comment 2 Marek Laane 2019-09-07 23:56:34 CEST
Created attachment 11271 [details]
picture

He probably means this (see lowest section)
Comment 3 Lewis Smith 2019-09-08 09:37:55 CEST
Thank you Marek. My display was disguised by a foreign language. And looks very slightly different (M7): was yours Mageia 6?

(In reply to Jim fenton from comment #0)
> Description of problem: The Network Monitor does not display traffic
> accounting data. It shows a message that "Network accounting is not enabled
> for this interface." 
So it is not enabled, rather than being enabled but not being displayed.

As for the invitation to enable Traffic accounting in the Network Centre, I found no means to do so. Just a single screen (advanced options) to disable certain things, and enable others - which did *not* include Traffic accounting.
Is this where the problem lies?

Assigning to Mageia tools, CC'ing Wally for 'networkmanager' not being sure whether that is the right package.

Summary: Traffic accounting data not displayed in Network Monitor => Traffic accounting data not displayed in Network Monitor because not enabled
CC: lewyssmith => jani.valimaa
Assignee: bugsquad => mageiatools

Comment 4 papoteur 2019-09-08 10:53:02 CEST
Hello,
This can be set from networkcenter, Configure, enable traffic accounting, see our documentation:
https://doc.mageia.org/mcc/7/en/content/mcc-network.html#d4e1541
Then display is accessible from "Monitor" button.

CC: (none) => yves.brungard_mageia

Comment 5 papoteur 2019-09-08 12:32:03 CEST
The application displays the message when /var/lib/vnstat doesn't include a file named as the interface (/var/lib/vnstat/enp0s20f0u1u2 for example on my box).
What is the content of /var/lib/vnstat/ for you?
Comment 6 Jim fenton 2019-09-08 15:40:39 CEST
(In reply to papoteur from comment #5)
> The application displays the message when /var/lib/vnstat doesn't include a
> file named as the interface (/var/lib/vnstat/enp0s20f0u1u2 for example on my
> box).
> What is the content of /var/lib/vnstat/ for you?

The only file present was vnstat.db.  I created files for my network interfaces and that enabled traffic accounting in the network monitor.  So maybe the bug is that the inferface file isn't created when traffic accounting is enabled during setup.  

I don't remember having to do this manually with Mageia 6 or 5.
Comment 7 papoteur 2019-09-08 15:54:50 CEST
No, I presume that this is a new behaviour since vnstat 2.0
>2.0 / 21-Oct-2018

 - Fixed
     ...
 - New
   - C struct dump database has been replaced with sqlite database,
     full data import included from legacy databases of versions 1.3 - 1.18

I don't have vnstat.db and when I launch vnstat I get:
Error: Unable to open database "/var/lib/vnstat/vnstat.db": No such file or directory
The vnStat daemon should have created the database when started.
Check that it is configured and running. See also "man vnstatd".

We missed at least a migration step, I think. And net_monitor has to be modified to reflect this change.
Comment 8 Jim fenton 2019-09-08 16:02:12 CEST
I just noticed another bug with the Network Monitor.  The Connection time in the traffic accounting section is not incrementing the minutes when the seconds roll over.  Instead of going from 0 hours, 0 minutes, 59 seconds to 0 hours, 1 minutes, 0 seconds, it goes back to 0 hours, 0 minutes, 0 seconds. A reboot did not have any effect.

Let me know if I should submit this separately.
Comment 9 papoteur 2019-09-08 20:48:58 CEST
(In reply to Jim fenton from comment #8)
> I just noticed another bug with the Network Monitor.  The Connection time in
> the traffic accounting section is not incrementing the minutes when the
> seconds roll over.  Instead of going from 0 hours, 0 minutes, 59 seconds to
> 0 hours, 1 minutes, 0 seconds, it goes back to 0 hours, 0 minutes, 0
> seconds. A reboot did not have any effect.
> 
> Let me know if I should submit this separately.
Good catch. I pushed a correction for that.
Not necessary to file another bug report.
Comment 10 papoteur 2019-09-08 21:02:44 CEST
I don't understand how vnstatd is enabled when "Enable traffic accounting" is checked. On my side, in Mageia 7, it has no effect, but I presume that is because vnstat doesn't work with lack of vnstat.db.
Comment 11 Jim fenton 2019-09-08 22:36:58 CEST
(In reply to papoteur from comment #10)
> I don't understand how vnstatd is enabled when "Enable traffic accounting"
> is checked. On my side, in Mageia 7, it has no effect, but I presume that is
> because vnstat doesn't work with lack of vnstat.db.

I don't think "Enable traffic accounting" affects the vnstatd service.  I think it's supposed to create the interface file in /var/lib/vnstat so net_monitor can read vnstat.db.  Starting the vnstatd service so vnstat.db gets created is an independent step.
Comment 12 Jim fenton 2019-09-08 23:40:00 CEST
If I were to resubmit this bug, I think I'd write it as:

Network configuration tool not creating Network Monitor interface file when "Enable traffic accounting" selected during interface setup/configuration.

Description:  When setting up a network interface, selecting "Enable traffic accounting" does not create the interface file in /var/lib/vnstat.  This prevents Network Monitor from displaying detailed network statistics.  


Steps to Reproduce:
1. Set up network interface with network accounting enabled
2. Open Network Monitor and observe message "Network accounting not enabled for this interface."
3. Look in /var/lib/vnstat and note no file with name of interface.  (vnstat.db should be there if vnstat is running)

Workaround:  Manually create a file in /var/lib/vnstat with the name of the interface.  Content of the file does not appear to matter.

On a related note, unchecking "Enable traffic accounting" in the network configuration tool does not delete the interface file from /var/lib/vnstat, so traffic accounting will continue.
Comment 13 David GEIGER 2019-09-09 14:12:15 CEST
I don't know if new update fixes this issue but you can try vnstat-2.2-1.1.mga7 in Core/Updates_testing!

It change pidfile location from deprecated /var/run to /run

CC: (none) => geiger.david68210

Comment 14 David GEIGER 2019-09-11 07:40:47 CEST
Packages in 7/core/updates_testing:
========================
vnstat-2.2-1.1.mga7.x86_64.rpm
vnstat-2.2-1.1.mga7.i586.rpm

Source RPM: 
========================
vnstat-2.2-1.1.mga7.src.rpm

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