mirror of
https://github.com/prometheus-community/smartctl_exporter.git
synced 2024-11-16 01:33:07 +01:00
skip vendor-specific statistics that lead to duplicate metric labels
fixes #3 Signed-off-by: Jakub Klinkovský <j.l.k@gmx.com>
This commit is contained in:
parent
d3d5180048
commit
e10ded530f
1 changed files with 5 additions and 0 deletions
|
@ -330,6 +330,11 @@ func (smart *SMARTctl) mineSmartStatus() {
|
||||||
func (smart *SMARTctl) mineDeviceStatistics() {
|
func (smart *SMARTctl) mineDeviceStatistics() {
|
||||||
for _, page := range smart.json.Get("ata_device_statistics.pages").Array() {
|
for _, page := range smart.json.Get("ata_device_statistics.pages").Array() {
|
||||||
table := strings.TrimSpace(page.Get("name").String())
|
table := strings.TrimSpace(page.Get("name").String())
|
||||||
|
// skip vendor-specific statistics (they lead to duplicate metric labels on Seagate Exos drives,
|
||||||
|
// see https://github.com/Sheridan/smartctl_exporter/issues/3 for details)
|
||||||
|
if table == "Vendor Specific Statistics" {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
for _, statistic := range page.Get("table").Array() {
|
for _, statistic := range page.Get("table").Array() {
|
||||||
smart.ch <- prometheus.MustNewConstMetric(
|
smart.ch <- prometheus.MustNewConstMetric(
|
||||||
metricDeviceStatistics,
|
metricDeviceStatistics,
|
||||||
|
|
Loading…
Reference in a new issue