mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Location based Alert Rule (#11128)
* Location base Alert Rule * travis fix
This commit is contained in:
@@ -35,6 +35,10 @@ if (is_numeric($alert_id) && $alert_id > 0) {
|
||||
foreach ($groups as $group) {
|
||||
$maps[] = ['id' => 'g' . $group['group_id'], 'text' => $group['name']];
|
||||
}
|
||||
$locations = dbFetchRows('SELECT `location_id`, `location` FROM `alert_location_map` LEFT JOIN `locations` ON `locations`.`id`=`alert_location_map`.`location_id` WHERE `rule_id`=?', [$alert_id]);
|
||||
foreach ($locations as $location) {
|
||||
$maps[] = ['id' => 'l' . $location['location_id'], 'text' => $location['location']];
|
||||
}
|
||||
|
||||
$transports = [];
|
||||
$members = dbFetchRows('SELECT `transport_or_group_id`, `transport_name`, `transport_type` FROM `alert_transport_map` LEFT JOIN `alert_transports` ON `transport_or_group_id` = `transport_id` WHERE `target_type`="single" AND `rule_id`=?', [$alert_id]);
|
||||
|
Reference in New Issue
Block a user