监控全网其他服务的服务
## MongoDB
1. 配置一个MongoDB数据库,会创建数据库`slavem`。
2. 这个数据库用于接受定时任务的汇报和设置定时任务列表。
3. 为了你的人身安全,请设置用户名密码访问数据库。
## 配置文件
```json
{
"host": "localhost",
"port": 27017,
"dbn": "slavem",
"username": "slavem",
"password": "slavem",
}
```
## 启动服务
```python
import slavem
monitor = slavem.Monitor(
host='localhost',
port=27017,
)
monitor.start()
```
## 任务
### 创建任务
```python
import slavem
import json
settingPath = './slavem_setting.json'
with open(settingPath, 'r') as f:
kwarg = json.load(f)
monitor = slavem.Monitor(**kwarg)
taskKwargs = {
'name': 'serverName', # 可以重复
'type': 'serverType',
'lanuch': '20:50:00', # 启动时刻
'delay': 5, # min 启动后 delay 分钟后查看启动结果
'host': 'localhost', # 服务所在的 host
}
monitor.createTask(**taskKwargs)
monitor.stop()
```
### 查看任务
```python
import slavem
import json
settingPath = './slavem_setting.json'
with open(settingPath, 'r') as f:
kwarg = json.load(f)
monitor = slavem.Monitor(**kwarg)
monitor.showTask()
monitor.stop()
```
Metadata
Release files for slavem 0.3.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| slavem-0.3.4.tar.gz | 10.4 kB | Without provenance | Details for slavem-0.3.4.tar.gz |
Release files / slavem-0.3.4.tar.gz
| Download URL | slavem-0.3.4.tar.gz |
|---|---|
| Size | 10.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a129cc4d8b2a5977e9ab33e399fd9344dea413aa68a1f72908dd6062ee33585c
|
|
BLAKE2b-256 checksum How to use checksums |
509898405f9d24e2f7773094f2b13139a9e22f359a05c483d468d7c61793abe0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for slavem 0.3.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.