@Componentpublic class OpsToolbox { // 技能 1:查询服务器指标 @Description("查询指定服务器的 CPU、内存和磁盘使用率") public String getServerMetrics(@Description("服务器 IP 地址") String ip) { // 模拟调用 Prometheus 接口 return "IP: " + ip + ", CPU Usage: 98%, Memory: 45%"; } // 技能 2:检索错误日志 @Description("检索最近 1 小时的 ERROR 级别日志") public String searchErrorLogs(@Description("服务名称") String serviceName) { // 模拟调用 ELK 接口 return "发现 NullPointerException 在 com.example.service.PaymentService..."; }}
暂无评论