From 9e704a6ad1e07e74855e113a78d8a489908b2c72 Mon Sep 17 00:00:00 2001 From: Cyberes Date: Mon, 29 Jan 2024 14:19:39 -0700 Subject: [PATCH] update requirements --- checker/nagios.py | 3 --- opnsense_traffic_watcher.py | 9 +++++---- requirements-global.txt | 13 +++++++++++++ requirements.txt | 32 ++++++++------------------------ 4 files changed, 26 insertions(+), 31 deletions(-) diff --git a/checker/nagios.py b/checker/nagios.py index 021391e..70b6aff 100644 --- a/checker/nagios.py +++ b/checker/nagios.py @@ -1,7 +1,4 @@ # TODO: remove non STATE_ vars -import sys - -from checker import print_icinga2_check_status UNKNOWN = STATE_UNKNOWN = -1 OK = STATE_OK = 0 diff --git a/opnsense_traffic_watcher.py b/opnsense_traffic_watcher.py index 68e537b..9c64325 100644 --- a/opnsense_traffic_watcher.py +++ b/opnsense_traffic_watcher.py @@ -1,14 +1,13 @@ import argparse import json import os -import threading -import time -from typing import List - import redis import requests +import threading +import time from flask import jsonify, request, Flask from flask_caching import Cache +from typing import List from urllib3.exceptions import InsecureRequestWarning from checker.units import filesize @@ -26,6 +25,8 @@ if not OPNSENSE_URL or not OPNSENSE_KEY or not OPNSENSE_URL: OPNSENSE_URL = OPNSENSE_URL.strip('/') +# TODO: have background thread be a seperate process + class TrafficEntry: def __init__(self, interface: str, address: str, rate_bits_in: int, rate_bits_out: int, rate_bits: int, cumulative_bytes_in: int, cumulative_bytes_out: int, cumulative_bytes: int, connections: dict, timestamp: float): self.interface = interface diff --git a/requirements-global.txt b/requirements-global.txt index c930c5c..04251b8 100644 --- a/requirements-global.txt +++ b/requirements-global.txt @@ -1 +1,14 @@ check_systemd +psutil==5.9.6 +dnspython==2.3.0 +urllib3==1.26.18 +numpy==1.24.4 +requests==2.31.0 +pillow==9.4.0 +beautifulsoup4==4.11.2 +pandas==2.2.0 +pytz==2023.3.post1 +cf_speedtest==0.1.7 +tiktoken==0.5.2 +zfslib==0.11.0 +hurry.filesize==0.9 diff --git a/requirements.txt b/requirements.txt index ef84c44..48e320b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,25 +1,9 @@ -prometheus_client -requests~=2.31.0 -numpy~=1.24.2 -matrix-nio -Pillow~=9.4.0 -python-magic~=0.4.27 -beautifulsoup4~=4.11.2 -flask~=2.2.3 -icinga2api~=0.6.1 -urllib3~=1.26.14 -aiofiles~=0.6.0 -markdown~=3.4.1 -psutil~=5.9.4 -hurry.filesize -cloudflarepycli~=1.7.0 -zfslib~=0.11.0 -dnspython~=2.3.0 -cf-speedtest -pytz~=2023.3 -proxmoxer==2.0.1 -gunicorn -redis -flask-caching +matrix-nio==0.20.1 +redis==5.0.1 +flask==2.2.5 +icinga2api==0.6.1 +prometheus_client==0.18.0 pysnmp==4.4.12 -pandas==2.0.3 \ No newline at end of file +aiofiles==0.6.0 +python-magic==0.4.27 +markdown==3.4.4