From: alex Date: Thu, 7 Nov 2024 19:46:24 +0000 (+0100) Subject: Cater for unmonitored hosts X-Git-Url: https://xn--ix-yja.es/gitweb/?a=commitdiff_plain;h=26d419c9a52b140364ffab598062f75fd27177ad;p=alex.git Cater for unmonitored hosts --- diff --git a/personal_infra/pseudo_resource_exporter.py b/personal_infra/pseudo_resource_exporter.py index 9ef498b..fb961c6 100755 --- a/personal_infra/pseudo_resource_exporter.py +++ b/personal_infra/pseudo_resource_exporter.py @@ -47,7 +47,9 @@ ail = subprocess.run(["ansible-inventory", "--list"], check=True, stdout=subproc inventory = json.loads(ail.stdout) total_hosts_in_inventory = len(inventory["_meta"]["hostvars"].keys()) k8s_hosts_in_inventory = len(inventory["k8s"]["hosts"]) -puppet_hosts_in_inventory = total_hosts_in_inventory - k8s_hosts_in_inventory +unmonitored_hosts_in_inventory = len(inventory["unmonitored"]["hosts"]) + +puppet_hosts_in_inventory = total_hosts_in_inventory - k8s_hosts_in_inventory - unmonitored_hosts_in_inventory catalog_files = list(pathlib.Path("build/puppet/build/output/").glob("*/catalog.json"))