This commit is contained in:
Wolfgang Hottgenroth 2021-03-15 17:20:39 +01:00
parent cface0d4b2
commit 07cc7a742b
Signed by: wn
GPG Key ID: 6C1E5E531E0D5D7F

View File

@ -238,13 +238,11 @@ int initForwarder(t_configHandle *configHandle, t_forwarderHandle *handle) {
} }
logmsg(LOG_INFO, "influxUrl is %s", handle->influxUrl); logmsg(LOG_INFO, "influxUrl is %s", handle->influxUrl);
uint32_t lowerBound = 45000; handle->lowerBound = 45000;
config_lookup_int(&(configHandle->cfg), "lowerBound", &lowerBound); config_lookup_int(&(configHandle->cfg), "lowerBound", &(handle->lowerBound));
handle->lowerBound = lowerBound; handle->upperBound = 55000;
uint32_t upperBound = 55000; config_lookup_int(&(configHandle->cfg), "upperBound", &(handle->upperBound));
config_lookup_int(&(configHandle->cfg), "upperBound", &upperBound); logmsg(LOG_INFO, "lowerBound: %u, upperBound: %u", handle->lowerBound, handle->upperBound);
handle->upperBound = upperBound;
logmsg(LOG_INFO, "lowerBound: %u, upperBound: %u", lowerBound, upperBound);
return 0; return 0;
} }
@ -298,11 +296,11 @@ int forwardMinuteBuffer(t_forwarderHandle *handle, t_minuteBuffer *buf) {
char payload[256]; char payload[256];
int res = snprintf(payload, sizeof(payload), int res = snprintf(payload, sizeof(payload),
"%s,valid=1,location=%s,host=%s freq=%d.%03d" "%s,valid=1,location=%s,host=%s freq=%d.%03d"
#ifdef OpenBSD #ifdef OpenBSD
" %llu" " %llu"
#else #else
" %lu" " %lu"
#endif #endif
"", "",
handle->influxMeasurement, location, buf->s.deviceId, handle->influxMeasurement, location, buf->s.deviceId,
frequency_before_point, frequency_behind_point, frequency_before_point, frequency_behind_point,
@ -317,7 +315,7 @@ int forwardMinuteBuffer(t_forwarderHandle *handle, t_minuteBuffer *buf) {
logmsg(LOG_DEBUG, "Successfully sent to InfluxDB"); logmsg(LOG_DEBUG, "Successfully sent to InfluxDB");
} }
} else { } else {
logmsg(LOG_ERR, "%u out of bound", buf->s.frequency[j]); logmsg(LOG_ERR, "%u out of bound, ignored", buf->s.frequency[j]);
} }
} }