mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
feature: Send default mail when no email destinations found (#6165)
* when an email is attempted to be sent but there are no recipients send to default_mail address
This commit is contained in:
@@ -253,6 +253,10 @@ $general_conf = array(
|
||||
'descr' => 'Default contact',
|
||||
'type' => 'text',
|
||||
),
|
||||
array('name' => 'alert.default_if_none',
|
||||
'descr' => 'Send mail to default contact if no other contacts are found',
|
||||
'type' => 'checkbox',
|
||||
),
|
||||
array('name' => 'alert.tolerance_window',
|
||||
'descr' => 'Tolerance window for cron',
|
||||
'type' => 'text',
|
||||
|
@@ -294,5 +294,10 @@ function GetContacts($results)
|
||||
}
|
||||
}
|
||||
|
||||
# Send email to default contact if no other contact found
|
||||
if ((count($tmp_contacts) == 0) && ($config['alert']['default_if_none']) && (!empty($config['alert']['default_mail']))) {
|
||||
$tmp_contacts[$config['alert']['default_mail']] = 'NOC';
|
||||
}
|
||||
|
||||
return $tmp_contacts;
|
||||
}
|
||||
|
1
sql-schema/177.sql
Normal file
1
sql-schema/177.sql
Normal file
@@ -0,0 +1 @@
|
||||
INSERT INTO config (config_name,config_value,config_default,config_descr,config_group,config_group_order,config_sub_group,config_sub_group_order,config_hidden,config_disabled) values ('alert.default_if_none','false','false','Send mail to default contact if no other contacts are found','alerting',0,'general',0,'0','0');
|
Reference in New Issue
Block a user