From 379727febb0010440b3f36e6b8d3385c278446af Mon Sep 17 00:00:00 2001 From: Koos85 Date: Tue, 12 Sep 2023 12:44:28 +0200 Subject: [PATCH] guid --- README.md | 2 +- lib/check/hypervguest.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index afad471..0057b52 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ asset: check: "hypervguest" config: address: "192.168.1.2" - guuid: "342934292923129393" + guid: "01234567-0123-0123-0123-0123456789AB" ``` Run the probe with the `DRY_RUN` environment variable set the the yaml file above. diff --git a/lib/check/hypervguest.py b/lib/check/hypervguest.py index 4e1dda8..213f876 100644 --- a/lib/check/hypervguest.py +++ b/lib/check/hypervguest.py @@ -163,9 +163,9 @@ async def check_hypervguest( config: dict) -> dict: conn, service = await wmiconn(asset, asset_config, config) - guuid = config.get('guuid') - if guuid is None: - logging.error(f'missing guuid for {asset}') + guid = config.get('guid') + if guid is None: + logging.error(f'missing guid for {asset}') raise IgnoreResultException query = Query(f""" SELECT @@ -180,7 +180,7 @@ async def check_hypervguest( LastApplicationConsistentReplicationTime, LastReplicationTime, LastSuccessfulBackupTime, EnhancedSessionModeState, HwThreadsPerCoreRealized - FROM Msvm_ComputerSystem WHERE Name = '{guuid}' + FROM Msvm_ComputerSystem WHERE Name = '{guid}' """, namespace=r'root\virtualization\v2') try: rows = await wmiquery(conn, service, query)