简介

  无论您要测试同一台主机上的服务,还是要测试开放网络上的服务,Heartbeat 都能轻松生成运行时间数据和响应时间数据

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。

  Heartbeat 能够通过 ICMP、TCP 和 HTTP 进行 ping 检测,同时也支持 TLS、认证和代理。您可以借助简易的 DNS 解析,监控负载均衡服务器背后的所有主机。

  安装系统环境

ELK之使用heartbeat监控WEB站点 随笔 第1张

  下载rpm包安装

rpm -ivh heartbeat-6.6.2-x86_64.rpm

  修改配置文件

/etc/heartbeat/heartbeat.yml 

  

heartbeat.monitors:
- type: http
  urls: ["https://www.xxxx.net"]
  schedule: '@every 10s'
  check.response.status: 200
- type: tcp
  schedule: '@every 5s'
  hosts: ["172.16.90.24:9200"]
- type: icmp
  schedule: '*/5 * * * * * *'
  hosts: ["172.16.90.24"]
setup.template.settings:
  index.number_of_shards: 1
  index.codec: best_compression
setup.kibana:
  host: "172.16.90.24:5601"
output.elasticsearch:
  hosts: ["172.16.90.24:9200"]
processors:
  - add_host_metadata: ~
  - add_cloud_metadata: ~

  输出至kibana及elasticsearch

  导入大字报模板

heartbeat setup --dashboards

  启动heartbeat

 systemctl start heartbeat-elastic

  kibana页面查看

ELK之使用heartbeat监控WEB站点 随笔 第2张

ELK之使用heartbeat监控WEB站点 随笔 第3张

  PS:监控的主机需要可以访问到该http站点 使用curl命令测试是否可以访问

 

扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