Cannot add new alert rule

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

Hi, maybe this is a dumb question,

I trying to create new alert rule from collection (ex:device rebooted). When I click save rule, warning pop-up show up with text Failed to Process Rules


image

Blockquote
[email protected]:/opt/librenms# ./validate.php
====================================
Component | Version
--------- | -------
LibreNMS | 1.50-51-g39ff4c7aa
DB Schema | 2019_02_10_220000_add_dates_to_fdb (132)
PHP | 7.2.15-0ubuntu0.18.04.2
MySQL | 10.1.38-MariaDB-0ubuntu0.18.04.1
RRDTool | 1.7.0
SNMP | NET-SNMP 5.7.3
====================================
[OK] Composer Version: 1.8.5
[OK] Dependencies up-to-date.
[OK] Database connection successful
[OK] Database schema correct
[WARN] Some devices have not been polled in the last 5 minutes. You may have performance issues.
[FIX]:
Check your poll log and see: http://docs.librenms.org/Support/Performance/
Devices:
xxx.xxx.xxx.xxx
xxx.xxx.xxx.xxx
[FAIL] Some devices have not completed their polling run in 5 minutes, this will create gaps in data.
[FIX]:
Check your poll log and see: http://docs.librenms.org/Support/Performance/
Devices:
xxx.xxx.xxx.xxx
xxx.xxx.xxx.xxx
[FAIL] Discovery has not completed in the last 24 hours.
[FIX]:
Check the cron job to make sure it is running and using discovery-wrapper.py

What should I do? Thanks in advance!

Can’t immediately see any issue from the screenshot, (except for https:// as a procedure url you could try delete that bit)

Did you try to re-create manually?

Can you create any other alert rules?

I just created it in the demo https://demo.librenms.org/alert-rules/ from collection and manually but all works fine as expected.

yep, i’ve try to copy exactly same as default alert. and it showing “failed to process rule”.
any error log I can search for this error?

Thanks!

So you can’t create any alert rules?

You can check logs/librenms.log to see if it has any errors.

yep. I cannot create any alert rules.

seems like no error log in my libtenms.log.

/opt/librenms/poller.php 347 2019-04-26 16:47:11 - 1 devices polled in 0.935 secs

/opt/librenms/poller.php 637 2019-04-26 16:47:11 - 1 devices polled in 0.681 secs
/opt/librenms/poller.php 638 2019-04-26 16:47:11 - 1 devices polled in 0.695 secs
/opt/librenms/poller.php 1242 2019-04-26 16:47:11 - 1 devices polled in 0.409 secs
/opt/librenms/poller.php 1509 2019-04-26 16:47:11 - 1 devices polled in 0.389 secs
/opt/librenms/poller.php 908 2019-04-26 16:47:11 - 1 devices polled in 2.450 secs
/opt/librenms/poller.php 1257 2019-04-26 16:47:12 - 1 devices polled in 26.34 secs
/opt/librenms/poller.php 1358 2019-04-26 16:47:13 - 1 devices polled in 4.494 secs
/opt/librenms/poller.php 62 2019-04-26 16:47:13 - 1 devices polled in 12.08 secs
/opt/librenms/poller.php 624 2019-04-26 16:47:14 - 1 devices polled in 35.06 secs

please advice

any advice?

Maybe try a different browser?

Is this a new install?

What happens if you map the alert to the 1 device you have, same error ?

Can you edit alert templates successfully ?

Can you show output

ls -l /opt/librenms/includes/html/modal/new_alert_rule.inc.php

Is this a new install?
yep, i’ve migrated to new server. its same result.

What happens if you map the alert to the 1 device you have, same error ?
same error

Can you edit alert templates successfully ?
same error

Can you show output

please advice

find some interesting field in /opt/librenms/includes/html/modal/new_alert_rule.inc.php

is this a bug?

image

I wouldn’t say that is related to your problem, since you can’t edit alert templates it’s failing somewhere else down the line.

Did you try in a different web browser ?

try add /debug=true to the end of your URL and try again, do you see any more info after creating the rule?

Also check developer javascript console.

try re-run

chown -R librenms:librenms /opt/librenms
setfacl -d -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/
setfacl -R -m g::rwx /opt/librenms/rrd /opt/librenms/logs /opt/librenms/bootstrap/cache/ /opt/librenms/storage/

show output of git status in /opt/librenms

check apache logs also for any errors.

Hi! I found the problem!

The problem is false positive from mod_security, It think that SQL injection. haha. som I whitelist my IP.
thanks for your help!

1 Like

I was experiencing a similar issue “Failed to process template” error when making any changes to alerts or templates via the WebUI. The folks over in Discord helped me fix it like this:

sudo su librenms
cd /opt/librenms
./scripts/composer_wrapper.php install && ./scripts/composer_wrapper.php install --no-dev