Forum Discussion
Outputs need to be numeric.
Therefore you need to translate the Error into like 1 and then on the threshold make it = 1 to alert and define a note saying like:
Success=0, Error=1,2=Unknown
As for dates you would probably want to convert it into like NewestFileDate_DaysAgo and alert when its > x days ago.
Yes, but I want the email to include the filename that triggers the alert.
- Justin_Lanoue10 hours ago
Advisor
If you're okay with only checking every 15 minutes, you could turn this into an active discovery script and make the filename the wildalias or a property that gets discovered and then in your alert email reference the instance or property name with like ##INSTANCE## or ##PROPERTYNAME##.
- 9 hours ago
Did not check it, could not find any good documentation about this how to implement.
- Justin_Lanoue9 hours ago
Advisor
I don't currently have time to write it but basically you want the active discovery script out to be like below in the format of "WILDVALUE##WILDALIAS##DESCRIPTION"
Write-Host "NewestFile##NewestFile##NewestFileDate"
This will discover an instance.
Then to output values on that instance in your collection script, you need to format like "NewestFile.NumberofFiles=Value"
It's a little messy and you might want to have the discovery script discover like a "Dummy" instance to display your NumberofFiles datapoint always and then when that file you want to alert on gets discovered, maybe have script logic to only alert on instances that aren't called "Dummy" with an "Alert" datapoint if that makes sense.