mirror of
https://github.com/thegeeklab/prometheus-pve-sd.git
synced 2024-11-25 19:00:41 +00:00
feat: add node hostname info to discovery info logging (#388)
Co-authored-by: Robert Kaussow <xoxys@rknet.org>
This commit is contained in:
parent
edf8082b31
commit
8dad3ae9dd
@ -156,8 +156,9 @@ class Discovery():
|
|||||||
@PROPAGATION_TIME.time()
|
@PROPAGATION_TIME.time()
|
||||||
def propagate(self):
|
def propagate(self):
|
||||||
self.host_list.clear()
|
self.host_list.clear()
|
||||||
|
nodelist = self._get_names(self.client.get_nodes(), "node")
|
||||||
for node in self._get_names(self.client.get_nodes(), "node"):
|
self.logger.info(f"Discovered nodes: {','.join(nodelist)}")
|
||||||
|
for node in nodelist:
|
||||||
try:
|
try:
|
||||||
qemu_list = self._filter(self.client.get_all_vms(node))
|
qemu_list = self._filter(self.client.get_all_vms(node))
|
||||||
container_list = self._filter(self.client.get_all_containers(node))
|
container_list = self._filter(self.client.get_all_containers(node))
|
||||||
@ -169,7 +170,7 @@ class Discovery():
|
|||||||
instances.update(self._get_variables(container_list, "container"))
|
instances.update(self._get_variables(container_list, "container"))
|
||||||
|
|
||||||
HOST_GAUGE.set(len(instances))
|
HOST_GAUGE.set(len(instances))
|
||||||
self.logger.info(f"Found {len(instances)} targets")
|
self.logger.info(f"{node}: Found {len(instances)} targets")
|
||||||
for host in instances:
|
for host in instances:
|
||||||
host_meta = instances[host]
|
host_meta = instances[host]
|
||||||
vmid = host_meta["proxmox_vmid"]
|
vmid = host_meta["proxmox_vmid"]
|
||||||
|
Loading…
Reference in New Issue
Block a user