nohup ./server.sh > /dev/null 2>&1 &
./client.sh get cpu
输出:
cpu 最新数据为:
used_rate: 10.00%
./client.sh get memory
输出:
memory 最新数据为:
total: 32509M
used: 10470M
free: 21757M
share: 17M
buffcache: 223M
available: 21925M
used_rate: 32.21%
./client.sh get disk
输出:
disk 最新数据为:
-
file_system: rootfs
blocks: 204801M
used: 87372M
available: 117430M
used_rate: 43%
mounted: /
-
file_system: none
blocks: 204801M
used: 87372M
available: 117430M
used_rate: 43%
mounted: /dev
-
file_system: none
blocks: 204801M
used: 87372M
available: 117430M
used_rate: 43%
mounted: /run
-
file_system: none
blocks: 204801M
used: 87372M
available: 117430M
used_rate: 43%
mounted: /run/lock
-
file_system: none
blocks: 204801M
used: 87372M
available: 117430M
used_rate: 43%
mounted: /run/shm
-
file_system: none
blocks: 204801M
used: 87372M
available: 117430M
used_rate: 43%
mounted: /run/user
-
file_system: tmpfs
blocks: 204801M
used: 87372M
available: 117430M
used_rate: 43%
mounted: /sys/fs/cgroup
./client.sh target
输出:
使用率统计:
cpu: 10.00% [正常]
------------------------------
内存: 33.46% [正常]
------------------------------
磁盘:
rootfs (/) : 43% [正常]
none (/dev) : 43% [正常]
none (/run) : 43% [正常]
none (/run/lock) : 43% [正常]
none (/run/shm) : 43% [正常]
none (/run/user) : 43% [正常]
tmpfs (/sys/fs/cgroup) : 43% [正常]
- data #数据目录
- .data #数据文件
- module #模块文件
- collectFunc #采集模块函数
- cpu.sh #cpu函数
- df.sh #磁盘函数
- free.sh #内存函数
- collect.sh #采集模块:获取cpu、磁盘、内存信息
- init.sh #初始化方法:加载模块函数
- parse.sh #解析数据模块:解析数据文件
- store.sh #存储模块:存储采集的信息到数据文件
- client.sh #client服务:获取信息、获取指标
- server.sh #server服务:周期性调用采集模块、调用存储模块