diff --git a/Custom Sensors/EXEXML/Get-SSLReport.psm1 b/Custom Sensors/EXEXML/Get-SSLReport.psm1 index 76873a5..c08b588 100644 --- a/Custom Sensors/EXEXML/Get-SSLReport.psm1 +++ b/Custom Sensors/EXEXML/Get-SSLReport.psm1 @@ -38,6 +38,7 @@ You can easily parse this using `Get-SSLReport -servername example.com | Convert 2019-11-22 Version 0.1 Initial Version 2021-03-19 Version 0.1.1 Updated input from "host" to match parameter name of function "ServerName" 2022-06-07 Version 0.1.2 Updated error handling +2022-06-07 Version 0.1.3 Improve cache behavior .EXAMPLE @@ -124,9 +125,11 @@ function Get-SSLReport { ) # Construct the URI part for Caching - if ($MaxCacheAgeHours -eq 0) - { + if ($MaxCacheAgeHours -eq 0) { + $MaxCacheAgeHours -eq 1 $cacheString = "&startNew=on" + } elseif ($MaxCacheAgeHours -lt 0) { + $cacheString = "" } else { $cacheString = "&fromCache=on&maxAge=$MaxCacheAgeHours" } @@ -155,10 +158,10 @@ function Get-SSLReport { { "IN_PROGRESS" { Write-Verbose "Scan is in progress. Waiting." - start-sleep -Seconds 10; return Get-SSLReport -serverName $serverName -maxCacheAge $maxCacheAge -timeoutSec $timeoutSec } + start-sleep -Seconds 10; return Get-SSLReport -serverName $serverName -maxCacheAge -1 -timeoutSec $timeoutSec } "DNS" { Write-Verbose "Scan is in progress. Waiting." - start-sleep -Seconds 10; return Get-SSLReport -serverName $serverName -maxCacheAge $maxCacheAge -timeoutSec $timeoutSec } + start-sleep -Seconds 10; return Get-SSLReport -serverName $serverName -maxCacheAge -1 -timeoutSec $timeoutSec } "ERROR" { throw $parsed.statusMessage } diff --git a/Custom Sensors/EXEXML/QualysSSLReport.ps1 b/Custom Sensors/EXEXML/QualysSSLReport.ps1 index 7fe5a83..a0f2a87 100644 --- a/Custom Sensors/EXEXML/QualysSSLReport.ps1 +++ b/Custom Sensors/EXEXML/QualysSSLReport.ps1 @@ -29,6 +29,7 @@ System.String. A JSON string that PRTG can understand as a custom sensor .NOTES 2019-11-22 Version 0.1 Initial Version +2022-06-07 Version 0.1.2 Updated error handling .EXAMPLE diff --git a/README.md b/README.md index 2009857..efbc703 100644 --- a/README.md +++ b/README.md @@ -26,4 +26,5 @@ Use at least 1 hour. |------------|---------------|-------------| |2019-11-22 | Version 0.1 | Initial Version | |2021-03-19 | Version 0.1.1 | Updated input from "host" to match parameter name of function "ServerName" | -|2022-06-07 | Version 0.1.2 | Updated error handling | \ No newline at end of file +|2022-06-07 | Version 0.1.2 | Updated error handling | +|2022-06-07 | Version 0.1.3 | Improve cache behavior | \ No newline at end of file