您的位置:首页 > 运维架构 > 网站架构

利用Grafana监控网站访问延时率

2017-09-11 15:58 2496 查看
最近在玩zabbix+grafana结合,发现grafana有个插件很有趣,他可以监控多地点访问自定义网站的延时率,可以很好的判断网站的联通性。特别是对使用cdn网络的网站监控很有帮助,之前我就经常遇到因为cdn节点挂了导致一个区域的用户都访问不了公司网站,结果等到客户报障才发现,被领导叼了好久。。。
首先要安装grafana
debian系列
1.添加源
root@compute-node:~#deb https://packagecloud.io/grafana/stable/debian/ jessie main >> /etc/apt/source.list
2.添加包签名
root@compute-node:~#curl https://packagecloud.io/gpg.key | sudo apt-key add -
3.更新软件包列表
root@compute-node:~#sudo apt-get update
4.安装grafana
root@compute-node:~#sudo apt-get install grafana

redhat系列
1.下载软件rpm包
root@compute-node:~#wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-4.4.3-1.x86_64.rpm 2.安装依赖
root@compute-node:~#sudo yum install initscripts fontconfig
3.安装grafana
root@compute-node:~#sudo rpm -Uvh grafana-4.4.3-1.x86_64.rpm

启动grafana并通过web访问
root@compute-node:~#service grafana-server restart
用浏览器访问http://</ip>:3000
默认账号:admin,默认密码:admin
登陆后我们按下install apps & plugins 按钮



然后我们就跳转到grafana官网的插件列表,选择worldPing



跳到安装选项卡,把红框中的命令在shell下执行并重启grafana
root@compute-node:~#grafana-cli plugins install raintank-worldping-app
root@compute-node:~#service grafana-server restart



重启完服务后我们在Dashboard上就会看到多出个worldPing的选项卡



进去后点击添加网站



在红框中输入你要检测的网址后点击自动发现



剩下的工作worldPing会自动帮你完成。最终的结果就是下面显示的这样啦



grafana还自带告警功能,我们可以对延时率做告警,支持页面消息,邮件等告警方式。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: