woninet 2.0.1__tar.gz → 2.0.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {woninet-2.0.1 → woninet-2.0.3}/PKG-INFO +31 -2
- {woninet-2.0.1 → woninet-2.0.3}/README.md +30 -1
- {woninet-2.0.1 → woninet-2.0.3}/pyproject.toml +1 -1
- {woninet-2.0.1 → woninet-2.0.3}/woninet/__init__.py +1 -1
- {woninet-2.0.1 → woninet-2.0.3}/woninet/core/engine.py +1 -1
- {woninet-2.0.1 → woninet-2.0.3}/woninet/core/graph.py +3 -0
- {woninet-2.0.1 → woninet-2.0.3}/woninet/main.py +22 -5
- {woninet-2.0.1 → woninet-2.0.3}/woninet/utilities/arguments.py +7 -0
- woninet-2.0.3/woninet/utilities/create_configuration.py +36 -0
- {woninet-2.0.1 → woninet-2.0.3}/woninet.egg-info/PKG-INFO +31 -2
- {woninet-2.0.1 → woninet-2.0.3}/woninet.egg-info/SOURCES.txt +1 -0
- {woninet-2.0.1 → woninet-2.0.3}/LICENSE +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/setup.cfg +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/tests/test_alert_events.py +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/tests/test_api.py +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/tests/test_ip_validation.py +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/tests/test_storage.py +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/woninet/__main__.py +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/woninet/core/__init__.py +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/woninet/core/alerts.py +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/woninet/core/collectors.py +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/woninet/core/manual_ip_enumerator.py +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/woninet/core/models.py +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/woninet/core/storage.py +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/woninet/core/subnet_enumerator.py +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/woninet/database/__init__.py +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/woninet/database/base.py +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/woninet/database/engine.py +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/woninet/database/repositories/__init__.py +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/woninet/database/repositories/alert_event_repository.py +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/woninet/database/repositories/alert_state_repository.py +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/woninet/database/repositories/device_repository.py +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/woninet/database/repositories/metric_repository.py +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/woninet/database/tables.py +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/woninet/logging.yaml +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/woninet/server/__init__.py +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/woninet/server/app.py +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/woninet/server/dependencies.py +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/woninet/server/routes/__init__.py +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/woninet/server/routes/api/__init__.py +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/woninet/server/routes/api/devices.py +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/woninet/server/routes/api/stats.py +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/woninet/server/routes/page/__init__.py +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/woninet/server/routes/page/devices.py +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/woninet/server/static/css/404.css +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/woninet/server/static/css/style.css +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/woninet/server/static/js/app.js +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/woninet/server/static/js/device_info.js +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/woninet/server/static/swagger-ui/favicon-32x32.png +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/woninet/server/static/swagger-ui/swagger-ui-bundle.js +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/woninet/server/static/swagger-ui/swagger-ui.css +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/woninet/server/templates/404.html +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/woninet/server/templates/dashboard.html +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/woninet/server/templates/device_info.html +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/woninet/utilities/__init__.py +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/woninet/utilities/cli_parser.py +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/woninet/utilities/detect_ip_range.py +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/woninet/utilities/ip_validator.py +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/woninet/utilities/logger.py +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/woninet.egg-info/dependency_links.txt +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/woninet.egg-info/entry_points.txt +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/woninet.egg-info/requires.txt +0 -0
- {woninet-2.0.1 → woninet-2.0.3}/woninet.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: woninet
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.3
|
|
4
4
|
Summary: A Python-based ARP+ICMP network monitoring tool
|
|
5
5
|
Author-email: Alireza Teymuri <teymuri.alireza98@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -67,7 +67,36 @@ IPs and filters out Wi‑Fi ARP‑delay noise.)
|
|
|
67
67
|
|
|
68
68
|
**Note:** *woninet* is under active development.
|
|
69
69
|
|
|
70
|
-
## Installation
|
|
70
|
+
## Installation from PyPI
|
|
71
|
+
|
|
72
|
+
### Unix/Linux
|
|
73
|
+
|
|
74
|
+
Create and activate a virtual environment:
|
|
75
|
+
|
|
76
|
+
```shell
|
|
77
|
+
python3 -m venv --copies venv
|
|
78
|
+
source venv/bin/activate
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Install woninet from PyPI:
|
|
82
|
+
|
|
83
|
+
```shell
|
|
84
|
+
pip install woninet
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Grant the required capability to the Python interpreter:
|
|
88
|
+
|
|
89
|
+
```shell
|
|
90
|
+
sudo setcap cap_net_raw=eip venv/bin/python3
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Then run:
|
|
94
|
+
|
|
95
|
+
```shell
|
|
96
|
+
woninet --help
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
#### macOS/Windows
|
|
71
100
|
|
|
72
101
|
Install from PyPI:
|
|
73
102
|
|
|
@@ -40,7 +40,36 @@ IPs and filters out Wi‑Fi ARP‑delay noise.)
|
|
|
40
40
|
|
|
41
41
|
**Note:** *woninet* is under active development.
|
|
42
42
|
|
|
43
|
-
## Installation
|
|
43
|
+
## Installation from PyPI
|
|
44
|
+
|
|
45
|
+
### Unix/Linux
|
|
46
|
+
|
|
47
|
+
Create and activate a virtual environment:
|
|
48
|
+
|
|
49
|
+
```shell
|
|
50
|
+
python3 -m venv --copies venv
|
|
51
|
+
source venv/bin/activate
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Install woninet from PyPI:
|
|
55
|
+
|
|
56
|
+
```shell
|
|
57
|
+
pip install woninet
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Grant the required capability to the Python interpreter:
|
|
61
|
+
|
|
62
|
+
```shell
|
|
63
|
+
sudo setcap cap_net_raw=eip venv/bin/python3
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Then run:
|
|
67
|
+
|
|
68
|
+
```shell
|
|
69
|
+
woninet --help
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
#### macOS/Windows
|
|
44
73
|
|
|
45
74
|
Install from PyPI:
|
|
46
75
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
# woninet/core/__init__.py
|
|
2
|
-
__version__ = "2.0.
|
|
2
|
+
__version__ = "2.0.3"
|
|
@@ -292,7 +292,7 @@ class NetworkMonitorCore:
|
|
|
292
292
|
ValueError: If IP addresses are not valid.
|
|
293
293
|
"""
|
|
294
294
|
candidate_devices = {}
|
|
295
|
-
if target_ip_list
|
|
295
|
+
if len(target_ip_list) != 0:
|
|
296
296
|
for target_ip in target_ip_list:
|
|
297
297
|
if detect_ip_range(ip=target_ip):
|
|
298
298
|
candidate_devices.update(
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import os
|
|
1
2
|
from pathlib import Path
|
|
2
3
|
from matplotlib import pyplot as plt
|
|
3
4
|
from woninet.database.tables import AlertEventTable
|
|
@@ -9,6 +10,8 @@ class GraphEngine:
|
|
|
9
10
|
"""
|
|
10
11
|
Engine for generating graphs and visualizations of network device metrics.
|
|
11
12
|
"""
|
|
13
|
+
def __init__(self):
|
|
14
|
+
os.makedirs(name=CHARTS_PATH, exist_ok=True)
|
|
12
15
|
|
|
13
16
|
def design_device_latency_events(
|
|
14
17
|
self, ip: str, recent_device_alert_events: list[AlertEventTable]
|
|
@@ -9,10 +9,10 @@ from sqlalchemy.exc import OperationalError
|
|
|
9
9
|
from woninet.core.engine import NetworkMonitorCore
|
|
10
10
|
from woninet.utilities.arguments import args
|
|
11
11
|
from woninet.utilities.logger import get_core_logger, TRACE_LEVEL
|
|
12
|
+
from woninet.utilities.create_configuration import create_config_json
|
|
12
13
|
|
|
13
14
|
# Global Variables
|
|
14
15
|
LOGGING_YAML_PATH = Path(__file__).parent / "logging.yaml"
|
|
15
|
-
CONFIG_JSON_PATH = Path(__file__).parent / "config.json"
|
|
16
16
|
REMOTE_PROBE_IP = "8.8.8.8"
|
|
17
17
|
monitor = None
|
|
18
18
|
|
|
@@ -67,13 +67,29 @@ def load_logging_yaml(log_output: str | None) -> dict:
|
|
|
67
67
|
return config
|
|
68
68
|
|
|
69
69
|
|
|
70
|
-
def load_config_json() -> dict:
|
|
70
|
+
def load_config_json(config_json_path: str) -> dict:
|
|
71
|
+
"""
|
|
72
|
+
Load the application's JSON configuration file.
|
|
73
|
+
|
|
74
|
+
If the configuration file does not exist, create a default one and
|
|
75
|
+
load it again.
|
|
76
|
+
|
|
77
|
+
Args:
|
|
78
|
+
config_json_path (str): Path to the configuration JSON file.
|
|
79
|
+
|
|
80
|
+
Returns:
|
|
81
|
+
dict: Parsed configuration data.
|
|
82
|
+
"""
|
|
71
83
|
try:
|
|
72
|
-
with open(
|
|
84
|
+
with open(config_json_path) as file:
|
|
73
85
|
config = json.load(file)
|
|
74
86
|
return config
|
|
75
87
|
except FileNotFoundError:
|
|
76
|
-
|
|
88
|
+
create_config_json(config_json_path)
|
|
89
|
+
|
|
90
|
+
with open(config_json_path) as file:
|
|
91
|
+
config = json.load(file)
|
|
92
|
+
return config
|
|
77
93
|
|
|
78
94
|
|
|
79
95
|
def configure_logger(arguments: Namespace) -> logging.Logger:
|
|
@@ -178,7 +194,8 @@ def main() -> None:
|
|
|
178
194
|
print(__version__)
|
|
179
195
|
return
|
|
180
196
|
|
|
181
|
-
|
|
197
|
+
config_json_path = arguments.config
|
|
198
|
+
configuration = load_config_json(config_json_path)
|
|
182
199
|
|
|
183
200
|
target_ip = configuration["target_ip_list"]
|
|
184
201
|
port = arguments.port
|
|
@@ -71,6 +71,13 @@ are collected continuously and processed through an alert engine."""
|
|
|
71
71
|
help="Output path for storing logs.",
|
|
72
72
|
)
|
|
73
73
|
|
|
74
|
+
parser.add_argument(
|
|
75
|
+
"--config",
|
|
76
|
+
type=str,
|
|
77
|
+
default="config.json",
|
|
78
|
+
help="Path to the config.json file to load (default: %(default)s).",
|
|
79
|
+
)
|
|
80
|
+
|
|
74
81
|
parser.add_argument(
|
|
75
82
|
"--color",
|
|
76
83
|
type=str,
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import json
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def create_config_json(config_json_path: str) -> None:
|
|
5
|
+
"""
|
|
6
|
+
Create a default configuration JSON file.
|
|
7
|
+
|
|
8
|
+
Args:
|
|
9
|
+
config_json_path: Path where the configuration JSON will be written.
|
|
10
|
+
|
|
11
|
+
The function writes a default configuration template containing monitoring
|
|
12
|
+
settings, database file name, target IP list, and alert rules.
|
|
13
|
+
"""
|
|
14
|
+
template = {
|
|
15
|
+
"monitoring": {
|
|
16
|
+
"arp_noise_limit": 300.0,
|
|
17
|
+
"max_workers": 4
|
|
18
|
+
},
|
|
19
|
+
"database": "woninet.db",
|
|
20
|
+
"target_ip_list": [],
|
|
21
|
+
"alert_rules":[
|
|
22
|
+
{
|
|
23
|
+
"metric": "latency",
|
|
24
|
+
"threshold": 100,
|
|
25
|
+
"consecutive_checks": 3
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"metric": "packet_loss",
|
|
29
|
+
"threshold": 0.0,
|
|
30
|
+
"consecutive_checks": 1
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
with open(config_json_path, "w") as file:
|
|
36
|
+
json.dump(template, file, indent=4)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: woninet
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.3
|
|
4
4
|
Summary: A Python-based ARP+ICMP network monitoring tool
|
|
5
5
|
Author-email: Alireza Teymuri <teymuri.alireza98@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -67,7 +67,36 @@ IPs and filters out Wi‑Fi ARP‑delay noise.)
|
|
|
67
67
|
|
|
68
68
|
**Note:** *woninet* is under active development.
|
|
69
69
|
|
|
70
|
-
## Installation
|
|
70
|
+
## Installation from PyPI
|
|
71
|
+
|
|
72
|
+
### Unix/Linux
|
|
73
|
+
|
|
74
|
+
Create and activate a virtual environment:
|
|
75
|
+
|
|
76
|
+
```shell
|
|
77
|
+
python3 -m venv --copies venv
|
|
78
|
+
source venv/bin/activate
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Install woninet from PyPI:
|
|
82
|
+
|
|
83
|
+
```shell
|
|
84
|
+
pip install woninet
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Grant the required capability to the Python interpreter:
|
|
88
|
+
|
|
89
|
+
```shell
|
|
90
|
+
sudo setcap cap_net_raw=eip venv/bin/python3
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Then run:
|
|
94
|
+
|
|
95
|
+
```shell
|
|
96
|
+
woninet --help
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
#### macOS/Windows
|
|
71
100
|
|
|
72
101
|
Install from PyPI:
|
|
73
102
|
|
|
@@ -55,6 +55,7 @@ woninet/server/templates/device_info.html
|
|
|
55
55
|
woninet/utilities/__init__.py
|
|
56
56
|
woninet/utilities/arguments.py
|
|
57
57
|
woninet/utilities/cli_parser.py
|
|
58
|
+
woninet/utilities/create_configuration.py
|
|
58
59
|
woninet/utilities/detect_ip_range.py
|
|
59
60
|
woninet/utilities/ip_validator.py
|
|
60
61
|
woninet/utilities/logger.py
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|