-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Changed Pydantic for JSON config files. * Fixed poetry entry-point. It threw the error 'EntryPoint must be in 'name=module:attrs [extras]' format'. Fixed it changing the '-' in 'monitor-agent' for a '_'. * Implemented receiving settings as a JSON ->FILE<- (not text). Need to fix testing of data types when a JSON is received * Reformatted code of 'settings' module * Implemented alert manager. Need to check if it's the best way to store the thresholds. * Fix #24. * SECURITY: Removed GET Settings. * Remote Work * Settings reformmated and FINALLY FIXED. Removed Thresholds POST Thresholds will now be passed through the config file instead of saving it as a dictionary. * Bump Dependency Versions
- Loading branch information
Showing
5 changed files
with
189 additions
and
220 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,57 @@ | ||
# Monitor - Agent | ||
Final Degree Project - Host to monitor | ||
|
||
Final Degree Project - Host to monitor | ||
|
||
## Uvicorn configuration | ||
|
||
In `settings.json` you could pass this parameters to Uvicorn server: | ||
|
||
```python | ||
host: str | ||
port: int | ||
uds: str | ||
fd: int | ||
loop: str | ||
http: str | ||
ws: str | ||
ws_max_size: int | ||
ws_ping_interval: float | ||
ws_ping_timeout: float | ||
ws_per_message_deflate: bool | ||
lifespan: str | ||
debug: bool | ||
reload: bool | ||
reload_dirs: typing.List[str] | ||
reload_includes: typing.List[str] | ||
reload_excludes: typing.List[str] | ||
reload_delay: float | ||
workers: int | ||
env_file: str | ||
log_config: str | ||
log_level: str | ||
access_log: bool | ||
proxy_headers: bool | ||
server_header: bool | ||
date_header: bool | ||
forwarded_allow_ips: str | ||
root_path: str | ||
limit_concurrency: int | ||
backlog: int | ||
limit_max_requests: int | ||
timeout_keep_alive: int | ||
ssl_keyfile: str | ||
ssl_certfile: str | ||
ssl_keyfile_password: str | ||
ssl_version: int | ||
ssl_cert_reqs: int | ||
ssl_ca_certs: str | ||
ssl_ciphers: str | ||
headers: typing.List[str] | ||
use_colors: bool | ||
app_dir: str | ||
factory: bool | ||
``` | ||
|
||
More information in their webpage - [Uvicorn Settings](https://www.uvicorn.org/settings/). | ||
|
||
> :warning: If any parameters is incorrect the server will crash. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,26 @@ | ||
{ | ||
"backlog": 2048, | ||
"debug": true, | ||
"host": "0.0.0.0", | ||
"limit_concurrency": null, | ||
"limit_max_requests": null, | ||
"log_level": "trace", | ||
"metric_enable_file": false, | ||
"metric_endpoint": true, | ||
"metric_file": "metrics.json", | ||
"port": 8080, | ||
"post_alert_url": "", | ||
"post_interval": 60, | ||
"post_metric_url": "http://httpbin.org/post", | ||
"reload": true, | ||
"ssl_ca_certs": null, | ||
"ssl_cert_reqs": null, | ||
"ssl_certfile": null, | ||
"ssl_ciphers": null, | ||
"ssl_keyfile": null, | ||
"ssl_keyfile_password": null, | ||
"ssl_version": null, | ||
"timeout_keep_alive": 5, | ||
"workers": 4 | ||
"alerts": { | ||
"url": "127.0.0.1:8000/alerts" | ||
}, | ||
"metrics": { | ||
"enable_logfile": false, | ||
"get_endpoint": true, | ||
"log_filename": "metrics.json", | ||
"post_interval": 60, | ||
"post_url": "http://httpbin.org/post" | ||
}, | ||
"thresholds": { | ||
"cpu_percent": 50, | ||
"ram_percent": 30 | ||
}, | ||
"uvicorn": { | ||
"backlog": 2048, | ||
"debug": true, | ||
"host": "0.0.0.0", | ||
"log_level": "trace", | ||
"port": 8000, | ||
"reload": true, | ||
"timeout_keep_alive": 5, | ||
"workers": 4 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.