Hi,
if i execute this command von my hyper-v server icinga { Invoke-IcingaCheckHyperVSnapshot -ActiveVms -IncludeVms '*vm*' -Verbosity 2 -CreationTimeWarning 7776000 }
The documentation says the time is in seconds. To the 7776000 seconds are 90 days.
But the output shows
[OK] VM Snapshots: 31 Ok
_ [OK] pcvmtestBM01
_ [OK] pcvmtestBM01 08.11.2024 09:54:13
_ [OK] Snapshot Description: Prüfpunkteinstellungen für den virtuellen Computer.
_ [OK] Snapshot Name: pcvmtestBM01 - (24.10.2024 - 17:10:18)
_ [OK] Snapshot Size: 51.66KiB
_ [OK] pcvmtestBM01 15.04.2025 12:24:37
_ [OK] Snapshot Description: Prüfpunkteinstellungen für den virtuellen Computer.
_ [OK] Snapshot Name: pcvmtestBM01 - domain.de u. local User (14.04.2025 - 17:26:16)
_ [OK] Snapshot Size: 51.80KiB
_ [OK] pcvmtestBM01 C: Count: 2c
_ [OK] pcvmtestBM01 C: Snapshot count prediction: 7366765c
_ [OK] pcvmtestBM01 C: Total Snapshot Size: 103.46KiB
_ [OK] pcvmtestBM01: Latest Snapshot Creation Delta: 57.13d
_ [OK] pcvmtestBM01: Latest Snapshot Description: Prüfpunkteinstellungen für den virtuellen Computer.
_ [OK] pcvmtestBM01: Latest Snapshot Name: pcvmtestBM01 - domain.de u. local User (14.04.2025 - 17:26:16)
So, you can see that the initial snapshot is much older then 90 days. Did anyone know where my issue is, or is that a bug and i should open a issue on github?
Thank you very much for your reply. What exactly would you like to achieve in this example?
The output of the plugin is correct, because 57.13d is lower than your 90d threshold.
If you want to get a notification if the last snapshot is lower than 90d, you will have to add a : at the end of the threshold to change the internal comparison, example:
If you want to receive alerts if the last snapshot is greater than your threshold, you can use the threshold as you did, you will just need to lower the time.
By the way, please note that you can write your time as 7776000, but you can also write 90d. The Icinga for Windows plugins will automatically translate those values properly.
I hope this helps. If you have more questions, please feel free to ask them.