mirror of
https://github.com/librenms/librenms.git
synced 2024-09-21 10:28:13 +00:00
Fix a bunch of bugs (#12643)
This commit is contained in:
parent
de0fc2125c
commit
58a154d894
@ -221,7 +221,7 @@ class AlertUtil
|
||||
*/
|
||||
public static function runMacros($rule, $x = 1)
|
||||
{
|
||||
$macros = Config::get('alert.macros.rule', []) .
|
||||
$macros = Config::get('alert.macros.rule', []);
|
||||
krsort($macros);
|
||||
foreach ($macros as $macro => $value) {
|
||||
if (! strstr($macro, ' ')) {
|
||||
|
@ -76,7 +76,7 @@ class Boxcar extends Transport
|
||||
$data['notification[sound]'] = $api['sound_ok'];
|
||||
}
|
||||
break;
|
||||
case AlertState::Active:
|
||||
case AlertState::ACTIVE:
|
||||
$title_text = $severity;
|
||||
break;
|
||||
case AlertState::ACKNOWLEDGED:
|
||||
|
@ -54,8 +54,7 @@ class Telegram extends Transport
|
||||
$ret = curl_exec($curl);
|
||||
$code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
|
||||
if ($code != 200) {
|
||||
var_dump("API '$host' returned Error"); //FIXME: propper debuging
|
||||
var_dump('Params: ' . $api); //FIXME: propper debuging
|
||||
var_dump('Telegram returned Error'); //FIXME: propper debuging
|
||||
var_dump('Return: ' . $ret); //FIXME: propper debuging
|
||||
|
||||
return 'HTTP Status code ' . $code . ', Body ' . $ret;
|
||||
|
@ -220,7 +220,7 @@ class Component
|
||||
\App\Models\Component::whereIn('id', array_keys($updated))
|
||||
->with('prefs')
|
||||
->get()
|
||||
->each(function (\App\Models\Component $component) use ($updated) {
|
||||
->each(function (\App\Models\Component $component) use ($device_id, $updated) {
|
||||
$update = $updated[$component->id];
|
||||
unset($update['type']); // can't change type
|
||||
|
||||
@ -256,7 +256,7 @@ class Component
|
||||
$invalid->forget($existing->id);
|
||||
$existing->fill(['value' => $value]);
|
||||
if ($existing->isDirty()) {
|
||||
Log::event("Component: $component->type($component->id). Attribute: $attribute, was modified from: " . $existing->getOriginal('value') . ", to: $value", $device_id, 'component', 3, $component_id);
|
||||
Log::event("Component: $component->type($component->id). Attribute: $attribute, was modified from: " . $existing->getOriginal('value') . ", to: $value", $device_id, 'component', 3, $component->id);
|
||||
$existing->save();
|
||||
}
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user