-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eae2040
commit 51ec7b0
Showing
2 changed files
with
145 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,38 +87,157 @@ transfer: | |
http: 0.0.0.0:8008 | ||
rpc: 0.0.0.0:8009 | ||
addresses: | ||
- 192.168.0.100 # 修改成实际的 n9e 服务器地址 | ||
- 192.168.100.1 # 修改成实际的 n9e 地址 | ||
|
||
probe: | ||
http: 127.0.0.1:2059 | ||
ams: | ||
http: 0.0.0.0:8002 | ||
addresses: | ||
- 192.168.100.1 | ||
|
||
vsphere-mon: | ||
http: 127.0.0.1:2060 | ||
``` | ||
#### probe.yml | ||
#### vsphere.yml | ||
```yml | ||
logger: | ||
dir: logs/ | ||
level: INFO | ||
level: WARNING | ||
keepHours: 24 | ||
|
||
probe: | ||
# 如果需要区分来自不同区域的探针,可以通过在配置 region 来插入 tag | ||
#region: default | ||
timeout: 5 # 探测的超时时间,单位是秒 | ||
limit: 10 # 并发限制 | ||
interval: 30 # 请求的间隔 | ||
headers: # 插入到 http 请求中的 headers,可以多条 | ||
user-agent: Mozilla/5.0 (Linux; Android 6.0.1; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Mobile Safari/537.36 Edg/87.0.664.66 | ||
|
||
ping: | ||
107: # n9e 节点上的 nid 号 | ||
- 114.114.114.114 # 要探测的 ip 地址列表 | ||
- 114.114.115.115 | ||
|
||
url: | ||
107: # n9e 节点上的 nid 号 | ||
- https://www.baidu.com # 要探测的 url 地址列表 | ||
- https://www.sjtu.edu.cn/ | ||
- https://bbs.ngacn.cc | ||
- https://www.163.com | ||
# 上报的间隔,注意关注下 info.log 的日志,确保能够在一个周期内完成采集 | ||
interval: 300 | ||
|
||
report: | ||
# 调用ams的接口上报数据,需要ams的token | ||
token: ams-builtin-token | ||
# physical:物理机,virtual:虚拟机,container:容器,switch:交换机 | ||
cate: physical | ||
# 使用哪个字段作为唯一KEY,即作为where条件更新对应记录,一般使用sn或ip | ||
uniqkey: ip | ||
# 租户,如果配置则直接注册到该租户下 | ||
tenant: | ||
# 要监控的 vsphere 的配置信息 | ||
|
||
vspheres: | ||
# vcenter 的地址 | ||
- addr: https://1.1.1.1/sdk | ||
# vcenter 的用户名 | ||
user: [email protected] | ||
# vcetner 的密码 | ||
pwd: password | ||
# 是否开启 esxi 的扩展指标监控,注意这会增加 vcenter 的负担 | ||
esxiperf: true | ||
# 是否开启虚拟机的监控,注意这会增加 vcenter 的负担 | ||
vm: true | ||
# 虚拟机监控所在的节点 ID(设备无关) | ||
nid: 137 | ||
# 采集的虚拟机列表,如果是空数组则采集所有的虚拟机信息。 | ||
# 虚拟机数量的增加不会增加 vcenter 的负担,这里允许控制虚拟机采集数量的目的是可以减少 n9e 的负担,削减指标数量。 | ||
vmlist: ["VC"] | ||
# 是否开启虚拟机的扩展指标监控,注意这会增加 vcenter 的负担 | ||
vmperf: true | ||
# 采集虚拟机扩展指标监控的虚机列表,如果是空数组则采集所有虚机的扩展指标 | ||
# 注意这里的虚机数量越多,对 vcenter 的负担越大,建议只对重点关注的虚机开启 | ||
vmperflist: ["VC"] | ||
- addr: https://2.2.2.2/sdk | ||
user: [email protected] | ||
pwd: password | ||
esxiperf: false | ||
vm: false | ||
nid: 138 | ||
vmlist: [] | ||
vmperf: false | ||
vmperflist: [] | ||
|
||
# 扩展的性能指标,注意采集越多对 vc 的负担就越大 | ||
# 建议根据实际需求配置 | ||
# 更多指标和相关含义见 vmware 官网 | ||
# https://vdc-repo.vmware.com/vmwb-repository/dcr-public/790263bc-bd30-48f1-af12-ed36055d718b/e5f17bfc-ecba-40bf-a04f-376bbb11e811/vim.PerformanceManager.html#counterTables | ||
performance: | ||
# esxi 宿主机的额外扩展指标 | ||
esxi: | ||
- cpu.coreUtilization.average | ||
- cpu.costop.summation | ||
- cpu.demand.average | ||
- cpu.idle.summation | ||
- cpu.latency.average | ||
- cpu.readiness.average | ||
- cpu.ready.summation | ||
- cpu.swapwait.summation | ||
- cpu.usage.average | ||
- cpu.usagemhz.average | ||
- cpu.used.summation | ||
- cpu.utilization.average | ||
- cpu.wait.summation | ||
- disk.deviceReadLatency.average | ||
- disk.deviceWriteLatency.average | ||
- disk.kernelReadLatency.average | ||
- disk.kernelWriteLatency.average | ||
- disk.numberReadAveraged.average | ||
- disk.numberWriteAveraged.average | ||
- disk.read.average | ||
- disk.totalReadLatency.average | ||
- disk.totalWriteLatency.average | ||
- disk.write.average | ||
- mem.active.average | ||
- mem.latency.average | ||
- mem.state.latest | ||
- mem.swapin.average | ||
- mem.swapinRate.average | ||
- mem.swapout.average | ||
- mem.swapoutRate.average | ||
- mem.totalCapacity.average | ||
- mem.usage.average | ||
- mem.vmmemctl.average | ||
- net.bytesRx.average | ||
- net.bytesTx.average | ||
- net.droppedRx.summation | ||
- net.droppedTx.summation | ||
- net.errorsRx.summation | ||
- net.errorsTx.summation | ||
- net.usage.average | ||
- power.power.average | ||
- storageAdapter.numberReadAveraged.average | ||
- storageAdapter.numberWriteAveraged.average | ||
- storageAdapter.read.average | ||
- storageAdapter.write.average | ||
- sys.uptime.latest | ||
# vm 虚拟机的额外扩展指标 | ||
vm: | ||
- cpu.demand.average | ||
- cpu.idle.summation | ||
- cpu.latency.average | ||
- cpu.readiness.average | ||
- cpu.ready.summation | ||
- cpu.run.summation | ||
- cpu.usagemhz.average | ||
- cpu.used.summation | ||
- cpu.wait.summation | ||
- mem.active.average | ||
- mem.granted.average | ||
- mem.latency.average | ||
- mem.swapin.average | ||
- mem.swapinRate.average | ||
- mem.swapout.average | ||
- mem.swapoutRate.average | ||
- mem.usage.average | ||
- mem.vmmemctl.average | ||
- net.bytesRx.average | ||
- net.bytesTx.average | ||
- net.droppedRx.summation | ||
- net.droppedTx.summation | ||
- net.usage.average | ||
- power.power.average | ||
- virtualDisk.numberReadAveraged.average | ||
- virtualDisk.numberWriteAveraged.average | ||
- virtualDisk.read.average | ||
- virtualDisk.readOIO.latest | ||
- virtualDisk.throughput.usage.average | ||
- virtualDisk.totalReadLatency.average | ||
- virtualDisk.totalWriteLatency.average | ||
- virtualDisk.write.average | ||
- virtualDisk.writeOIO.latest | ||
- sys.uptime.latest | ||
``` | ||
## 编译 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
cp service/vsphere.service /usr/lib/systemd/system/ | ||
cp service/vsphere-mon.service /usr/lib/systemd/system/ | ||
systemctl daemon-reload | ||
systemctl start vsphere-mon | ||
systemctl enable vsphere-mon |