systemd-report-diskspace@.service
systemd
systemd-report-diskspace@.service
8
systemd-report-diskspace@.service
systemd-report-diskspace.socket
systemd-report-diskspace
Report size and free disk space of mounted file systems as system report metrics
systemd-report-diskspace@.service
systemd-report-diskspace.socket
/usr/lib/systemd/systemd-report-diskspace
Description
systemd-report-diskspace@.service is a metrics source for systemd-report(1). It reports the size of the mounted file systems and how much disk space is still available on them, by implementing the io.systemd.Metrics Varlink interface on a socket linked into the /run/systemd/report/ directory.
All mount points of the system are enumerated. Mount points of file systems that are not backed by a block device (i.e. pseudo file systems such as proc, sysfs or tmpfs, network file systems, overlay, …) are skipped, as are read-only mount points. For each remaining mount point two gauge metrics are reported, with the mount point path as metric object:
io.systemd.DiskSpace.SizeBytes
The total size of the file system, in bytes. This matches the 1K-blocks column of df(1) (scaled to bytes).
io.systemd.DiskSpace.FreeBytes
The disk space still available to unprivileged users on the file system, in bytes. This matches the Avail column of df(1), i.e. space reserved for the superuser (as many file systems do) is not counted as free.
The following metric fields are set on both metrics:
fileSystemType
The file system type, for example ext4 or btrfs. Always set.
source
The mount source, typically the device node the file system is mounted from, for example /dev/sda1. Omitted if unknown.
originatingSource
If the block device the file system is mounted from is a stacked one (for example a LUKS or other device mapper volume), the device node of the block device it ultimately originates from, for example /dev/sda2 for a file system mounted from /dev/mapper/root. Omitted if the source is not a stacked block device, or its origin cannot be determined. Note that stacked devices backed by multiple block devices (e.g. RAID) are not covered by this.
A file system that is mounted multiple times (for example via bind mounts, or as multiple subvolumes of the same volume) is reported only once, under the shortest of its mount point paths (and among equally long ones, the alphabetically first). Mount points that are shadowed by another mount on top of them, or that the service cannot access, are not considered.
See Also
systemd(1), systemd-report(1), df(1), statfs(2)
谢谢你的反馈!