服务器流量监控小工具
Project description
服务器流量监控小工具
安装:
$ pip install NetTraRec
终端使用:
$ netrec [-选项]
# 显示帮助
$ netrec -h
# 结果推入 redis
$ netrec -pr
# 然后在启动后输入相关信息:
# target redis host(127.0.0.1):
# port(6379):
# db(0):
# password(123456):
# ...
# 目标 redis 可以是本地或远程
# redis 信息也可以使用参数 "-kp now>>>>参数字典" 传入,方便远程调度
# 例如:
$ netrec -pr -kp 'now>>>>{"host": ..., "port": ..., ...}'
代码调用:
from NetRecorder import NetTraRec as Nr
res = Nr.start(["eth0"], print_out=False, unit="auto")
print(res)
# {'eth0': ['126.00 Bytes/s', '132.00 Bytes/s', 'auto', '2020-07-08 09:51:17']}
参数介绍:
懒得写了,看帮助吧
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
NetTraRec-0.1.3.tar.gz
(11.3 kB
view hashes)
Built Distribution
NetTraRec-0.1.3-py3-none-any.whl
(14.9 kB
view hashes)
Close
Hashes for NetTraRec-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ea23097f27f1135d2d651ae0dcdf5594fec0f4d2b1d4aedd32bac703ac59aa6 |
|
MD5 | e9ee9f478b5635c9003684a7443b1021 |
|
BLAKE2b-256 | 8a8c88c1f6477362b25d34201fd2953bc8c3ee0a17dcbb5adea678f6a00eed88 |