none
Can you restrict dashboard alerts to certain hours? how? RRS feed

  • Question

  • Hi,

    We have alerts set up to notify us that a processor is exceeding the expected cpu usage.

    However, during the night we run some batch jobs.  So high usage is expected.  I don't want to get the alerts when the batch jobs are running.  Is there a way to eliminate certain hours from alert firing.  For example, I'd like an alert to fire when  the CPU % utilization is over 50% during the hours of 6:00 AM ET and 11:00 PM ET (i.e. not between the hours of 11:01 PM and 5:59 AM ET.

    Thanks.

    Tuesday, May 14, 2019 8:03 PM

Answers

  • Hi paulthc, 

    AFAIK currently there is no such feature supported to explicitly mention the time of a day at which an alert should not get fired (even on reaching the threshold set).  I recommend navigating to the either this and/or this link(s) and providing your feedback and suggestions to improve the product better. Hope this helps!!

    However, IMHO, to accomplish your requirement of eliminating alert getting generated or fired in certain particular hours, you may customize and write your query as required i.e., please find below sample query which gets CPU % utilization from 6AM to 11PM UTC. Note that you may have to tweak the below query as required i.e., mainly w.r.t changing numbers of below HourVar condition from UTC hours to ET hours as required.

    Perf| where CounterName == @"% Processor Time"| where ( InstanceName == "_Total" )| extend HourVar = hourofday(TimeGenerated)| where HourVar < 23 and HourVar > 6| summarize AggregatedValue= avg(CounterValue) by Computer, bin(TimeGenerated, 30s), HourVar

    Another way to accomplish your requirement is by having a simple CPU % utilization queried alert but disable the alert at 11PM and enable it back at 6AM automatically by leveraging Azure CLI / REST API and scheduling this automation(s) to execute at required time i.e., at 11PM and 6AM.

    Hope this helps!!
    Wednesday, May 15, 2019 1:12 PM
    Moderator

All replies

  • Hi paulthc, 

    AFAIK currently there is no such feature supported to explicitly mention the time of a day at which an alert should not get fired (even on reaching the threshold set).  I recommend navigating to the either this and/or this link(s) and providing your feedback and suggestions to improve the product better. Hope this helps!!

    However, IMHO, to accomplish your requirement of eliminating alert getting generated or fired in certain particular hours, you may customize and write your query as required i.e., please find below sample query which gets CPU % utilization from 6AM to 11PM UTC. Note that you may have to tweak the below query as required i.e., mainly w.r.t changing numbers of below HourVar condition from UTC hours to ET hours as required.

    Perf| where CounterName == @"% Processor Time"| where ( InstanceName == "_Total" )| extend HourVar = hourofday(TimeGenerated)| where HourVar < 23 and HourVar > 6| summarize AggregatedValue= avg(CounterValue) by Computer, bin(TimeGenerated, 30s), HourVar

    Another way to accomplish your requirement is by having a simple CPU % utilization queried alert but disable the alert at 11PM and enable it back at 6AM automatically by leveraging Azure CLI / REST API and scheduling this automation(s) to execute at required time i.e., at 11PM and 6AM.

    Hope this helps!!
    Wednesday, May 15, 2019 1:12 PM
    Moderator
  • Thank you for your help.  Naturally, I was looking for a way to do this using the GUI instead of an api-based approach or custom query.  But it is actually very helpful to know this feature does not exist so I don't need to spend time looking for it.  But it would seem to be a useful feature, right?

    THANKS for your quick response and constructive suggestions.

    Friday, May 17, 2019 2:22 PM
  • Hi paulthc,

    Yeah! I agree that it is a useful feature. For these kind of scenarios only we check consolidated feedback and suggestions here that would help to improve the product better. And clicking the vote button of the feedback or suggestion raises visibility and priority on it.

    A good news for you is that now the new Action Rules, available in preview, add more flexibility and finer controls for Action Groups. Action Rules makes it easy to scale Actions Groups or suppress alerts during a maintenance window.

    For more information, please refer this blog update.

    Hope this helps you even better!! Cheers!! :)

    Monday, May 20, 2019 4:42 PM
    Moderator
  • As an update, it looks like Microsoft has solved my problem with the addition of Suppression type Action Rules.  I'm trying it out tonight.

    More info for others who may be interested can be found here:  https://docs.microsoft.com/en-us/azure/azure-monitor/platform/alerts-action-rules

    Good luck!

    Thursday, August 22, 2019 9:14 PM
  • FYI,

    I tried out the Suppression feature for Action Rules - it works great for me!

    Thanks.

    Friday, September 20, 2019 1:18 PM