http://www.perlmonks.org?node_id=1011734


in reply to Dynamic thresholds in report

Dynamic how?

Based on previous results? For example, if there are a lot of anomalies (unwanted http error codes, lots of offending urls), the threshold are tuned down so that not every anomaly triggers a page? Or if things have been quiet for the last couple of days, but suddenly in the last hour there's a peak of anomalies, you somehow want to reflect this in the value of your threshold? You'd have to define the possible scenarios and how the thresholds are to react to this. Then you'll have to work out a system that will detect these scenarios and apply the required dynamics. Then you'll have to implement that in code.

Based on the time of the day? For example, the threshold vary from hour to hour — medium in the morning, high during the afternoon, medium again until midnight, and low from midnight until 7am. You could write a subroutine that looks at the time of the day and adjusts thresholds accordingly. Or your report script could accept threshold values as command line arguments, as in hourly-report-tool --http404=minimal --http500=low --http302=maximal --offurl=supermax and then set up cron tabs to call the tool with the right arguments at the right times.

Based on the phase of the moon and a little divination? Sorry, I'm not into this kind of esoteric knowledge.

Just kidding, of course. But what I mean to say is that, without a little more context or background information, it's hard to know what you mean with "dynamic." What kind of reports are you building exactly? What kind of information is collected? How is this information processed? What is reported? What does it mean to "intelligently send pages"? Do you want (your users) to be in control of the 'dynamicity' or do you want your tool to be able to adjust those thresholds yourself? What do you even mean by thresholds? How many are there? What do they regulate? How?