[docker]单台物理机-多台物理机集中-监控[ansible-cmdb/netdata/Serverstatus]
2017-10-28 15:33
483 查看
netdata-监控单台vm
适用于单台物理机资源监控.github
docker run -d --cap-add SYS_PTRACE \ -v /proc:/host/proc:ro \ -v /sys:/host/sys:ro \ -p 19999:19999 titpetric/netdata
Serverstatus-监控多台vm(cs模式-psutil)
缺点: 服务端和客户端都需要配置. 不符合大面积使用场景,实用不同地方的物理机.原理: 服务端开个端口—客户端利用基于pstuil脚本推送监控谁到服务端.然后生成html, 把这些html放到nginx的目录下,供用户查阅.
#### 1.服务端安装
git clone https://github.com/tenyue/ServerStatus.git cd ServerStatus/server make 附: yum -y install gcc+ gcc-c++
1.2.修改服务端配置文件
{"servers": [ { "username": "no132", # 用户名和密码需要在客户端配置 "name": "node132.ma.com", # 节点名:感觉像是主机名的一个标签别名吧 "type": "kvm", # 虚拟化类型,Openvs?KVM?Xen? "host": "GenericServerHost123", # 主机名 "location": "Shenzhen", # 在台机器在洛杉矶?纽约? "password": "123456" }, { "username": "bs01", "name": "Backupserver 1", "type": "Virtual Server", "host": "GenericVPSHost123", "location": "Switzerland", "password": "some-harder-to-guess-copy-paste-password" } ] }
1.3跑一个nginx,把服务端的网页程序放目录下,我跑了个docker
mkdir -p /data/nginx-html docker run -d \ --net=host \ --restart=always \ -v /etc/nginx/nginx.conf:/etc/nginx/nginx.conf:ro \ -v /etc/localtime:/etc/localtime:ro \ -v /data/nginx-html:/usr/share/nginx/html \ --name nginx \ nginx
cp -r ServerStatus/web/* /data/nginx-html
1.4启动服务端(91用于和客户端通信)
./sergate --config=/data/ServerStatus/server/config.json --web-dir= 9e6c /data/nginx-html/ --port=91 nohup ./sergate --config=/data/ServerStatus/server/config.json --web-dir=/data/nginx-html/ --port=91 &> /dev/null &
### 2.安装客户端
yum -y install epel-release yum -y install python-pip yum clean all yum -y install gcc yum -y install python-devel pip install psutil
还有win的客户端
配置客户端
wget https://raw.githubusercontent.com/tenyue/ServerStatus/master/clients/client-psutil.py vim client-psutil.py ... 8 SERVER = "127.0.0.1" 9 PORT = 91 10 USER = "no132" 11 PASSWORD = "123456" 12 INTERVAL = 1 # 更新间隔 ...
启动客户端
python client-psutil.py nohup python client-psutil.py &> /dev/null &
ansible-cmdb监控多台vm
好处: 更细致,可以看到每台vm上跑了什么服务. 和ansible丝滑般对接.原理: 利用ansible搜集机器指标,生成html,放到nginx目录下供用户访问查阅.
安装参考
github
相关文章推荐
- aspnet mvc 2 DataAnnotation Client and Server Validation
- .NET Framework Data Provider for SQL Server
- 在 docker中 运行 mono /jexus server 并部署asp.net mvc站点
- Pro ASP.NET for SQL Server: High Performance Data Access for Web Developers
- 在 .NET Framework Data Provider for Microsoft SQL Server Compact 3.5 中发生错误
- 采用Opserver来监控你的ASP.NET项目系列(三、监控你的服务器状态)
- (转)SQL Server Data Types and Their .NET Framework Equivalents
- Tomcat监控--Server Status使用
- SQLServer .NET Data Provider的Connection Pooling
- Ubuntu上使用Netdata设置实时性能监控的详细流程
- .NET Compact Framework Data Provider for SQL Server CE
- 采用Opserver来监控你的ASP.NET项目系列(二、监控SQL Server与Asp.Net项目)
- 采用Opserver来监控你的ASP.NET项目系列(一、Opserver监控的简介与平台搭建)
- 运行asp.net时弹出the status code returned from the server was:404错误提示
- 采用Opserver来监控你的ASP.NET项目系列(二、监控SQL Server与Asp.Net项目)
- Server-side ASP .NET Data Binding, Part 2: Customizing the DataGrid Control
- ADO.NET Entity Framework: The version of SQL Server in use does not support datatype 'datetime2'
- 采用Opserver来监控你的ASP.NET项目系列(二、监控SQL Server与Asp.Net项目)
- 用VSCode开发一个基于asp.net core 2.0/sql server linux(docker)/ng5/bs4的项目(1)