Fix missing device name

- now is "missing" instead of an empty string
- this is triggered e.g. when mounting degraded mode. In normal
  operation it shouldn't happen
- Fixes #1
This commit is contained in:
Peter Šurda 2023-11-24 14:04:18 +08:00
parent 4dae2cd4dc
commit 587877e5db
Signed by untrusted user: PeterSurda
GPG Key ID: 3E47497CF67ABB95

View File

@ -22,6 +22,8 @@ def read_callback():
r'[^a-zA-Z0-9]', r'[^a-zA-Z0-9]',
r'-', r'-',
dev_info.path)[1:] dev_info.path)[1:]
if not metric.plugin_instance:
metric.plugin_instance = "missing"
for counter, value in stats.counters.items(): for counter, value in stats.counters.items():
metric.type_instance = counter metric.type_instance = counter
metric.dispatch(TYPE_STATS, [value], interval=INTERVAL) metric.dispatch(TYPE_STATS, [value], interval=INTERVAL)