服务器流量监控小工具
安装:
$ 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']}
参数介绍:
懒得写了,看帮助吧
Metadata
Release files for NetTraRec 0.1.12
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| NetTraRec-0.1.12.tar.gz | 11.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| NetTraRec-0.1.12-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 28.7 kB
Release files / NetTraRec-0.1.12.tar.gz
| Download URL | NetTraRec-0.1.12.tar.gz |
|---|---|
| Size | 11.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
180d2d2c8075407402ea8b6f7171806b05e8f4fcab299169d9cb93cb38114423
|
|
BLAKE2b-256 checksum How to use checksums |
406fbd5084e42ee9b95357cba8989944382e58ec1aaa58b078d3a9f6b0b2fde3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.2
|
Release files / NetTraRec-0.1.12-py3-none-any.whl
| Download URL | NetTraRec-0.1.12-py3-none-any.whl |
|---|---|
| Size | 16.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a719b6774dd2d6f33bd66030a8d5e941d99775e9f1db99762db179a49be4d622
|
|
BLAKE2b-256 checksum How to use checksums |
b2051c7fd632412efd427311a42814c1146cb1fd10176c62e4d65dcc7f61102d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.2
|