docs(inputs.upsd): Document pitfalls (#14938)

This commit is contained in:
Sven Rebhan 2024-03-05 17:17:21 +01:00 committed by GitHub
parent 31f70e6290
commit ccf697ed7e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 25 additions and 2 deletions

View File

@ -1,11 +1,11 @@
# UPSD Input Plugin
This plugin reads data of one or more Uninterruptible Power Supplies
from an upsd daemon using its NUT network protocol.
from an `upsd` daemon using its NUT network protocol.
## Requirements
upsd should be installed and it's daemon should be running.
`upsd` should be installed and it's daemon should be running.
## Global configuration options <!-- @/docs/includes/plugin_config.md -->
@ -48,6 +48,29 @@ See the [CONFIGURATION.md][CONFIGURATION.md] for more details.
# dump_raw_variables = false
```
## Pitfalls
Please note that field types are automatically determined based on the values.
Especially the strings `enabled` and `disabled` are automatically converted to
`boolean` values. This might lead to trouble for fields that can contain
non-binary values like `enabled`, `disabled` and `muted` as the output field
will be `boolean` for the first two values but `string` for the latter. To
convert `enabled` and `disabled` values back to `string` for those fields, use
the [enum processor][enum_processor] with
```toml
[[processors.enum]]
[[processors.enum.mapping]]
field = "ups_beeper_status"
[processors.enum.mapping.value_mappings]
true = "enabled"
false = "disabled"
```
Alternatively, you can also map the non-binary value to a `boolean`.
[enum_processor]: ../../processors/enum/README.md
## Metrics
This implementation tries to maintain compatibility with the apcupsd metrics: