Bug#878890: netdata: Debian pachaged netdata fails to detect disks/partitions correctly

2017-10-17 Thread Skibbi
Package: netdata
Version: 1.8.0+dfsg-1
Severity: normal

Dear Maintainer,
I've been trying to setup netdata monitoring on several debian servers.
Unfortunately I found out that debian packaged netdata behaves differently 
than manually installed netdata from 
https://github.com/firehol/netdata/wiki/Installation.

I've created a virtual machine and installed latest netdata with default config.
Here are partition details of the virtual machine:

~# cat /proc/self/mountinfo
17 22 0:17 / /sys rw,nosuid,nodev,noexec,relatime shared:7 - sysfs sysfs rw
18 22 0:4 / /proc rw,nosuid,nodev,noexec,relatime shared:12 - proc proc rw
19 22 0:6 / /dev rw,nosuid,relatime shared:2 - devtmpfs udev 
rw,size=1005780k,nr_inodes=251445,mode=755
20 19 0:18 / /dev/pts rw,nosuid,noexec,relatime shared:3 - devpts devpts 
rw,gid=5,mode=620,ptmxmode=000
21 22 0:19 / /run rw,nosuid,noexec,relatime shared:5 - tmpfs tmpfs 
rw,size=203384k,mode=755
22 0 8:1 / / rw,relatime shared:1 - ext4 /dev/sda1 
rw,errors=remount-ro,data=ordered
23 17 0:16 / /sys/kernel/security rw,nosuid,nodev,noexec,relatime shared:8 - 
securityfs securityfs rw
24 19 0:20 / /dev/shm rw,nosuid,nodev shared:4 - tmpfs tmpfs rw
25 21 0:21 / /run/lock rw,nosuid,nodev,noexec,relatime shared:6 - tmpfs tmpfs 
rw,size=5120k
26 17 0:22 / /sys/fs/cgroup ro,nosuid,nodev,noexec shared:9 - tmpfs tmpfs 
ro,mode=755
27 26 0:23 / /sys/fs/cgroup/systemd rw,nosuid,nodev,noexec,relatime shared:10 - 
cgroup cgroup 
rw,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd
28 17 0:24 / /sys/fs/pstore rw,nosuid,nodev,noexec,relatime shared:11 - pstore 
pstore rw
29 26 0:25 / /sys/fs/cgroup/cpu,cpuacct rw,nosuid,nodev,noexec,relatime 
shared:13 - cgroup cgroup rw,cpu,cpuacct
30 26 0:26 / /sys/fs/cgroup/blkio rw,nosuid,nodev,noexec,relatime shared:14 - 
cgroup cgroup rw,blkio
31 26 0:27 / /sys/fs/cgroup/net_cls,net_prio rw,nosuid,nodev,noexec,relatime 
shared:15 - cgroup cgroup rw,net_cls,net_prio
32 26 0:28 / /sys/fs/cgroup/perf_event rw,nosuid,nodev,noexec,relatime 
shared:16 - cgroup cgroup rw,perf_event
33 26 0:29 / /sys/fs/cgroup/pids rw,nosuid,nodev,noexec,relatime shared:17 - 
cgroup cgroup rw,pids
34 26 0:30 / /sys/fs/cgroup/memory rw,nosuid,nodev,noexec,relatime shared:18 - 
cgroup cgroup rw,memory
35 26 0:31 / /sys/fs/cgroup/cpuset rw,nosuid,nodev,noexec,relatime shared:19 - 
cgroup cgroup rw,cpuset
36 26 0:32 / /sys/fs/cgroup/devices rw,nosuid,nodev,noexec,relatime shared:20 - 
cgroup cgroup rw,devices
37 26 0:33 / /sys/fs/cgroup/freezer rw,nosuid,nodev,noexec,relatime shared:21 - 
cgroup cgroup rw,freezer
38 18 0:34 / /proc/sys/fs/binfmt_misc rw,relatime shared:22 - autofs systemd-1 
rw,fd=27,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=11032
40 17 0:7 / /sys/kernel/debug rw,relatime shared:23 - debugfs debugfs rw
39 19 0:35 / /dev/hugepages rw,relatime shared:24 - hugetlbfs hugetlbfs rw
41 19 0:15 / /dev/mqueue rw,relatime shared:25 - mqueue mqueue rw
188 38 0:39 / /proc/sys/fs/binfmt_misc rw,relatime shared:107 - binfmt_misc 
binfmt_misc rw
221 17 0:41 / /sys/fs/fuse/connections rw,relatime shared:144 - fusectl fusectl 
rw
179 21 0:40 / /run/user/1000 rw,nosuid,nodev,relatime shared:140 - tmpfs tmpfs 
rw,size=203380k,mode=700,uid=1000,gid=1000

