UserParameter=ntp.client.offset,powershell.exe -command "$timesource = (w32tm /query /source).Trim(); $timeoffset = &w32tm /stripchart /dataonly /computer:$timesource /samples:1; [float]($timeoffset[3].Split(' ')[1].TrimEnd('s')) * 1000.0"
UserParameter=nessus.plugins.age,powershell -command "$d = -1; $s = $false; foreach ($_ in &'C:\Program Files\Tenable\Nessus Agent\nessuscli' plugins --info) { if ($s) { if ($_[0] -ne 9) { break } if ($_ -match 'Last downloaded:.+\((?<duration>.+) ago\)') { if ($Matches['duration'] -match '(?<days>\d+) day') { $d = $Matches['days'] } else { $d = 0 } break }} elseif ($_.StartsWith('* full')) { $s = $true; continue }} $d"
UserParameter=nessus.scan.age,powershell -command "$d = -1; $s = $false; foreach ($_ in &'C:\Program Files\Tenable\Nessus Agent\nessuscli' scan-triggers --list) { if ($s) { if ($_[0] -ne 9) { break } if ($_ -match 'Last run: (?<duration>.+) ago') { if ($Matches['duration'] -match '(?<days>\d+) day') { $d = $Matches['days'] } else { $d = 0 } break }} elseif ($_.StartsWith('* Server Weekly Scan')) { $s = $true; continue }} $d"
UserParameter=certlm.my.get_expiring,powershell -command "foreach ($cert in Get-ChildItem -Path Cert:\LocalMachine\My | Sort-Object FriendlyName) { if ($cert.FriendlyName -eq 'CLIUSR') { continue } $life = $cert.NotAfter - $cert.NotBefore; $remaining = $cert.NotAfter - (Get-Date); if ($remaining.TotalDays / $(if ($life.TotalDays -gt 365) { 365 } else { $life.TotalDays }) -lt 0.2) { $cert.FriendlyName; ' - Thumbprint: ' + $cert.Thumbprint; ' - Expires: ' + $cert.NotAfter.ToString('yyyy-MM-dd') }}"
UserParameter=pg.ha.lag,pg ha lag
UserParameter=mirthkeystore.get_expiring,powershell -command "$p = foreach ($l in gc 'C:\Program Files\Mirth Connect\conf\mirth.properties') { if ($l -match '^keystore\.storepass\s*=\s*(?<p>.*)$') { $Matches['p'].Trim() } }; $q = [char]34; $p = $q + $p + $q; $o = keytool -list -v -keystore 'C:\Windows\ServiceProfiles\Mirth Connect Service\AppData\Roaming\Mirth App Data\keystore.jks' -storepass $p 2>$null; function stodt ($s) { [DateTime]::ParseExact($s[4..19+24..27] -join '', 'MMM dd HH:mm:ss yyyy', $null) }; $c = @{}; foreach ($l in $o) { if ($l -match '^Alias name: (?<alias>.*)$') { $c.Alias = $Matches['alias'] } elseif ($l -match '^Entry type: (?<type>.*)$') { $c.Type = $Matches['type'] } elseif ($l -match '^Valid from: (?<from>.*) until: (?<until>.*)$' -and $null -eq $c.From) { $c.From = stodt $Matches['from']; $c.Until = stodt $Matches['until'] } elseif ($l -match '^\*+$') { if ('END' -eq $c) { $c = @{} } else { if ('trustedCertEntry' -ne $c.Type -and 'SecretKeyEntry' -ne $c.Type) { $life = $c.Until - $c.From; $remaining = $c.Until - (Get-Date); if ($remaining.TotalDays / $(if ($life.TotalDays -gt 365) { 365 } else { $life.TotalDays }) -lt 0.2) { $c.Alias; ' - Expires: ' + $c.Until.ToString('yyyy-MM-dd') } }; $c = 'END' } } }"
