Problem with the Mail Alerting
![](https://secure.gravatar.com/avatar/cf3b2233e1b538045e761614bbfdc245.jpg?s=120&d=mm&r=g)
Hello,
Since lot of days I tried to configure the email alert in observium but it's impossible to receive some alert emails.... :(
you can see there, a part of my config.php
// Mailer backend Settings
$config['email']['enable'] = TRUE; // Enable/Disable email globally $config['email']['from'] = '"OBSERVIUM Network Monitor" <observium@s****.fr>'; // Mail from. Default: "Observium" <observium@`hostname`> $config['email']['default'] = "d*****@gmail.com"; // Default alert recipient $config['email']['default_only'] = TRUE; // Only use default recipient (all alerts send to default recipient) $config['email']['backend'] = 'sendmail'; // Mail backend. Allowed: "mail" (PHP's built-in), "sendmail", "smtp". // sendmail backend specific options $config['email']['sendmail_path'] = '/usr/sbin/sendmail'; // The location of the sendmail program. // smtp backend specific options $config['email']['smtp_host'] = 'localhost'; // Outgoing SMTP server name. $config['email']['smtp_port'] = 25; // The port to connect. $config['email']['smtp_timeout'] = 10; // SMTP connection timeout in seconds. $config['email']['smtp_secure'] = NULL; // Enable encryption. Use 'tls' or 'ssl' $config['email']['smtp_auth'] = FALSE; // Whether or not to use SMTP authentication. $config['email']['smtp_username'] = NULL; // SMTP username. $config['email']['smtp_password'] = NULL; // Password for SMTP authentication.
// Alerting Settings
$config['poller-wrapper']['alerter'] = TRUE; $config['alerts']['bgp']['whitelist'] = NULL; // Populate as an array() with ASNs to alert on. $config['alerts']['port']['ifdown'] = TRUE; // Generate alerts for ports that go down $config['alerts']['port']['ifdown_types'] = array('core', 'transit', 'peering');
// Port bandwidth threshold percentage %age utilisation above this will cause an alert
$config['alerts']['port_util_alert'] = FALSE; // Disabled as default //$config['alerts']['port_util_alert'] = TRUE; // Disabled as default $config['alerts']['port_util_perc'] = 85; // %age above which to alert
$config['uptime_warning'] = "60"; // Time in seconds to display a "Device Rebooted" Alert. 0 to disable warnings.
I tried different config, but nothing is working and with this config when I do a test, I receive the e-mail in my gmail box, but nothing about port down or bgp session down...
php ./test_mail.php -d -h sto-rtr-edge-*****.lan CMD[/bin/hostname -f] RUNTIME[0.0302s] OUTPUT[ pu1-webnoc.s****.lan ] Observium v0.14.9.5798 Test E-mail Configuration
My Hostname: pu1-webnoc.s****.lan E-mails ENABLED globally E-mails use SENDMAIL backend sendmail path: [/usr/sbin/sendmail] E-mails send only to default email E-mails use these default recipient(s): d*****@gmail.com E-mails send from: observium@s****.fr
SQL[SELECT * FROM `devices` WHERE `hostname` LIKE 'sto-rtr-edge-a****.s****.lan'] Try send test notification for sto-rtr-edge-a****.s****.lan to these email(s): d*****@gmail.com
SQL[SELECT attrib_value FROM devices_attribs WHERE `device_id` = '35' AND `attrib_type` = 'disable_notify']
SQL[SELECT DISTINCT `contact_method` FROM `alert_contacts` WHERE `contact_disabled` = 0 AND `contact_id` IN (SELECT `alert_contact_id` FROM `alert_contacts_assoc` WHERE `alert_checker_id` = '');] Notification for sto-rtr-edge-a****.s****.lan SENT.
And I didn't see anything in /var/log/mail.log, I see only my test.
Thanks for your time
David
![](https://secure.gravatar.com/avatar/0fa97865a0e1ab36152b6b2299eedb49.jpg?s=120&d=mm&r=g)
You've copy pasted a load of crap that you dont need (and half of it doesn't do anything).
You only need:
$config['email']['default'] = "d*****@gmail.com"; // Default alert recipient
$config['email']['default_only'] = TRUE; // Only use default recipient (all alerts send to default recipient)
Adam.
Sent with AquaMail for Android http://www.aqua-mail.com
On 12 September 2014 10:27:16 SCHEIN David dschein@seres.fr wrote:
Hello,
Since lot of days I tried to configure the email alert in observium but it's impossible to receive some alert emails.... :(
you can see there, a part of my config.php
// Mailer backend Settings
$config['email']['enable'] = TRUE; // Enable/Disable email globally $config['email']['from'] = '"OBSERVIUM Network Monitor" <observium@s****.fr>'; // Mail from. Default: "Observium" <observium@`hostname`> $config['email']['default'] = "d*****@gmail.com"; // Default alert recipient $config['email']['default_only'] = TRUE; // Only use default recipient (all alerts send to default recipient) $config['email']['backend'] = 'sendmail'; // Mail backend. Allowed: "mail" (PHP's built-in), "sendmail", "smtp". // sendmail backend specific options $config['email']['sendmail_path'] = '/usr/sbin/sendmail'; // The location of the sendmail program. // smtp backend specific options $config['email']['smtp_host'] = 'localhost'; // Outgoing SMTP server name. $config['email']['smtp_port'] = 25; // The port to connect. $config['email']['smtp_timeout'] = 10; // SMTP connection timeout in seconds. $config['email']['smtp_secure'] = NULL; // Enable encryption. Use 'tls' or 'ssl' $config['email']['smtp_auth'] = FALSE; // Whether or not to use SMTP authentication. $config['email']['smtp_username'] = NULL; // SMTP username. $config['email']['smtp_password'] = NULL; // Password for SMTP authentication.
// Alerting Settings
$config['poller-wrapper']['alerter'] = TRUE; $config['alerts']['bgp']['whitelist'] = NULL; // Populate as an array() with ASNs to alert on. $config['alerts']['port']['ifdown'] = TRUE; // Generate alerts for ports that go down $config['alerts']['port']['ifdown_types'] = array('core', 'transit', 'peering');
// Port bandwidth threshold percentage %age utilisation above this will cause an alert
$config['alerts']['port_util_alert'] = FALSE; // Disabled as default //$config['alerts']['port_util_alert'] = TRUE; // Disabled as default $config['alerts']['port_util_perc'] = 85; // %age above which to alert
$config['uptime_warning'] = "60"; // Time in seconds to display a "Device Rebooted" Alert. 0 to disable warnings.
I tried different config, but nothing is working and with this config when I do a test, I receive the e-mail in my gmail box, but nothing about port down or bgp session down...
php ./test_mail.php -d -h sto-rtr-edge-*****.lan CMD[/bin/hostname -f] RUNTIME[0.0302s] OUTPUT[ pu1-webnoc.s****.lan ] Observium v0.14.9.5798 Test E-mail Configuration
My Hostname: pu1-webnoc.s****.lan E-mails ENABLED globally E-mails use SENDMAIL backend sendmail path: [/usr/sbin/sendmail] E-mails send only to default email E-mails use these default recipient(s): d*****@gmail.com E-mails send from: observium@s****.fr
SQL[SELECT * FROM `devices` WHERE `hostname` LIKE 'sto-rtr-edge-a****.s****.lan'] Try send test notification for sto-rtr-edge-a****.s****.lan to these email(s): d*****@gmail.com
SQL[SELECT attrib_value FROM devices_attribs WHERE `device_id` = '35' AND `attrib_type` = 'disable_notify']
SQL[SELECT DISTINCT `contact_method` FROM `alert_contacts` WHERE `contact_disabled` = 0 AND `contact_id` IN (SELECT `alert_contact_id` FROM `alert_contacts_assoc` WHERE `alert_checker_id` = '');] Notification for sto-rtr-edge-a****.s****.lan SENT.
And I didn't see anything in /var/log/mail.log, I see only my test.
Thanks for your time
David
observium mailing list observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
![](https://secure.gravatar.com/avatar/21caf0a08d095be7196a1648d20942be.jpg?s=120&d=mm&r=g)
On 09/12/2014 11:25 AM, SCHEIN David wrote:
I tried different config, but nothing is working and with this config when I do a test, I receive the e-mail in my gmail box, but nothing about port down or bgp session down…
If test mail works, your config works. If you don't get alert mails, either there is a problem with the actual alerter or with your checkers. Please show your checkers, and check whether the "alerted" column in the test list has a value or says Never.
Tom
![](https://secure.gravatar.com/avatar/cf3b2233e1b538045e761614bbfdc245.jpg?s=120&d=mm&r=g)
Hello,
First thanks for your rapid answer, the alerts look like activated, like you can see below (I don't know if picture can be display on this maillinglist
[cid:image001.png@01CFCE92.3C883420] [cid:image002.png@01CFCE92.3C883420]
When in run the alerter.php on a device with an interface down :
:/data/observium# php ./alerter.php -h sto-rtr-edge-agarik.seres.lan -d Observium v0.14.9.5798 Alerter
DEBUG! Starting alerter run:
PHP Warning: readfile(/data/observium/includes/debug/ref.css): failed to open stream: No such file or directory in /data/observium/includes/debug/ref.inc.php on line 2474 PHP Warning: readfile(/data/observium/includes/debug/ref.js): failed to open stream: No such file or directory in /data/observium/includes/debug/ref.inc.php on line 2482 <!-- ref#0 --><div><style> Warning: readfile(/data/observium/includes/debug/ref.css): failed to open stream: No such file or directory in /data/observium/includes/debug/ref.inc.php on line 2474 </style> <script> Warning: readfile(/data/observium/includes/debug/ref.js): failed to open stream: No such file or directory in /data/observium/includes/debug/ref.inc.php on line 2482 </script><div class="ref"><span data-input><i>> </i><span data-expTxt>$vars</span><span data-backtrace>/data/observium/includes/common.inc.php:193</span></span><span data-output><span data-string data-tip="0">SELECT * FROM `alert_tests` WHERE 1</span></span><div><span data-row><span data-cell><span data-title>string(35)</span></span></span></div></div></div><!-- /ref#1 -->Cached 0 alert rules. <!-- ref#1 --><div><div class="ref"><span data-input><span data-backtrace>/data/observium/includes/common.inc.php:193</span></span><span data-output><span data-string data-tip="0">SELECT * FROM `alert_assoc`</span></span><div><span data-row><span data-cell><span data-title>string(27)</span></span></span></div></div></div><!-- /ref#2 --><!-- ref#2 --><div><div class="ref"><span data-input><span data-backtrace>/data/observium/includes/common.inc.php:193</span></span><span data-output><span data-string data-tip="0">SELECT `device_id` FROM `devices` WHERE `disabled` = 0 AND `hostname` LIKE 'sto-rtr-edge-agarik.seres.lan' ORDER BY `device_id` ASC</span></span><div><span data-row><span data-cell><span data-title>string(131)</span></span></span></div></div></div><!-- /ref#3 --><!-- ref#3 --><div><div class="ref"><span data-input><span data-backtrace>/data/observium/includes/common.inc.php:193</span></span><span data-output><span data-string data-tip="0">SELECT * FROM `devices` WHERE `device_id` = '35'</span></span><div><span data-row><span data-cell><span data-title>string(48)</span></span></span></div></div></div><!-- /ref#4 -->Processing alerts for sto-rtr-edge-agarik.seres.lan <!-- ref#4 --><div><div class="ref"><span data-input><span data-backtrace>/data/observium/includes/common.inc.php:193</span></span><span data-output><span data-string data-tip="0">SELECT *,`alert_table`.`alert_table_id` AS `alert_table_id` FROM `alert_table` LEFT JOIN `alert_table-state` ON `alert_table`.`alert_table_id` = `alert_table-state`.`alert_table_id` WHERE `device_id` = '35'</span></span><div><span data-row><span data-cell><span data-title>string(212)</span></span></span></div></div></div><!-- /ref#5 --><!-- ref#5 --><div><div class="ref"><span data-input><span data-backtrace>/data/observium/includes/common.inc.php:193</span></span><span data-output><span data-string data-tip="0">SELECT * FROM `alert_table` LEFT JOIN `alert_table-state` ON `alert_table`.`alert_table_id` = `alert_table-state`.`alert_table_id` WHERE `device_id` = '35'</span></span><div><span data-row><span data-cell><span data-title>string(155)</span></span></span></div></div></div><!-- /ref#6 -->
Best regards
David
De : observium [mailto:observium-bounces@observium.org] De la part de Tom Laermans Envoyé : vendredi 12 septembre 2014 12:21 À : Observium Network Observation System Objet : Re: [Observium] Problem with the Mail Alerting
On 09/12/2014 11:25 AM, SCHEIN David wrote:
I tried different config, but nothing is working and with this config when I do a test, I receive the e-mail in my gmail box, but nothing about port down or bgp session down...
If test mail works, your config works. If you don't get alert mails, either there is a problem with the actual alerter or with your checkers. Please show your checkers, and check whether the "alerted" column in the test list has a value or says Never.
Tom
![](https://secure.gravatar.com/avatar/21caf0a08d095be7196a1648d20942be.jpg?s=120&d=mm&r=g)
David,
You need to create alert checkers to receive e-mail alerts.
Tom
On 09/12/2014 02:08 PM, SCHEIN David wrote:
Hello,
First thanks for your rapid answer, the alerts look like activated, like you can see below (I don’t know if picture can be display on this maillinglist
When in run the alerter.php on a device with an interface down :
:/data/observium# php ./alerter.php -h sto-rtr-edge-agarik.seres.lan -d
Observium v0.14.9.5798
Alerter
DEBUG!
Starting alerter run:
PHP Warning: readfile(/data/observium/includes/debug/ref.css): failed to open stream: No such file or directory in /data/observium/includes/debug/ref.inc.php on line 2474
PHP Warning: readfile(/data/observium/includes/debug/ref.js): failed to open stream: No such file or directory in /data/observium/includes/debug/ref.inc.php on line 2482
<!-- ref#0 --><div><style> Warning:
readfile(/data/observium/includes/debug/ref.css): failed to open stream: No such file or directory in /data/observium/includes/debug/ref.inc.php on line 2474 </style>
<script> Warning: readfile(/data/observium/includes/debug/ref.js): failed to open stream: No such file or directory in /data/observium/includes/debug/ref.inc.php on line 2482 </script><div
class="ref"><span data-input><i>> </i><span data-expTxt>$vars</span><span data-backtrace>/data/observium/includes/common.inc.php:193</span></span><span data-output><span data-string data-tip="0">SELECT * FROM `alert_tests` WHERE 1</span></span><div><span data-row><span data-cell><span data-title>string(35)</span></span></span></div></div></div><!-- /ref#1 -->Cached 0 alert rules.
<!-- ref#1 --><div><div class="ref"><span data-input><span
data-backtrace>/data/observium/includes/common.inc.php:193</span></span><span data-output><span data-string data-tip="0">SELECT * FROM `alert_assoc`</span></span><div><span data-row><span data-cell><span data-title>string(27)</span></span></span></div></div></div><!-- /ref#2 --><!-- ref#2 --><div><div class="ref"><span data-input><span data-backtrace>/data/observium/includes/common.inc.php:193</span></span><span data-output><span data-string data-tip="0">SELECT `device_id` FROM `devices` WHERE `disabled` = 0 AND `hostname` LIKE 'sto-rtr-edge-agarik.seres.lan' ORDER BY `device_id` ASC</span></span><div><span data-row><span data-cell><span data-title>string(131)</span></span></span></div></div></div><!-- /ref#3 --><!-- ref#3 --><div><div class="ref"><span data-input><span data-backtrace>/data/observium/includes/common.inc.php:193</span></span><span data-output><span data-string data-tip="0">SELECT * FROM `devices` WHERE `device_id` = '35'</span></span><div><span data-row><span data-cell><span data-title>string(48)</span></span></span></div></div></div><!-- /ref#4 -->Processing alerts for sto-rtr-edge-agarik.seres.lan
<!-- ref#4 --><div><div class="ref"><span data-input><span
data-backtrace>/data/observium/includes/common.inc.php:193</span></span><span data-output><span data-string data-tip="0">SELECT *,`alert_table`.`alert_table_id` AS `alert_table_id` FROM `alert_table` LEFT JOIN `alert_table-state` ON `alert_table`.`alert_table_id` = `alert_table-state`.`alert_table_id` WHERE `device_id` = '35'</span></span><div><span data-row><span data-cell><span data-title>string(212)</span></span></span></div></div></div><!-- /ref#5 --><!-- ref#5 --><div><div class="ref"><span data-input><span data-backtrace>/data/observium/includes/common.inc.php:193</span></span><span data-output><span data-string data-tip="0">SELECT * FROM `alert_table` LEFT JOIN `alert_table-state` ON `alert_table`.`alert_table_id` = `alert_table-state`.`alert_table_id` WHERE `device_id` = '35'</span></span><div><span data-row><span data-cell><span data-title>string(155)</span></span></span></div></div></div><!-- /ref#6 -->
Best regards
David
*De :*observium [mailto:observium-bounces@observium.org] *De la part de* Tom Laermans *Envoyé :* vendredi 12 septembre 2014 12:21 *À :* Observium Network Observation System *Objet :* Re: [Observium] Problem with the Mail Alerting
On 09/12/2014 11:25 AM, SCHEIN David wrote:
I tried different config, but nothing is working and with this config when I do a test, I receive the e-mail in my gmail box, but nothing about port down or bgp session down…
If test mail works, your config works. If you don't get alert mails, either there is a problem with the actual alerter or with your checkers. Please show your checkers, and check whether the "alerted" column in the test list has a value or says Never.
Tom
observium mailing list observium@observium.org http://postman.memetic.org/cgi-bin/mailman/listinfo/observium
participants (3)
-
Adam Armstrong
-
SCHEIN David
-
Tom Laermans