Fix hwmon measurement names

This commit is contained in:
Keenan Tims 2022-11-22 11:59:00 -08:00
parent 116f9b1cec
commit c7ec9f0dfb
Signed by: ktims
GPG Key ID: 11230674D69038D4
2 changed files with 3 additions and 3 deletions

View File

@ -65,7 +65,7 @@ impl ChimemonSource for HwmonSource {
);
let now = SystemTime::now().duration_since(UNIX_EPOCH).unwrap();
let mut builder =
DataPoint::builder(&s.device).timestamp(now.as_nanos().try_into().unwrap());
DataPoint::builder(&self.config.sources.hwmon.measurement).timestamp(now.as_nanos().try_into().unwrap());
for (key, value) in &self.config.influxdb.tags {
builder = builder.tag(key, value)
}

View File

@ -70,7 +70,7 @@ pub struct HwmonSensorConfig {
pub struct HwmonConfig {
pub enabled: bool,
pub interval: u64,
pub measurement_prefix: String,
pub measurement: String,
pub sensors: Map<String, HwmonSensorConfig>,
}
@ -79,7 +79,7 @@ impl Default for HwmonConfig {
HwmonConfig {
enabled: false,
interval: 60,
measurement_prefix: "hwmon.".into(),
measurement: "hwmon".into(),
sensors: map! {},
}
}