Skip to content

Commit

Permalink
configurable network interface monitoring
Browse files Browse the repository at this point in the history
  • Loading branch information
suparious committed Jun 10, 2024
1 parent ae891c8 commit 5eb318a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions config-example.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
servers:
- name: ServerOne
address: http://ServerOne:9100
network_interface: eno1
- name: ServerTwo
address: http://ServerTwo:9100
network_interface: enp7s0

dashboard:
host: 0.0.0.0
Expand Down
2 changes: 1 addition & 1 deletion metrics/collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def collect_metrics(redis_client):
logger.info(f"Collected metrics from {server['name']}: {data}")
cpu_usage = aggregate_cpu_usage(data)
disk_usage = aggregate_disk_usage(data)
network_io = aggregate_network_io(data)
network_io = aggregate_network_io(data, interface=server.get('network_interface', 'eno1'))
metrics[f'{server["name"]}_cpu_usage'].set(cpu_usage)
metrics[f'{server["name"]}_memory_usage'].set(data.get('node_memory_MemTotal_bytes', 0))
metrics[f'{server["name"]}_gpu_usage'].set(data.get('nvidia_gpu_utilization', 0)) # Ensure correct key
Expand Down

0 comments on commit 5eb318a

Please sign in to comment.