mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-13 08:26:37 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
af250824f7 | ||
|
|
7f57491fac | ||
|
|
890fdc2996 | ||
|
|
d1a807840c |
10
.promu.yml
10
.promu.yml
@@ -4,11 +4,11 @@ build:
|
|||||||
binaries:
|
binaries:
|
||||||
- name: wmi_exporter
|
- name: wmi_exporter
|
||||||
ldflags: |
|
ldflags: |
|
||||||
-X {{repoPath}}/vendor/github.com/prometheus/common/version.Version={{.Version}}
|
-X github.com/prometheus/common/version.Version={{.Version}}
|
||||||
-X {{repoPath}}/vendor/github.com/prometheus/common/version.Revision={{.Revision}}
|
-X github.com/prometheus/common/version.Revision={{.Revision}}
|
||||||
-X {{repoPath}}/vendor/github.com/prometheus/common/version.Branch={{.Branch}}
|
-X github.com/prometheus/common/version.Branch={{.Branch}}
|
||||||
-X {{repoPath}}/vendor/github.com/prometheus/common/version.BuildUser={{user}}@{{host}}
|
-X github.com/prometheus/common/version.BuildUser={{user}}@{{host}}
|
||||||
-X {{repoPath}}/vendor/github.com/prometheus/common/version.BuildDate={{date "20060102-15:04:05"}}
|
-X github.com/prometheus/common/version.BuildDate={{date "20060102-15:04:05"}}
|
||||||
tarball:
|
tarball:
|
||||||
files:
|
files:
|
||||||
- LICENSE
|
- LICENSE
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ type Win32_ComputerSystem struct {
|
|||||||
TotalPhysicalMemory uint64
|
TotalPhysicalMemory uint64
|
||||||
DNSHostname string
|
DNSHostname string
|
||||||
Domain string
|
Domain string
|
||||||
Workgroup string
|
Workgroup *string
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *CSCollector) collect(ch chan<- prometheus.Metric) (*prometheus.Desc, error) {
|
func (c *CSCollector) collect(ch chan<- prometheus.Metric) (*prometheus.Desc, error) {
|
||||||
@@ -93,7 +93,7 @@ func (c *CSCollector) collect(ch chan<- prometheus.Metric) (*prometheus.Desc, er
|
|||||||
)
|
)
|
||||||
|
|
||||||
var fqdn string
|
var fqdn string
|
||||||
if dst[0].Domain != dst[0].Workgroup {
|
if dst[0].Workgroup == nil || dst[0].Domain != *dst[0].Workgroup {
|
||||||
fqdn = dst[0].DNSHostname + "." + dst[0].Domain
|
fqdn = dst[0].DNSHostname + "." + dst[0].Domain
|
||||||
} else {
|
} else {
|
||||||
fqdn = dst[0].DNSHostname
|
fqdn = dst[0].DNSHostname
|
||||||
|
|||||||
Reference in New Issue
Block a user