mirror of
https://github.com/prometheus-community/smartctl_exporter.git
synced 2024-11-16 01:33:07 +01:00
Device Exlude also filters types and protocols.
Make regex also search inside a device type and protocol fields instead of a hardware name that can change on hardware change/reset. Signed-off-by: tekert <tekert@gmail.com>
This commit is contained in:
parent
895bf1eeb3
commit
43abcf3728
1 changed files with 5 additions and 3 deletions
8
main.go
8
main.go
|
@ -91,10 +91,12 @@ func scanDevices(logger log.Logger) []string {
|
|||
var scanDeviceResult []string
|
||||
for _, d := range scanDevices {
|
||||
deviceName := d.Get("name").String()
|
||||
if filter.ignored(deviceName) {
|
||||
level.Info(logger).Log("msg", "Ignoring device", "name", deviceName)
|
||||
deviceType := d.Get("type").String()
|
||||
deviceProtocol := d.Get("protocol").String()
|
||||
if filter.ignored(deviceName) || filter.ignored(deviceType) || filter.ignored(deviceProtocol) {
|
||||
level.Info(logger).Log("msg", "Ignoring device", "name", deviceName, "type", deviceType, "protocol", deviceProtocol)
|
||||
} else {
|
||||
level.Info(logger).Log("msg", "Found device", "name", deviceName)
|
||||
level.Info(logger).Log("msg", "Found device", "name", deviceName, "type", deviceType, "protocol", deviceProtocol)
|
||||
scanDeviceResult = append(scanDeviceResult, deviceName)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue