Bug? "Max Alerts -1" and "Interval 0" has not the documented effect

<%- if @topic_view.topic.tags.present? %>
<%= t 'js.tagging.tags' %>: <%- @topic_view.topic.tags.each do |t| %> <%= t %> <%- end %>
<% end %>

Maybe this is a bug, maybe the popup help is wrong:

when You define an alert rule, the popup help over “Max alerts” reads:
" (…) -1 means no limit. If Interval is 0, this has no effect."

From my understanding it means, if “Interval” is set to 0, the value of “Max alerts” is ignored. The rule in the above screenshot sends me alerts continuously on a one minute basis. If I set “Max alerts” to 1, the rule works as desired.

So either I got it all wrong or the documentation/popup help information is wrong or the values aren’t used as it is described.

Now, in the docs under https://docs.librenms.org/Alerting/Rules/#options the text omits the information with “interval is 0” and therefor seems much clearer. So I guess the code works as designed, but the information in the pop up is ambiguous? Or is it my non-native English?

I think you’re right: it’s working as intended, but the popup help needs tweaking.

If you set an interval of zero you are saying you want an alert to be generated “instantly” i.e. every 60 seconds when cron for alerts.php runs.

Your experiment proves this with an alert generated every 60 seconds for ever with Max Alerts = -1.

Code contributes are welcome. Librenms is not business it depends on users submit changes and fixes like this.

1 Like