当前位置: 首页 > news >正文

中山网站排名设计logo的软件推荐

中山网站排名,设计logo的软件推荐,企业网站管理系统哪个好,做标书分享网站Prometheus node的监控数据如链接展示#xff0c;我们希望能更加方便的看到监控数据#xff0c;shodan对Prometheus metrics 的数据做了格式化处理。172.96.3.215:9100/metricshttp://172.96.3.215:9100/metrics 本文我自己实现了一个命令行工具#xff0c;可以输出类shodan…Prometheus node的监控数据如链接展示我们希望能更加方便的看到监控数据shodan对Prometheus metrics 的数据做了格式化处理。172.96.3.215:9100/metricshttp://172.96.3.215:9100/metrics 本文我自己实现了一个命令行工具可以输出类shodan数据格式监控数据。以下是代码示例 // ExtractMsg 提取信息 /*1.node_dmi_info2.node_exporter_build_info3.node_network_info4.node_os_info5.node_uname_info按照顺序从前到后寻找 */ func ExtractMsg(resp string) {//1提取node_dmi_info信息的子串tmpindex : 0dmiResult, dmiEndindex : common(resp, node_dmi_info{)tmpindex dmiEndindex//2提取node_exporter_build_info信息的子串buildResult, buildEndindex : common(resp[tmpindex:], node_exporter_build_info{)tmpindex buildEndindexnetworkStartIndex : tmpindex//3提取node_os_info信息的子串osResult, osEndindex : common(resp[tmpindex:], node_os_info{)tmpindex osEndindex// 提取node_network_info信息的子串,特殊模块network(resp[networkStartIndex:], node_network_info{)//4提取node_uname_info信息的子串unameResult, _ : common(resp[tmpindex:], node_uname_info{)// 逐个序列化json.Unmarshal([]byte(dmiResult), prometheus.NodeDmiInfo)json.Unmarshal([]byte(buildResult), prometheus.NodeExporterBuildInfo)json.Unmarshal([]byte(osResult), prometheus.NodeOsInfo)json.Unmarshal([]byte(unameResult), prometheus.NodeUnameInfo) }// common 公共模块 func common(resp, findstr string) (result string, endIndex int) {startIndex : strings.Index(resp, findstr)// 找不到的情况if startIndex -1 {return , 0}endIndex strings.Index(resp[startIndex:], } 1)endIndex endIndex startIndex 1// 提取子串的内容result strings.ReplaceAll(resp[startIndexlen(findstr)-1:endIndex], , :)re : regexp.MustCompile((\w):([^,]))result re.ReplaceAllString(result, $1:$2)return }// network 单独的网络模块 func network(resp, findstr string) {count : strings.Count(resp, findstr)prometheus.NodeNetworkInfo make([]Response.NodeNetworkInfo, count)//找到第一个开始位置startIndex : strings.Index(resp, findstr)for i : 0; i count; i {//找到结束位置endIndex : strings.Index(resp[startIndex:], } 1)//算出结束位置endIndex endIndex startIndex 1// 提取子串的内容result : strings.ReplaceAll(resp[startIndexlen(findstr)-1:endIndex], , :)// 把多余的部分截掉使其可以被反序列化为对象result strings.TrimLeft(result, nfo)// 正则并且加引号使其称为JSON格式re : regexp.MustCompile((\w):([^,]))result re.ReplaceAllString(result, $1:$2)// 反序列化err : json.Unmarshal([]byte(result), prometheus.NodeNetworkInfo[i])if err ! nil {panic(err)}startIndex endIndex} } 效果如下 完整代码详见GitHub FrankZhang63/Promethues: Promethues metrics 类shodan数据格式 (github.com)
http://www.w-s-a.com/news/989262/

相关文章:

  • 中山企业做网站昆明做网站价格
  • wordpress 新网站 代码网站可以做系统还原吗
  • 百度给做网站公司餐饮设计装饰公司
  • 专门卖医疗器械的网站网站建设方案一份
  • 吉林省建设安全监督站网站wordpress 4.7.5下载
  • 网页制作视频的网站建设营销策划公司
  • 玉雕网站建设八点品牌设计公司招聘
  • 服务器可以自己的网站吗flash 网站 源码
  • 湖南做网站 搜搜磐石网络网站注册收入
  • 北京软件网站开发装修设计培训机构
  • 哪个网站能帮助做路书网站建设的技巧
  • 上海网站备案在哪里在国外怎么做网站
  • 做网站得花多钱乡村振兴网站建设
  • 站设计培训课程wordpress自动回复
  • 上海闵行区 网站建设永久免费crm软件下载
  • 天津营销网站建设公司排名台州网站排名公司
  • 环保网站 怎么做物流网站的功能与特色
  • 网站多久才会被收录服务器租用泰海
  • 电商网站建设合同模板临汾推广型网站建设
  • 天猫商务网站建设目的长春网站设计
  • 公司网站建设会议纪要昆山高端网站建设机构
  • 做消费网站流程深圳网站设计价格
  • 做电影网站怎么接广告中国最新军事新闻视频
  • 网站推广设计做哪些设置自动删除的wordpress
  • 东莞东坑网站设计专业网站制作设
  • 网站怎么做现场直播视频成都科技网站建设找
  • 个人网页设计步骤网站没有内容 能做优化吗
  • 专业网站建设公司招聘网站排行榜
  • 网站建设规范方法企业解决方案架构
  • ae做网站导航wordpress门户