ℹ️ Your data is safe here... unless you make the SNIP gods angry. And let's just say they have a really bad sense of humor.

From librenms, 6 Years ago, written in Plain Text.
Embed
  1. diff --git a/LibreNMS/Alert/AlertUtil.php b/LibreNMS/Alert/AlertUtil.php
  2. index aec41b03d..e0dc47944 100644
  3. --- a/LibreNMS/Alert/AlertUtil.php
  4. +++ b/LibreNMS/Alert/AlertUtil.php
  5. @@ -25,7 +25,7 @@ class AlertUtil
  6.       */
  7.      public static function getAlertTransports($alert_id)
  8.      {
  9. -        $query = "SELECT b.transport_id, b.transport_type FROM alert_transport_map AS a LEFT JOIN alert_transports AS b ON b.transport_id=a.transport_or_group_id WHERE a.target_type='single' AND a.rule_id=? UNION DISTINCT SELECT d.transport_id, d.transport_type FROM alert_transport_map AS a LEFT JOIN alert_transport_groups AS b ON a.transport_or_group_id=b.transport_group_id LEFT JOIN transport_group_transport AS c ON b.transport_group_id=c.transport_group_id LEFT JOIN alert_transports AS d ON c.transport_id=d.transport_id WHERE a.target_type='group' AND a.rule_id=?";
  10. +        $query = "SELECT b.transport_id, b.transport_type, b.transport_name FROM alert_transport_map AS a LEFT JOIN alert_transports AS b ON b.transport_id=a.transport_or_group_id WHERE a.target_type='single' AND a.rule_id=? UNION DISTINCT SELECT d.transport_id, d.transport_type FROM alert_transport_map AS a LEFT JOIN alert_transport_groups AS b ON a.transport_or_group_id=b.transport_group_id LEFT JOIN transport_group_transport AS c ON b.transport_group_id=c.transport_group_id LEFT JOIN alert_transports AS d ON c.transport_id=d.transport_id WHERE a.target_type='group' AND a.rule_id=?";
  11.          $rule_id = self::getRuleId($alert_id);
  12.          return dbFetchRows($query, [$rule_id, $rule_id]);
  13.      }
  14. diff --git a/includes/alerts.inc.php b/includes/alerts.inc.php
  15. index 0a61d9c77..5a0402bee 100644
  16. --- a/includes/alerts.inc.php
  17. +++ b/includes/alerts.inc.php
  18. @@ -864,6 +864,7 @@ function ExtTransports($obj)
  19.          if (class_exists($class)) {
  20.              $transport_title = ($item['legacy'] === true) ? "{$item['transport_type']} (legacy)" : $item['transport_type'];
  21.              $obj['transport'] = $item['transport_type'];
  22. +            $obj['transport_name'] = $item['transport_name'];
  23.              $obj['alert']     = new AlertData($obj);
  24.              $obj['title']     = $type->getTitle($obj);
  25.              $obj['alert']['title'] = $obj['title'];
  26.  

Replies to Untitled rss

Title Name Language When
Fixed Query Angel Fontenla Gago php 6 Years ago.
captcha