Problem with Alert system

Hello,
i have a serious problem with Alerting system.
For example, if i create a test rule (see image)



IF LibreNMS find a machine with hostname equals to “pensiero” ( and i have a machine with this name ) the alerting system will be triggered, right?
And it is so, i receive the first Altert after 8 Minutes ( not 5m )
After this, I should receive the same alert every 10 minutes - infinite times (-1), until status change, right?.

but it does not happen, why?
(i receive only the first CRITICAL alert but nothing more after that)
Please help me to troubleshoot that
Thank you very much

–INFO–

“Monitor” is based on a “Raspberry Pi 2” with Raspbian (Debian)

config.php

<?php

Have a look in includes/defaults.inc.php for examples of settings you can set here. DO NOT EDIT defaults.inc.php!

Database config

$config[‘db_host’] = ‘localhost’;
$config[‘db_user’] = ‘root’;
$config[‘db_pass’] = ‘ohdoishdodhsa87’;
$config[‘db_name’] = ‘librenms’;

// This is the user LibreNMS will run as
//Please ensure this user is created and has the correct permissions to your install
$config[‘user’] = ‘librenms’;

This should only be set if you want to force a particular hostname/port

It will prevent the web interface being usable form any other hostname

$config[‘base_url’] = “/”;

Enable this to use rrdcached. Be sure rrd_dir is within the rrdcached dir

and that your web server has permission to talk to rrdcached.

#$config[‘rrdcached’] = “unix:/var/run/rrdcached.sock”;

Default community

$config[‘snmp’][‘community’] = array(“public”);

Authentication Model

$config[‘auth_mechanism’] = “mysql”; # default, other options: ldap, http-auth
#$config[‘http_auth_guest’] = “guest”; # remember to configure this user if you use http-auth

List of RFC1918 networks to allow scanning-based discovery

#$config[‘nets’] = “10.0.0.0/8”;
#$config[‘nets’] = “172.16.0.0/12”;
#$config[‘nets’] = “192.168.0.0/16”;

Uncomment the next line to disable daily updates

#$config[‘update’] = 0;

Number in days of how long to keep old rrd files. 0 disables this feature

#$config[‘rrd_purge’] = 0;

Uncomment to submit callback stats via proxy

#$config[‘callback_proxy’] = “hostname:port”;

Set default port association mode for new devices (default: ifIndex)

#$config[‘default_port_association_mode’] = ‘ifIndex’;

Enable the in-built billing extension

$config[‘enable_billing’] = 1;

Enable the in-built services support (Nagios plugins)

$config[‘show_services’] = 1;

validate.php output

librenms@Monitor:~$ ./validate.php

Component Version
LibreNMS 06add776858ff19e24c08ad0e53a1c3bf795fe1a
DB Schema 185
PHP 5.6.29-0+deb8u1
MySQL 10.0.30-MariaDB-0+deb8u1
RRDTool 1.4.8
SNMP NET-SNMP 5.7.2.1
==========================================================

[OK] Database connection successful
[OK] Database schema correct
librenms@Monitor:~$

cron status

librenms@Monitor:~$ service cron status
● cron.service - Regular background program processing daemon
Loaded: loaded (/lib/systemd/system/cron.service; enabled)
Active: active (running) since Tue 2017-04-11 11:57:16 CEST; 2 days ago
Docs: man:cron(8)
Main PID: 493 (cron)
CGroup: /system.slice/cron.service
├─493 /usr/sbin/cron -f
├─511 sudo sh /home/pi/vpn.sh
├─547 sh /home/pi/vpn.sh
├─557 sudo openvpn --config pensiero.servizi-web.net.conf
└─573 openvpn --config pensiero.servizi-web.net.conf
librenms@Monitor:~$

cron file

librenms@Monitor:~$ cat /etc/cron.d/librenms

Using this cron file requires an additional user on your system, please see install docs.

