mirror of
https://github.com/prometheus-community/smartctl_exporter.git
synced 2024-11-23 01:43:07 +01:00
Ignore format
Filter regex with the following string format "name=<deviceName>;type=<deviceType>;protocol=<deviceProtocol>" Signed-off-by: tekert <tekert@gmail.com>
This commit is contained in:
parent
43abcf3728
commit
86c7aef620
1 changed files with 3 additions and 1 deletions
4
main.go
4
main.go
|
@ -93,7 +93,9 @@ func scanDevices(logger log.Logger) []string {
|
|||
deviceName := d.Get("name").String()
|
||||
deviceType := d.Get("type").String()
|
||||
deviceProtocol := d.Get("protocol").String()
|
||||
if filter.ignored(deviceName) || filter.ignored(deviceType) || filter.ignored(deviceProtocol) {
|
||||
// filter schema "name=<deviceName>;type=<deviceType>;protocol=<deviceProtocol>"
|
||||
device := "name=" + deviceName + ";type=" + deviceType + ";protocol=" + deviceProtocol
|
||||
if filter.ignored(device) {
|
||||
level.Info(logger).Log("msg", "Ignoring device", "name", deviceName, "type", deviceType, "protocol", deviceProtocol)
|
||||
} else {
|
||||
level.Info(logger).Log("msg", "Found device", "name", deviceName, "type", deviceType, "protocol", deviceProtocol)
|
||||
|
|
Loading…
Reference in a new issue