Skip to content

Commit

Permalink
update light_monitor.md (#1579)
Browse files Browse the repository at this point in the history
  • Loading branch information
ywy2090 committed Nov 23, 2022
1 parent 42e0774 commit 3c6a663
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions 3.x/zh_CN/docs/develop/light_monitor.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

### 简介

`FISCO-BCOS 3.0`区块链轻量级监控工具,可以监控区块链是否正常工作,也提供简单的接入告警系统的方式.
`FISCO-BCOS 3.0`区块链轻量级监控工具,可以监控区块链是否正常工作,也提供简单的接入用户告警系统的方式.

### 功能

Expand Down Expand Up @@ -45,7 +45,7 @@ Example:
- `-p`: rpc port
- `-t`: 区块同步告警的阈值,共识节点之间的区块高度差值超过该阈值,说明共识或者区块同步异常,默认值`30`
- `-d`: 磁盘容量需要监控的目录
- `-T`: 磁盘告警阈值,监控的磁盘剩余空间百分比小于该值时,触发磁盘告警告警,默认值`5%`
- `-T`: 磁盘告警阈值,监控的磁盘剩余空间百分比小于该值时,触发告警,默认值`5%`
- `-h`: 帮助信息

### 状态描述
Expand All @@ -59,11 +59,11 @@ Example:

#### ```OK! $config_ip:$config_port $node:$group is working properly: height $height```

群组`${group}`正常工作, 共识模块/区块同步正常工作
群组`${group}`正常工作, 共识模块/区块同步正常工作

#### ```ERROR! Cannot connect to $config_ip:$config_port ${group}, method: xxxx```

调用`rpc`接口`xxxx`失败,`rpc`服务宕机, 严重错误,此时需要重启`rpc`服务
调用`rpc`接口`xxxx`失败,`rpc`服务宕机, 严重错误,此时需要重启`rpc`服务

#### ```ERROR! Consensus timeout $config_ip:$config_port ${group}:${node}```

Expand All @@ -72,11 +72,11 @@ Example:

#### ```ERROR! insufficient disk capacity, monitor disk directory: ${dir}, left disk space percent: ${disk_space_left_percent}%```

磁盘空间不足,剩余`${disk_space_left_percent}%`的空间
磁盘空间不足,剩余`${disk_space_left_percent}%`的空间

### 配置crontab任务

为了能够持续监控区块链节点的状态, 需要将`light_monitor.sh`配置到`crontab`定期执行.
为了能够持续监控区块链节点的状态, `light_monitor.sh`配置到`crontab`定期执行.

```shell
# 每分钟执行一次,查看节点是否正常启动, 正常共识, 有无关键错误打印
Expand Down Expand Up @@ -119,15 +119,6 @@ alarm() {
修改`alarm`函数:

```shell
alarm() {
local message="$1"
# 获取本机IP
alert_ip=$(/sbin/ifconfig eth0 2>/dev/null | grep inet | awk '{print $2}')

# 发送告警信息
curl -H "Content-Type: application/json" -X POST --data "{'title':'alarm','alert_ip':'${alert_ip}','alert_info':'${message}'}" http://127.0.0.1:1111/alarm/request
}

alarm() {
echo "$1"
alert_msg="$1"
Expand Down

0 comments on commit 3c6a663

Please sign in to comment.