Hi,
I have opened case#260905 as one of our custom script monitors keeps failing, it has been closed already as solarwinds does not offer support for customizations.
I have pinned down the problem to a comparison of dates:
tDiff = DateDiff("n", CDate(Month(Yesterday)&"/1"&"/"&Year(Yesterday)), CDate(Month(Yesterday)+1&"/1"&"/"&Year(Yesterday)))
This sometimes converts to the difference in minutes for one day and sometimes for the whole month (which is what we want).
If I let this run in a loop in a script on the server, this error never appears.
I am assuming, that for some reason the date sometimes gets evaluated as MM/DD/YYYY and sometimes as DD/MM/YYYY.
I have already modified language/regional settings to US even for system accounts but that does not seem to work either.
Does anyone have an idea what could be causing this issue or how to fix it?