bestsiyue commented on issue #3384: URL: https://github.com/apache/hertzbeat/issues/3384#issuecomment-2899770471
> 嗨,是否可以使用现有的 ,它是基于 Below的?`calculates``JexlExpression` > > ``` > valueString = (value == 1 ? "Normal" : (value == 2 ? "Warning" : "Critical")); > ``` > > 请参阅 : https://hertzbeat.apache.org/zh-cn/docs/advanced/extend-http-default hi,我参考了你的示例文档,文档中更多的是对于json结果的获取,snmp结果与json返回值有明显区别。 或许snmp的mappings可以这么设计? ` # (optional)metrics field alias name, it is used as an alias field to map and convert the collected data and metrics field aliasFields: - memoryDeviceIndex - memoryDeviceManufacturerName - memoryDeviceStatus - memoryDeviceLocationName - memoryDeviceSpeed - memoryDeviceSize mappings: memoryDeviceStatus: [1: "ABSENT", 2: "OK", 3: "WARNING", 4: "CRITICAL"] # mapping and conversion expressions, use these and aliasField above to calculate metrics value # eg: cores=core1+core2, usage=usage, waitTime=allTime-runningTime calculates: - Index=memoryDeviceIndex - ManufacturerName=memoryDeviceManufacturerName - Status=memoryDeviceStatus - LocationName=memoryDeviceLocationName - Speed=memoryDeviceSpeed - Size=memoryDeviceSize / 1024 / 1024 ` -- 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]
