prometheus-node-exporter-lua: Disk space metric
Open
@champtar is already working on this.
Since Dec 29, 2020.
- Dominant language
- Makefile
- Stars
- 4.6k
- Forks
- 4k
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 134
Description
Maintainer: @champtar
Environment: all arch/versions
Description:
To get the disk size and available space please add this code to
/usr/lib/lua/prometheus-collectors/disk.lua
local function scrape()
local df = io.popen("df -T")
local line = df:read("*l")
line = df:read("*l")
while (line ~= nil)
do
local size = space_split(line)[3] * 1024
local available = space_split(line)[5] * 1024
local labels = {
fstype = space_split(line)[2],
mountpoint = space_split(line)[7]
}
metric("node_filesystem_avail_bytes", "gauge", labels, available)
metric("node_filesystem_size_bytes", "gauge", labels, size)
line = df:read("*l")
end
df:close()
end
return { scrape = scrape }
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.