I am trying to find out if anyone has a fix for “fping should have CAP_NET_RAW” errors in the ./validate.php. I am running ubuntu server 16.04 for the host with all the latest updates. I have tired the fix commands listed in the output but getting error “Failed to set capabilities on file `/usr/bin/fping’ (Invalid argument)
The value of the capability argument is not permitted for a file. Or the file is not a regular (non-symlink) file”.
Sorry for the delay, So I have fping installed at the time of posting this.
root@nms:~# apt-get install fping
Reading package lists… Done
Building dependency tree
Reading state information… Done
fping is already the newest version (3.13-1).
I’ve found a workaround, but not really a solution.
The issues I think is with Linux Containers, I have the issue using ext4 and btrfs as the container storage, hosting out of Ubuntu 17.04 on Hyper-V, VirtualBox, and directly on metal. Once the machine is in a container, the issue appears.
Anyway, in short; run setcap on the host VM against the file inside the container; roughly as follows:
root@vm-host:~# lxc exec librenms -- /bin/bash
root@librenms:~# getcap /usr/bin/fping
root@librenms:~# setcap CAP_NET_RAW+ep /usr/bin/fping
Failed to set capabilities on file `/usr/bin/fping' (Invalid argument)
The value of the capability argument is not permitted for a file. Or the file is not a regular (non-symlink) file
root@librenms:~# exit
root@vm-host:~# cd /var/lib/lxd/containers/librenms/rootfs/
root@vm-host:/var/lib/lxd/containers/librenms/rootfs# setcap cap_net_raw+ep ./usr/bin/fping
root@vm-host:/var/lib/lxd/containers/librenms/rootfs# lxc exec librenms -- /bin/bash
root@librenms:~# getcap /usr/bin/fping
/usr/bin/fping = cap_net_raw+ep
maybe use try a “apt-get update && apt remove fping && apt install fping” and check for error messages on install. my container-based installs all say they can’t run the “setcap” commands, but it still installs the binaries.