33 */6 * * * librenms /opt/librenms/discovery.php -h all >> /dev/null 2>&1
*/5 * * * * librenms /opt/librenms/discovery.php -h new >> /dev/null 2>&1
*/5 * * * * librenms /opt/librenms/cronic /opt/librenms/poller-wrapper.py 16
15 0 * * * librenms /opt/librenms/daily.sh >> /dev/null 2>&1

          • librenms /opt/librenms/alerts.php >> /dev/null 2>&1
            */5 * * * * librenms /opt/librenms/poll-billing.php >> /dev/null 2>&1
            01 * * * * librenms /opt/librenms/billing-calculate.php >> /dev/null 2>&1
            */5 * * * * librenms /opt/librenms/check-services.php >> /dev/null 2>&1

librenms@Monitor:~$

Please apply this this patch and test: https://p.libren.ms/view/33eb7eef

1 Like

Thank you for the reply laf!
patch 33eb7eef applied

root@Monitor:/opt/librenms# patch alerts.php < 33eb7eef.1
patching file alerts.php

So, i have deleted all my alter Rules and add that one

So.

12:03 Rule applied
12:05:26 Rule triggered
12:11 First contact - Mail and Telegram, OK
12:14 Second contact - Mail and Telegram OK
12:17 → OK
12:20 → OK
12:23 → OK
12:26 → OK
and so on.

3 minutes instead of 5m, but works!, great! :slight_smile:

What does “$ noacc = true;”?
In the end it’s my problem? or a general bug?
why if i set 5m, i have 3m between two alerts?
Thank you very much laf! :wink:

Ok so that’s not a fix then.

Please try this instead (revert the old one by doing git checkout alerts.php)

https://p.libren.ms/view/37336535

1 Like

Hi Laf!
Ok,
i’ve reverted alert.php and patched alerts.inc.php with 37336535

librenms@Monitor:~$ patch includes/alerts.inc.php < 37336535
patching file includes/alerts.inc.php
librenms@Monitor:~$

The only warn message from “validate.php” is:

[WARN] Your local git contains modified files, this could prevent automatic updates.
Modified files:
includes/alerts.inc.php

Results:

16:51 Rule applied ( -1 / 5m / 5m )
16:55:24 Rule triggered
17:00 First contact - Mail and Telegram, OK
–3 Minutes–
17:03 Second contact - Mail and Telegram
–4 Minutes–
17:07
–3 Minutes–
17:10
–4 Minutes–
17:14
–3 Minutes–
17:17

Note:

Tolerance window for cron, in General config is equal to “120” seconds

“Monitor” have ntpd set to lan UPPS “Atomic Clock”

root@Monitor:/opt/librenms# date
Sun 16 Apr 17:14:27 CEST 2017
root@Monitor:/opt/librenms# ntpq -p
remote refid st t when poll reach delay offset jitter

-213.251.52.250 193.62.22.74 2 u 39 1024 377 80.618 4.567 13.133
+host209-165-213 193.204.114.233 2 u 658 1024 377 83.845 3.300 19.489
-radha.parvati.i 193.204.114.233 2 u 150 1024 377 83.444 5.862 15.425
+host69-172-177- 79.143.250.152 2 u 342 1024 377 84.796 1.258 21.829
*tempo .UPPS. 1 u 1028 1024 377 0.537 -0.145 0.283
root@Monitor:/opt/librenms#

Thanks for the precious help Laf :relieved:

With patch 37336535 and “Tolerance window for cron” == 5 seconds

17:25:23 Rule triggered
–8 Minutes– ( instead of 5m )
17:33 First contact - Mail and Telegram, OK
–5 Minutes-- ( ok )
17:38 Second Contact
–5 minutes-- ( ok )
17:43
– 5 minutes-- ( ok )
17:48
–5 minutes-- ( ok )
17:53
–5 minutes-- ( ok )
17:58
–5 minutes-- ( ok )
18:03

With ten minutes Interval:

it works!

it was a bug, or my individual problem?
Thanks

It’s a bug :slight_smile:

OK, so this will be implemented in future version?
i mean patch 37336535
let me know if i can update my installation or not
Thanks

It’s not in the master branch so revert that patch by doing git checkout includes/alerts.inc.php and then run ./daily.sh