Manually installed netdata (from binaries) displays following partitions under 
Disks menu:
sda   - i/o stats
/ - disk space and inodes count
/dev  - disk space and inodes count
/dev/shm  - disk space and inodes count
/run  - disk space and inodes count
/run/lock - disk space and inodes count

Debian packaged netdata displays completely different partition configuration:
sda   - i/o stats
/tmp  - disk space and inodes count
/var  - disk space and inodes count
/var/tmp  - disk space and inodes count

Debian packaged netdata unfortunately fails to detect correctly disks on my 
servers therefore monitoring them is not very reliable and I haven't found a way
to fix the partitions manually in netdata config.

-- System Information:
Debian Release: buster/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.13.0-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=pl_PL.UTF-8, LC_CTYPE=pl_PL.UTF-8 (charmap=UTF-8), 
LANGUAGE=pl_PL.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages netdata depends on:
ii  adduser  3.116
ii  init-system-helpers  1.50
ii  libc62.24-17
ii  libcap2-bin  1:2.25-1.1
ii  libuuid1 2.30.2-0.1
ii  lsb-base 9.20170808
ii  netdata-data 1.8.0+dfsg-1
ii  python   2.7.14-1
ii  python-urllib3   1.21.1-1
ii  python-yaml  3.12-1+b1
ii  zlib1g   1:1.2.8.dfsg-5

Versions of packages netdata recommends:
ii  curl7.55.1-1
pn  fping   
pn  nodejs  

netdata suggests no packages.

-- Configuration Files:
/etc/netdata/netdata.conf changed [not included]

Bug#878890: netdata: Debian pachaged netdata fails to detect disks/partitions correctly

2017-10-24 Thread Lennart Weller
I assume it has something to do with our strict ReadOnly policy applied by 
systemd.
Try changing the netdata service file (/lib/systemd/system/netdata.service) to 
be more lenient.
e.g. Change ReadOnlyDirectories=/ to ReadWriteDirectories=/ or remove the lines 
completely. Don't forget to reload the service file after a change

I have honestly no idea why the daemon would need write permissions on those 
directories but it's worth a try as there were some odd cases before.
If that doesn't help you can remove some of the other security related lines 
and check if it helps.

October 17, 2017 3:48 PM, "Skibbi"  wrote:
[...]
> Manually installed netdata (from binaries) displays following partitions 
> under 
> Disks menu:
> sda - i/o stats
> / - disk space and inodes count
> /dev - disk space and inodes count
> /dev/shm - disk space and inodes count
> /run - disk space and inodes count
> /run/lock - disk space and inodes count
> 
> Debian packaged netdata displays completely different partition configuration:
> sda - i/o stats
> /tmp - disk space and inodes count
> /var - disk space and inodes count
> /var/tmp - disk space and inodes count
> 
> Debian packaged netdata unfortunately fails to detect correctly disks on my 
> servers therefore monitoring them is not very reliable and I haven't found a 
> way
> to fix the partitions manually in netdata config.



Bug#878890: netdata: Debian pachaged netdata fails to detect disks/partitions correctly

2017-10-24 Thread Skibbi
Hi,
That was it! After commenting out ReadOnlyDirectories=/ netdata started
reporting correct disks/partitions. I guess this issue should be discussed
on netdata github issue tracker.

Thanks for pointig this out.

2017-10-24 14:28 GMT+02:00 Lennart Weller :

> I assume it has something to do with our strict ReadOnly policy applied by
> systemd.
> Try changing the netdata service file (/lib/systemd/system/netdata.service)
> to be more lenient.
> e.g. Change ReadOnlyDirectories=/ to ReadWriteDirectories=/ or remove the
> lines completely. Don't forget to reload the service file after a change
>
> I have honestly no idea why the daemon would need write permissions on
> those directories but it's worth a try as there were some odd cases before.
> If that doesn't help you can remove some of the other security related
> lines and check if it helps.
>
> October 17, 2017 3:48 PM, "Skibbi"  wrote:
> [...]
> > Manually installed netdata (from binaries) displays following partitions
> under
> > Disks menu:
> > sda - i/o stats
> > / - disk space and inodes count
> > /dev - disk space and inodes count
> > /dev/shm - disk space and inodes count
> > /run - disk space and inodes count
> > /run/lock - disk space and inodes count
> >
> > Debian packaged netdata displays completely different partition
> configuration:
> > sda - i/o stats
> > /tmp - disk space and inodes count
> > /var - disk space and inodes count
> > /var/tmp - disk space and inodes count
> >
> > Debian packaged netdata unfortunately fails to detect correctly disks on
> my
> > servers therefore monitoring them is not very reliable and I haven't
> found a way
> > to fix the partitions manually in netdata config.
>