mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 08:02:41 +02:00
Adding alerting config
This commit is contained in:
@@ -201,44 +201,6 @@ $config['email_smtp_auth'] = FALSE; // Whether or not
|
||||
$config['email_smtp_username'] = NULL; // SMTP username.
|
||||
$config['email_smtp_password'] = NULL; // Password for SMTP authentication.
|
||||
|
||||
// Alerting Settings
|
||||
|
||||
$config['alert'] = array(
|
||||
'macros' => array( //Macros:
|
||||
'rule' => array( // For Rules
|
||||
//Time Macros
|
||||
'now' => 'NOW()',
|
||||
'past_5m' => 'DATE_SUB(NOW(),INTERVAL 5 MINUTE)',
|
||||
'past_10m' => 'DATE_SUB(NOW(),INTERVAL 10 MINUTE)',
|
||||
'past_15m' => 'DATE_SUB(NOW(),INTERVAL 15 MINUTE)',
|
||||
'past_30m' => 'DATE_SUB(NOW(),INTERVAL 30 MINUTE)',
|
||||
'past_60m' => 'DATE_SUB(NOW(),INTERVAL 60 MINUTE)',
|
||||
|
||||
//Device Macros
|
||||
'device' => '(%devices.disabled = "0" && %devices.ignore = "0")',
|
||||
'device_up' => '(%devices.status = "1" && %macros.device)',
|
||||
'device_down' => '(%devices.status = "0" && %macros.device)',
|
||||
|
||||
//Port Macros
|
||||
'port' => '(%ports.deleted = "0" && %ports.ignore = "0" && %ports.disabled = "0")',
|
||||
'port_up' => '(%ports.ifOperStatus = "up" && %ports.ifAdminStatus = "up" && %macros.port)',
|
||||
'port_down' => '(%ports.ifOperStatus = "down" && %ports.ifAdminStatus != "down" && %macros.port)',
|
||||
'port_usage_perc' => '((%ports.ifInOctets_rate*8)/%ports.ifSpeed)*100',
|
||||
|
||||
//Misc Macros
|
||||
),
|
||||
),
|
||||
'transports' => array( //Transports:
|
||||
'dummy' => false, // Dummy alerting (debug)
|
||||
'mail' => false, // E-Mail alerting
|
||||
'irc' => false, // IRC Alerting
|
||||
),
|
||||
'globals' => false, //Issue to global-read users
|
||||
'admins' => false, //Issue to administrators
|
||||
'default_only' => false, //Only issue to default
|
||||
'default_mail' => '', //Default email
|
||||
);
|
||||
|
||||
//Legacy options
|
||||
|
||||
$config['alerts']['email']['default'] = NULL; // Default alert recipient
|
||||
|
||||
@@ -58,7 +58,7 @@ foreach ($single_config as $config_data)
|
||||
$tmp_name = $config_data['config_name'];
|
||||
if(!isset($config[$tmp_name]))
|
||||
{
|
||||
$config[$tmp_name] = $config_data['config_value'];
|
||||
$config[$tmp_name] = stripslashes($config_data['config_value']);
|
||||
}
|
||||
}
|
||||
// Array config values
|
||||
@@ -69,7 +69,7 @@ foreach ($array_config as $config_data)
|
||||
$tmp_name = $config_data['config_name'];
|
||||
if(!isset($config[$tmp_name]))
|
||||
{
|
||||
$config[$tmp_name] = explode(',',$config_data['config_value']);
|
||||
$config[$tmp_name] = explode(',',stripslashes($config_data['config_value']));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ $config_vars = get_defined_vars();
|
||||
$multi_array_config = dbFetchRows("SELECT `config_name`, GROUP_CONCAT( `config_value` ) AS `config_value` FROM `config` WHERE `config_type` = 'multi-array' AND `config_disabled` = '0' GROUP BY config_name");
|
||||
foreach ($multi_array_config as $config_data)
|
||||
{
|
||||
create_array($config,$config_data['config_name'],$config_data['config_value'],'multi');
|
||||
create_array($config,$config_data['config_name'],stripslashes($config_data['config_value']),'multi');
|
||||
}
|
||||
|
||||
// Single-array config values
|
||||
@@ -86,7 +86,7 @@ $config_vars = get_defined_vars();
|
||||
$single_array_config = dbFetchRows("SELECT `config_name`, GROUP_CONCAT( `config_value` ) AS `config_value` FROM `config` WHERE `config_type` = 'single-array' AND `config_disabled` = '0' GROUP BY config_name");
|
||||
foreach ($single_array_config as $config_data)
|
||||
{
|
||||
create_array($config,$config_data['config_name'],$config_data['config_value'],'single');
|
||||
create_array($config,$config_data['config_name'],stripslashes($config_data['config_value']),'single');
|
||||
}
|
||||
unset($config_vars);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user