Forum Discussion
Anonymous
4 years agoThat looks really good! I'm guessing it's not quite working yet because the format is not right. Your format made me go back and check and I noticed that you mentioned your DS is script, not batchscript. Your output is more consistent with script. I'd say it probably needs to only have one colon.
Other than that, you should be pretty close to good. I just changed this:
$store.Certificates `
| Where-Object {($_.Thumbprint -like "##WildValue##")} `
| Select-Object @{Name = "daystoexpire:"
Expression = {($_.NotAfter - [datetime]::Today).Days}} `
| Format-List
To this:
$store.Certificates `
| Where-Object {($_.Thumbprint -like "##WildValue##")} `
| Select-Object @{Name = "daystoexpire"
Expression = {($_.NotAfter - [datetime]::Today).Days}} `
| Format-List
Then I fixed your datapoint from regex to multi-line key value pair:
I also updated your alert message, moving it from the description to the alert message field in the datapoint configuration. After a poll now, it's working.
Related Content
- 6 months ago