• 欢迎访问db1024网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏db1024吧

Linux VPS安装Stat Hub自建服务器监控

建站知识 Liam 1年前 (2019-04-29) 392次浏览 6个评论 扫描二维码
文章目录[隐藏]

简介

Stat Hub是一个帮您收集并展示众多服务器状态的服务。它由两部分组成,一是服务端,用于接收、储存和展示状态;另一个是客户端,它用于收集并发送状态到服务端。Stat Hub没有Zabbix那么强大的功能,因此部署也显得简单很多。

安装

项目地址:https://github.com/likexian/stathub-go

直接复制下面的命令:

#curl下载并安装 curl --insecure https://raw.githubusercontent.com/likexian/stathub-go/master/setup.sh | sh #如果curl无法使用,可以用wget下载 wget --no-check-certificate -O - https://raw.githubusercontent.com/likexian/stathub-go/master/setup.sh | sh #放行端口(iptables) iptables -I INPUT -p tcp --dport 15944 -j ACCEPT service iptables save service iptables restart  

安装完后,接着访问https://ip:15944打开即可(注意是https的地址,浏览器提示危险请选择允许访问),初始密码为:likexian,登录后可修改,效果图如下。
Linux VPS安装Stat Hub自建服务器监控

添加多个客户端

Stat Hub点击help按钮,按提示操作即可,或者访问https://ip:15944根据提示添加客户端,这样就可以监控多台服务器了。Stat Hub使用crontab每隔1分钟采集1次数据,如果未显示数据,请输入crontab -l查看计划任务是否添加成功。

通过域名访问(Nginx反向代理)

nginx vhost配置文件中添加下面的规则,并重载nginx即可生效。

server         {         listen          80;         server_name     moerats.com;#您需要绑定的域名         location / {            proxy_pass https://127.0.0.1:15944;            proxy_redirect off;            proxy_set_header X-Real-IP $remote_addr;            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;     } } 

总结

Stat Hub没有实时提醒功能,服务器宕机了也只能打开面板目测,希望后期作者添加实时通知功能,哪怕是邮件通知也好啊。RAM监控将Cache部分也算在内,这样感觉RAM监控不太准确,不过影响不大。


db1024 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:Linux VPS安装Stat Hub自建服务器监控
喜欢 (0)
关于作者:
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
(6)个小伙伴在吐槽
  1. Very quickly this site will be famous amid all blogging and site-building visitors, due to it's pleasant articles
    web hosting company2020-08-31 18:42 回复 Linux | Firefox浏览器 59.0
  2. Excellent goods from you, man. I've take into accout your stuff prior to and you're simply extremely wonderful. I actually like what you have received here, certainly like what you're stating and the way by which you are saying it. You are making it entertaining and you still care for to keep it wise. I can not wait to read much more from you. That is actually a terrific website.
    black mass2020-08-31 08:49 回复 Windows 7 | Opera 9.80
  3. Hello! This is my first visit to your blog! We are a collection of volunteers and starting a new project in a community in the same niche. Your blog provided us valuable information to work on. You have done a extraordinary job!
    cheap flights2020-08-28 05:16 回复 Linux | Chrome 65.0.3325.181
  4. Thanks , I have recently been searching for information approximately this topic for ages and yours is the greatest I've discovered till now. However, what in regards to the conclusion? Are you sure in regards to the supply? 34pIoq5 cheap flights
    cheap flights2020-08-25 17:19 回复 Mac OS X | Chrome 52.0.2777.85
  5. Howdy! I'm at work browsing your blog from my new iphone 4! Just wanted to say I love reading your blog and look forward to all your posts! Keep up the superb work!
    web hosting services2020-08-11 21:14 回复 Mac OS X | Chrome 66.0.3359.181
  6. Sweet blog! I found it while searching on Yahoo News. Do you have any suggestions on how to get listed in Yahoo News? I've been trying for a while but I never seem to get there! Cheers adreamoftrains best web hosting company
    adreamoftrains website hosting2020-08-11 03:37 回复 未知操作系统 | Chrome 43.0.2357.125