mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Added more debug to alerting capture (#4727)
This commit is contained in:
committed by
Tony Murray
parent
d5ba013a8a
commit
eab4ae5ab5
@@ -50,6 +50,28 @@ switch ($type) {
|
||||
$output .= 'Alert rule: ' . $rule['rule'] . PHP_EOL;
|
||||
$output .= 'Rule match: ' . $response . PHP_EOL . PHP_EOL;
|
||||
}
|
||||
if ($config['alert']['transports']['mail'] === true) {
|
||||
$contacts = GetContacts($rules);
|
||||
if (count($contacts) > 0) {
|
||||
$output .= 'Found ' . count(contacts) . ' contacts to send alerts to.' . PHP_EOL;
|
||||
}
|
||||
foreach ($contacts as $email => $name) {
|
||||
$output .= $name . '<' . $email . '>' . PHP_EOL;
|
||||
}
|
||||
$output .= PHP_EOL;
|
||||
}
|
||||
$transports = '';
|
||||
$x = 0;
|
||||
foreach ($config['alert']['transports'] as $name => $v) {
|
||||
if ($config['alert']['transports'][$name] === true) {
|
||||
$transports .= 'Transport: ' . $name . PHP_EOL;
|
||||
$x++;
|
||||
}
|
||||
}
|
||||
if (!empty($transports)) {
|
||||
$output .= 'Found ' . $x . ' transports to send alerts to.' . PHP_EOL;
|
||||
$output .= $transports;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
echo 'You must specify a valid type';
|
||||
|
Reference in New Issue
Block a user