WhatPulse Forums » Support » Client software v » [SOLVED] [Linux] Network data is measured but not pulsed Welcome back, Guest.


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] [Linux] Network data is measured but not pulsed
12-04-2014, 06:33 PM (This post was last modified: 03-13-2015 08:43 AM by smitmartijn.)
Post: #1
[SOLVED] [Linux] Network data is measured but not pulsed
Hi.

I am running Linux Mint 17 64-bit with WhatPulse 2.4.1. Upon updating to the new client, I noticed that network traffic was still being measured in the Network tab, but is not being added to the unpulsed statistics on the overview.

I have followed this guide and ensured that the setup-input-permissions.sh script was run, and that all of the required packages have been installed.

Upon running, I was prompted to run the setcap command, which I accepted and ran. I have additionally tried running the following commands numerous times in my troubleshooting:

Code:
sudo setcap cap_net_raw,cap_net_admin=eip ./whatpulse
sudo setcap 'CAP_NET_RAW+eip CAP_NET_ADMIN+eip' ./whatpulse

The following is the startup console log:

Code:
04-12-2014 10:16:33.061  INFO "Starting WhatPulse 2.4.1..."
04-12-2014 10:16:33.070  WARN "sni-qt/10748" WARN  10:16:33.070 void StatusNotifierItemFactory::connectToSnw() Invalid interface to SNW_SERVICE  
04-12-2014 10:16:33.070 DEBUG Database file:  "/home/user/.local/share/data/WhatPulse/whatpulse.db"
04-12-2014 10:16:33.081 DEBUG Database check:  "ok"
04-12-2014 10:16:33.082 DEBUG Opened database in:  12 ms
04-12-2014 10:16:33.088 DEBUG Found proper permissions for network monitoring
04-12-2014 10:16:33.088 DEBUG Encrypted file:  "/home/user/.local/share/data/WhatPulse/whatpulse.wpw"
04-12-2014 10:16:33.115 DEBUG Loaded application aliases
04-12-2014 10:16:33.115  WARN PF_PACKET is not available.
04-12-2014 10:16:33.117 DEBUG No pcap network devices found! Did you run the ChmodBPF script?
04-12-2014 10:16:33.117 DEBUG Fallback to ProcNetworkTrafficMonitor. Only interface statistics available.  
04-12-2014 10:16:33.157 DEBUG Opening GeoIP database:  "/home/user/.local/share/data/WhatPulse/GeoIP.dat"
04-12-2014 10:16:33.193 DEBUG WhatPulse  2.4.1  has started
04-12-2014 10:16:33.273  WARN Unable to find videocard in our database with vendor  "10DE" , device  "1381"  and subsys  "1458362E"
04-12-2014 10:16:33.387 DEBUG Starting timers and collector..
04-12-2014 10:16:33.389 DEBUG Creating device listener for "/dev/input/event0"
04-12-2014 10:16:33.389 DEBUG Creating device listener for "/dev/input/event1"
04-12-2014 10:16:33.389 DEBUG Creating device listener for "/dev/input/event10"
04-12-2014 10:16:33.390 DEBUG Creating device listener for "/dev/input/event11"
04-12-2014 10:16:33.390 DEBUG Creating device listener for "/dev/input/event12"
04-12-2014 10:16:33.391 DEBUG Creating device listener for "/dev/input/event13"
04-12-2014 10:16:33.391 DEBUG Creating device listener for "/dev/input/event14"
04-12-2014 10:16:33.391 DEBUG Creating device listener for "/dev/input/event15"
04-12-2014 10:16:33.391 DEBUG Creating device listener for "/dev/input/event2"
04-12-2014 10:16:33.391 DEBUG Creating device listener for "/dev/input/event3"
04-12-2014 10:16:33.392 DEBUG Creating device listener for "/dev/input/event4"
04-12-2014 10:16:33.392 DEBUG Creating device listener for "/dev/input/event5"
04-12-2014 10:16:33.393 DEBUG Creating device listener for "/dev/input/event6"
04-12-2014 10:16:33.393 DEBUG Creating device listener for "/dev/input/event7"
04-12-2014 10:16:33.393 DEBUG Creating device listener for "/dev/input/event8"
04-12-2014 10:16:33.393 DEBUG Creating device listener for "/dev/input/event9"
04-12-2014 10:17:03.709 DEBUG Version is up to date! Current:  "2.4.1"  - Latest:  "2.4.1"

So it appears that libpcap is properly installed, but cannot itself find the network device.

I have tried uninstalling and reinstalling all of the required packages several times, and have also tried different versions of whatpulse I could find (including old betas from the forums and 32 bit versions) without success.

Any thoughts? Thanks.
Find all posts by this user
Quote this message in a reply
12-05-2014, 07:12 PM
Post: #2
RE: Network data is measured but not pulsed
Have you installed the libpcap packages? On Linux the client basically tries 3 ways to get network info; pcap, pfring and finally getting the stats from /proc/ - The latter doesn't provide network stats that you can pulse, as the client can't tell the difference between local and internet traffic.

PCap is the most reliable, make sure you have that installed.
Visit this user's website Find all posts by this user
Quote this message in a reply
12-05-2014, 07:23 PM
Post: #3
RE: Network data is measured but not pulsed
Yes, I do have libpcap installed. And the whatpulse log shows that:

Code:
04-12-2014 10:16:33.117 DEBUG No pcap network devices found! Did you run the ChmodBPF script?
04-12-2014 10:16:33.117 DEBUG Fallback to ProcNetworkTrafficMonitor. Only interface statistics available.

When I have tried uninstalling/reinstalling libpcap, this section changes, noting that libpcap is not found.

Here is what I have installed:

Code:
$ dpkg --get-selections | grep pcap
libpcap-dev                    install
libpcap0.8:amd64                install
libpcap0.8-dev                    install
libpcapnav0                    install
pcaputils                    install

Also, something I just tried, if I run whatpulse with sudo, my network card is detected by libpcap and network traffic IS added to unpulsed. However, it is not measured correctly. For instance, if I transfer a 100 mb file while running whatpulse as superuser, only ~10 mb gets measured and added to unpulsed. Running it normally, the full 100 mb is measured, but none is added to unpulsed.
Find all posts by this user
Quote this message in a reply
12-05-2014, 07:43 PM
Post: #4
RE: Network data is measured but not pulsed
You shouldn't run it as root anyway, so never mind the discrepancy. ;-)

So it detects that setcap has been properly run, it detects pcap but cannot list any interfaces with pcap. Do you have any strict permission stuff set up, something like that selinux pain in the butt?

There's not really another reason why pcap would not turn up with any interfaces, if the client sees the library and can use it, besides when it's being blocked from it.
Visit this user's website Find all posts by this user
Quote this message in a reply
12-05-2014, 08:06 PM
Post: #5
RE: Network data is measured but not pulsed
Nope, I don't have SELinux installed.

Interestingly, when I run this simple test:

Code:
#include <stdio.h>
#include <pcap.h>

int main(int argc, char *argv[]) {
    char *dev, errbuf[PCAP_ERRBUF_SIZE];

    dev = pcap_lookupdev(errbuf);
    if(dev == NULL) {
        printf("Error: %s\n", errbuf);
        return(2);
    }

    printf("Device: %s\n", dev);
    return(0);
}

I only find a device when using sudo, even when running setcap first (and getcap confirms the capabilities are set).
Find all posts by this user
Quote this message in a reply
02-27-2015, 03:24 PM
Post: #6
RE: [Linux] Network data is measured but not pulsed
I had this issue for quite some time before I eventually figured out what I had missed. In my case I have filesystems which are writable by regular users mounted with the nosuid mount option, a wise security precaution given the obvious potential risk of allowing unprivileged accounts to have the possibility to modify an suid executable.

I failed to realize that the nosuid mount option covers the grant of limited root privileges through file capabilities also. This was not initially obvious given the option still has it's historic nosuid name but when considering that file capabilities were created as an improved way of granting special privileges to certain executables without having to grant full root extending the option to cover these does make sense.

You can easily check if this is the problem you are having by typing the following command from the directory where you have whatpulse installed:
Code:
cat /proc/mounts | grep -P "\s$(stat --format=%m ./whatpulse)\s"

You should get a line of output like this showing the block device node, mount point, filesystem type and mount options
Code:
/dev/mapper/vg-home /home ext4 rw,nosuid,resuid=1000,resgid=100,commit=600,stripe=256,data=ordered 0 0

If you see nosuid in the last column there like in this case then you will not be able to use file capabilities to grant the CAP_NET_ADMIN and CAP_NET_RAW capabilities correctly. If this is the case for you I would recommend leaving the file system mount options alone as there is good reason to not allow suid on user writable portions of the file system.

The best solution would be to install whatpulse to the system binaries path either in /bin or probably better in /usr/bin both of these locations contain other suid or setcap executables on a typical desktop system (eg /bin/ping, /bin/passwd, /usr/bin/cdrecord, /usr/bin/gpasswd).

To install whatpulse into /usr/bin with the proper permissions and capabilities:
Code:
sudo mv ./whatpulse /usr/bin
sudo chown root.root /usr/bin/whatpulse
sudo chmod 755 /usr/bin/whatpulse
sudo setcap 'CAP_NET_ADMIN,CAP_NET_RAW=ep' /usr/bin/whatpulse
ln -s /usr/bin/whatpulse .
Find all posts by this user
Quote this message in a reply
04-20-2015, 11:49 AM
Post: #7
RE: [Linux] Network data is measured but not pulsed
(02-27-2015 03:24 PM)MttJocy Wrote:  To install whatpulse into /usr/bin with the proper permissions and capabilities:

Many thanks! I had the client running from inside my home dir and your solution fixed it for me.

Smile
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  [SOLVED] Can't run the Linux version [Driver not loaded Driver not loaded] radioz 2 761 06-20-2019 11:54 AM
Last Post: radioz
  Exporting Mouse Data MrSquid360 0 163 06-01-2019 03:04 AM
Last Post: Nathan.Li
  WhatPulse not opening on Manjaro Linux (Arch distro) tboxley 4 582 05-26-2019 11:30 AM
Last Post: FamilienVater
  [SOLVED] Error uploading keyboard/mouse heatmap Wopian 2 640 03-17-2017 12:26 PM
Last Post: Wopian
  [SOLVED] [postmortem] Pulse error: "The specified configuration cannot be used." dgw 4 1,328 03-03-2017 09:54 PM
Last Post: dgw
  Incorrect Network Upload/Download cahern7 11 3,026 11-21-2016 07:13 PM
Last Post: smitmartijn
  [SOLVED] Client crashes on startup v. 2.7 Win10x64 Lttngblt 11 2,448 10-08-2016 06:43 PM
Last Post: smitmartijn
  [SOLVED] OS X no longer starts, crashes on startup stuthemonkey 3 878 10-01-2016 06:34 PM
Last Post: smitmartijn
  [SOLVED] Best solution for delaying whatpulse until after panel loads fennectech 1 886 09-15-2016 03:36 AM
Last Post: smitmartijn
  [CLOSED] Network traffic not recorded on Ubuntu 16.04 LTS GnaXi 4 1,406 09-15-2016 03:33 AM
Last Post: smitmartijn

Forum Jump:


User(s) browsing this thread: 1 Guest(s)