[英]collectd's df plugin reporting wrong free space in /home
I'm using Librato's collectd, version 5.5, in machines running Ubuntu 16.04 to collect
usage metrics. 我在运行Ubuntu 16.04的计算机中使用Librato的
collect
版本5.5,以collect
使用情况指标。 However, in one of my clusters, I cannot make df
plugin report all space available for /
and /home
. 但是,在我的一个集群中,我无法使
df
插件报告/
和/home
可用的所有空间。
As you can see, these mount points are in different ext4
partitions. 如您所见,这些安装点位于不同的
ext4
分区中。 I expected it to report both 17G and 1.7T available for /
and /home
respectively. 我希望它会报告分别用于
/
和/home
17G和1.7T。 Although I correctly receive the space associated to /
, it reports about 4GB for /home
. 尽管我正确地收到了与
/
相关的空间,但它报告了/home
大约4GB的空间。
$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 20G 1.4G 17G 8% /
devtmpfs 3.9G 0 3.9G 0% /dev
tmpfs 3.9G 0 3.9G 0% /dev/shm
tmpfs 3.9G 125M 3.8G 4% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/sda3 1.8T 8.9G 1.7T 1% /home
tmpfs 789M 0 789M 0% /run/user/0
$ cat /etc/fstab
# <file system> <mount point> <type> <options> <dump> <pass>
/dev/sda2 / ext4 errors=remount-ro,relatime 0 1
/dev/sda3 /home ext4 defaults,relatime 1 2
/dev/sda4 swap swap defaults 0 0
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
devtmpfs /dev devtmpfs rw 0 0
Here is my current configuration regarding df: 这是我当前关于df的配置:
<Plugin "df">
MountPoint "/"
MountPoint "/home"
</Plugin>
...
LoadPlugin "match_regex"
<Chain "PostCache">
<Rule "ignore_df_reserved_used_metrics">
<Match "regex">
Plugin "^df"
TypeInstance "^(reserved|used)"
</Match>
Target "stop"
</Rule>
# Default behavior
Target "write"
</Chain>
I've tried several combinations of configurations (as well as reading the df
plugin docs over and over again) and when using only FSType as below, I receive several measurements ( usr
, boot
, bin
, lib
, lib64
, root
...), all reporting the same size of about 17G
. 我已经尝试了几种配置组合(以及一遍又一遍地阅读
df
插件文档),并且当仅使用FSType时,如下所示,我收到了几种测量值( usr
, boot
, bin
, lib
, lib64
, root
...) ,所有报告的相同大小约为17G
。 Also, there was no measurement for home
. 另外,没有
home
尺寸。
<Plugin df>
FSType "ext4"
</Plugin>
I've also tried using FSType with MountPoint "/"
, but only root
was reported then. 我也尝试过将FSType与MountPoint
MountPoint "/"
,但那时只报告了root
。
My last attempt was using Device
in the configuration, but it didn't change anything. 我的最后一次尝试是在配置中使用
Device
,但没有任何改变。
<Plugin "df">
Device "/dev/sda2"
Device "/dev/sda3"
MountPoint "/"
MountPoint "/home"
FSType "ext4"
IgnoreSelected false
ReportInodes false
</Plugin>
In all attempts, collectd
doesn't show any error on its log: 在所有尝试中,
collectd
在其日志中均未显示任何错误:
[2017-01-13 17:06:15] Exiting normally.
[2017-01-13 17:06:15] collectd: Stopping 5 read threads.
[2017-01-13 17:06:15] collectd: Stopping 5 write threads.
[2017-01-13 17:06:15] supervised by systemd, will signal readyness
[2017-01-13 17:06:15] Initialization complete, entering read-loop.
Do you have any suggestions on what to do? 您对做什么有建议?
It turns out that probably collectd had this bug fixed in their last version , 5.7, which isn't available in Ubuntu 16.04 apt-get
yet. 事实证明,可能收集的这个错误已在其最新版本 5.7中修复 ,而该版本在Ubuntu 16.04
apt-get
尚不可用。 By downloading and installing their latest nightly build , df
started reporting the correct values. 通过下载并安装其最新的夜间版本 ,
df
开始报告正确的值。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.