Hello everyone. I'm new to this site so please bear with me. Got recommended to this site by a colleague of mine who raves about it. Anyway, i have a set of SQL Agent jobs that one of our clients wants me to monitor for as they are daily processing jobs for their day to day business. These particular SQL jobs run every 1 minute throughout the day, 24/7. Which is fine & i've been able to create a DB view & SQL monitoring job that i use to track the activity of those jobs with a threshold of 15 mins. So I'm looking at job activity to ensure these specific jobs do not run over 15 mins or hadn't run in the last 15 mins for whatever reason, otherwise i deem them to be exceptions and i send out a notification to our DBA support team to act accordingly. My issue lies with a new set of these daily processing jobs that don't fall in that 24/7 runtime but have their own isolated schedules. One of them runs every 1 minute but ONLY between 1am - 7pm. And another only runs every 1 min but ONLY from 9am - 5pm each day.
Been searching around but can't seem to find a solution that will allow me to continue my regular monitoring for the other processing jobs i need to monitor around the clock but also (hopefully in the same job or view), isolate the above mentioned exceptions as i don't want to receive notification emails during those specific times for those (2) specific jobs. I'm getting false alerts for those two jobs otherwise during their off peak times. Can anyone assist me? I have attached a file with the logic for both my DB view and the SQL job logic i use that calls that view.