Skip to content

Commit

Permalink
Fix usage, cpu & mem payload
Browse files Browse the repository at this point in the history
  • Loading branch information
austinwbest committed Nov 22, 2023
1 parent 5877855 commit 3848540
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions root/app/www/public/crons/state.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
foreach ($previousStates as $previousState) {
if ($settings['notifications']['triggers']['stateChange']['active'] && $currentState['Names'] == $previousState['Names']) {
if ($previousState['State'] != $currentState['State']) {
$notify['state']['changed'] = ['container' => $currentState['Names'], 'previous' => $previousState['State'], 'current' => $currentState['State']];
$notify['state']['changed'][] = ['container' => $currentState['Names'], 'previous' => $previousState['State'], 'current' => $currentState['State']];
}
}
}
Expand All @@ -80,7 +80,7 @@
if ($currentState['stats']['CPUPerc']) {
$cpu = floatval(str_replace('%', '', $currentState['stats']['CPUPerc']));
if ($cpu > floatval($settings['global']['cpuThreshold'])) {
$notify['usage']['cpu'] = ['container' => $currentState['Names'], 'usage' => $cpu];
$notify['usage']['cpu'][] = ['container' => $currentState['Names'], 'usage' => $cpu];
}
}
}
Expand All @@ -90,7 +90,7 @@
if ($currentState['stats']['MemPerc']) {
$mem = floatval(str_replace('%', '', $currentState['stats']['MemPerc']));
if ($mem > floatval($settings['global']['memThreshold'])) {
$notify['usage']['mem'] = ['container' => $currentState['Names'], 'usage' => $mem];
$notify['usage']['mem'][] = ['container' => $currentState['Names'], 'usage' => $mem];
}
}
}
Expand Down

0 comments on commit 3848540

Please sign in to comment.