bigcyy commented on issue #3384:
URL: https://github.com/apache/hertzbeat/issues/3384#issuecomment-2899850473
At the protocol level, the collected metrics are mapped to aliasField -
value, and then further processed using a calculation expression to produce
realField - realValue. If I understood the code correctly, I hope this is
helpful to you.
```
fields:
- field: my_status
type: 1
i18n:
zh-CN: 状态
en-US: Status
aliasFields:
- memoryDeviceStatus
calculates:
- Status = (memoryDeviceStatus == 1 ? "ABSENT" : (memoryDeviceStatus == 2
? "OK" : (memoryDeviceStatus == 3 ? "WARNING" : "CRITICAL")))
```
refer to:
-
[SnmpCollectImpl.java](https://github.com/apache/hertzbeat/blob/master/hertzbeat-collector/hertzbeat-collector-basic/src/main/java/org/apache/hertzbeat/collector/collect/snmp/SnmpCollectImpl.java)
- [MetricsCollect.java
calculateFields](https://github.com/apache/hertzbeat/blob/master/hertzbeat-collector/hertzbeat-collector-collector/src/main/java/org/apache/hertzbeat/collector/dispatch/MetricsCollect.java)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]