Merge pull request #84 from k0ste/help2

Added disk form_factor meta label
This commit is contained in:
Ben Kochie 2022-10-20 11:31:01 +01:00 committed by GitHub
commit 2099be1e2c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 500 additions and 731 deletions

1227
EXAMPLE.md

File diff suppressed because it is too large Load diff

View file

@ -91,7 +91,7 @@ func main() {
kingpin.Parse() kingpin.Parse()
logger := promlog.New(promlogConfig) logger := promlog.New(promlogConfig)
level.Info(logger).Log("msg", "Starting systemd_exporter", "version", version.Info()) level.Info(logger).Log("msg", "Starting smartctl_exporter", "version", version.Info())
level.Info(logger).Log("msg", "Build context", "build_context", version.BuildContext()) level.Info(logger).Log("msg", "Build context", "build_context", version.BuildContext())
devices := *smartctlDevices devices := *smartctlDevices

View file

@ -43,6 +43,7 @@ var (
"firmware_version", "firmware_version",
"ata_version", "ata_version",
"sata_version", "sata_version",
"form_factor",
}, },
nil, nil,
) )

View file

@ -109,6 +109,7 @@ func (smart *SMARTctl) mineDevice() {
smart.json.Get("firmware_version").String(), smart.json.Get("firmware_version").String(),
smart.json.Get("ata_version.string").String(), smart.json.Get("ata_version.string").String(),
smart.json.Get("sata_version.string").String(), smart.json.Get("sata_version.string").String(),
smart.json.Get("form_factor.name").String(),
) )
} }