Create a scheduler that allows you to specify a time and day for a monitor to run. For example, when you need to check if a file exists at on a specific day at a specific time.
This is actually a situation where I've found the Powershell monitors come in handy. I've never restricted them to a certain day, but I have several monitors that will make sure a file only exists during a certain time and then that it does not exist outside of that time-frame. The nice thing is that the monitor is always running so that if the file shows up when it shouldn't be expected I get a warning message about that as well since in my case there's the potential to duplicate data. I'm sure the same principal can be applied to a day restriction.
This example is always running, and it only expects the file between 03:30 and 08:00 with a bit of a buffer on either end. I'll get a warning on statistic 4 (found outside of expected time), or critical on statistic 5 (not found when expected).
$now = Get-Date$exMin = Get-Date '03:30'$exMax = Get-Date '08:00'$exMin2 = Get-Date '03:00'$exMax2 = Get-Date '08:15'$noMin = Get-Date '03:45'$noMax = Get-Date '08:00'if (Test-Path -Path \\<share_location>\required_file.csv) { if ($now.TimeOfDay -GT $exMin.TimeOfDay -And $now.TimeOfDay -LT $exMax.TimeOfDay) { Write-Host "Message: Up -File was found during valid time range" Write-Host "Statistic: 0" } elseif ($now.TimeOfDay -LT $exMin2.TimeOfDay -Or $now.TimeOfDay -GT $exMax2.TimeOfDay) { Write-Host "Message: Warning - File exists during unexpected time" Write-Host "Statistic: 4" } else { Write-Host "Message: Up - File was found during valid time range (Buffer time)" Write-Host "Statistic: 2" } }else { if ($now.TimeOfDay -GT $noMin.TimeOfDay -And $now.TimeofDay -LT $noMin.TimeOfDay) { Write-Host "Message: Critical - File not found when expected" Write-Host "Statistic: 5" } else { Write-Host "Message: Up - Outside critical time range (No File)" Write-Host "Statistic: 1" }}
I know I am able to do this. Ops Bridge and the older HPOM has a scheduler built in, where i don't have to worry about creating the schedule in my code. The agent for Ops Bridge and HPOM handles the scheduling and I can control it from the console. This control is especially nice when i don't have a range of times that I am looking for a file, but need a specific time. If something like this was added to the Orion Agent, then it would be easier to potentially sunset one of our monitoring tools.