Netdata Community

Why diskspace.plugin is not activated?

Hi,

diskspace defaults:

[plugin:proc:diskspace]
	# remove charts of unmounted disks = yes
	# update every = 1
	# check for new mount points every = 15
	# exclude space metrics on paths = /proc/* /sys/* /var/run/user/* /run/user/* /snap/* /var/lib/docker/*
	# exclude space metrics on filesystems = *gvfs *gluster* *s3fs *ipfs *davfs2 *httpfs *sshfs *gdfs *moosefs fusectl autofs
	# space usage for all disks = auto
	# inodes usage for all disks = auto

My mount point is not in exclude list:

[plugin:proc:diskspace:/var/lib/ceph/mon]
	# space usage = no
	# inodes usage = no

Any reason why auto is not cover this mount point?

mount is:

/dev/nvme0n1p1 on /var/lib/ceph/mon type xfs (rw,relatime,attr2,inode64,noquota)

Maybe @ilyam8 knows?

Hi. I doesn’t looks like your path/fs matches the patterns.

Let’s check error.log

  • restart netdata.service
  • grep DISKSPACE error.log

Found it,

Mar 12 14:19:42 netdata[10434]: 2021-03-12 14:19:42: netdata ERROR : PLUGIN[diskspace] : DISKSPACE: Cannot stat() mount point '/var/lib/ceph/mon' (disk '_var_lib_ceph_mon', filesystem 'xfs', root '/'). (errno 13, Permission denied)

I was’t thinking this may be permission issue…

[root@ceph-mon0 k0ste]# sudo -u netdata df  -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        7.8G     0  7.8G   0% /dev
tmpfs           7.8G     0  7.8G   0% /dev/shm
tmpfs           7.8G  620K  7.8G   1% /run
tmpfs           7.8G     0  7.8G   0% /sys/fs/cgroup
/dev/sda1        30G  6.9G   23G  24% /
/dev/nvme0n1p1  373G  129M  373G   1% /var/lib/ceph/mon
tmpfs           1.6G     0  1.6G   0% /run/user/1153

It is possible to resolve this without adding netdata to ceph group? Via sudoers, or?

Current stat for this mount point:

  File: ‘/var/lib/ceph/mon’
  Size: 28              Blocks: 0          IO Block: 4096   directory
Device: 10301h/66305d   Inode: 64          Links: 3
Access: (0755/drwxr-xr-x)  Uid: (  167/    ceph)   Gid: (  167/    ceph)
Access: 2021-03-10 20:51:39.636746195 +0700
Modify: 2020-09-13 16:55:20.168068668 +0700
Change: 2020-09-13 16:55:20.168068668 +0700
 Birth: -

Cannot stat() mount point

I see we need execute/search permissions.

If you don’t want to add netdata to ceph group, i don’t know, no a specialist. Perhaps using file access control list will do. I see we suggest to use it for filecheck collector if there are any permission issues.

Thanks,

I figured out that stat() is not used ACL

# file: testdir/
# owner: ceph
# group: ceph
user::rwx
user:netdata:r--
group::r-x
mask::r-x
other::r-x
stat: cannot stat ‘testdir’: Permission denied

I see solution for this - use stat with root privileges, this method is implemented in samba plugin. Feature request?

I am not sure it is possible. cc @vlvkobal

The only way to do that is to rewrite the plugin as an external one.

@k0ste

Are you sure that

The plugin requires Netdata to have execute/search permissions on the mount point itself, as well as each component of the absolute path to the mount point.

is reflected in ?

user::rwx
user:netdata:r–
group::r-x
mask::r-x
other::r-x

We can try… But I don’t think is a good idea, cause full path was created by package, so can be overwritten in future. In this case adding netdata to group looks better IMO.