mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-01-02 00:07:11 +01:00
add note about network bandwidth permissions and don't set interfaces by default (#7813)
* add note about network bandwidth permissions * Update default net int * Set default network interfaces to empty * Don't read interfaces if none are set * Formatting * Add stderr output
This commit is contained in:
parent
a3eccce8f3
commit
fd9196ae3e
@ -625,7 +625,7 @@ ui:
|
|||||||
|
|
||||||
# Optional: Telemetry configuration
|
# Optional: Telemetry configuration
|
||||||
telemetry:
|
telemetry:
|
||||||
# Optional: Enabled network interfaces for bandwidth stats monitoring (default: shown below)
|
# Optional: Enabled network interfaces for bandwidth stats monitoring (default: empty list, let nethogs search all)
|
||||||
network_interfaces:
|
network_interfaces:
|
||||||
- eth
|
- eth
|
||||||
- enp
|
- enp
|
||||||
@ -640,6 +640,7 @@ telemetry:
|
|||||||
# Enable Intel GPU stats (default: shown below)
|
# Enable Intel GPU stats (default: shown below)
|
||||||
intel_gpu_stats: True
|
intel_gpu_stats: True
|
||||||
# Enable network bandwidth stats monitoring for camera ffmpeg processes, go2rtc, and object detectors. (default: shown below)
|
# Enable network bandwidth stats monitoring for camera ffmpeg processes, go2rtc, and object detectors. (default: shown below)
|
||||||
|
# NOTE: The container must either be privileged or have cap_net_admin, cap_net_raw capabilities enabled.
|
||||||
network_bandwidth: False
|
network_bandwidth: False
|
||||||
# Optional: Enable the latest version outbound check (default: shown below)
|
# Optional: Enable the latest version outbound check (default: shown below)
|
||||||
# NOTE: If you use the HomeAssistant integration, disabling this will prevent it from reporting new versions
|
# NOTE: If you use the HomeAssistant integration, disabling this will prevent it from reporting new versions
|
||||||
|
@ -107,7 +107,7 @@ class StatsConfig(FrigateBaseModel):
|
|||||||
|
|
||||||
class TelemetryConfig(FrigateBaseModel):
|
class TelemetryConfig(FrigateBaseModel):
|
||||||
network_interfaces: List[str] = Field(
|
network_interfaces: List[str] = Field(
|
||||||
default=["eth", "enp", "eno", "ens", "wl", "lo"],
|
default=[],
|
||||||
title="Enabled network interfaces for bandwidth calculation.",
|
title="Enabled network interfaces for bandwidth calculation.",
|
||||||
)
|
)
|
||||||
stats: StatsConfig = Field(
|
stats: StatsConfig = Field(
|
||||||
|
@ -143,6 +143,9 @@ def get_cpu_stats() -> dict[str, dict]:
|
|||||||
|
|
||||||
|
|
||||||
def get_physical_interfaces(interfaces) -> list:
|
def get_physical_interfaces(interfaces) -> list:
|
||||||
|
if not interfaces:
|
||||||
|
return []
|
||||||
|
|
||||||
with open("/proc/net/dev", "r") as file:
|
with open("/proc/net/dev", "r") as file:
|
||||||
lines = file.readlines()
|
lines = file.readlines()
|
||||||
|
|
||||||
@ -171,6 +174,7 @@ def get_bandwidth_stats(config) -> dict[str, dict]:
|
|||||||
)
|
)
|
||||||
|
|
||||||
if p.returncode != 0:
|
if p.returncode != 0:
|
||||||
|
logger.error(f"Error getting network stats :: {p.stderr}")
|
||||||
return usages
|
return usages
|
||||||
else:
|
else:
|
||||||
lines = p.stdout.split("\n")
|
lines = p.stdout.split("\n")
|
||||||
|
Loading…
Reference in New Issue
Block a user