Skip to content

Commit

Permalink
- if unknown status flag, return it instead of skipping it
Browse files Browse the repository at this point in the history
- updated TRIM message
  • Loading branch information
Peuuuur-Noel committed Jul 26, 2023
1 parent 1381db2 commit 0f68bfa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
'CAL' => ['severity' => 0, 'msg' => 'UPS is currently performing runtime calibration (on battery)'],
'OFF' => ['severity' => 1, 'msg' => 'UPS is offline and is not supplying power to the load'],
'OVER' => ['severity' => 2, 'msg' => 'UPS is overloaded'],
'TRIM' => ['severity' => 1, 'msg' => 'UPS is trimming incoming voltage'],
'TRIM' => ['severity' => 1, 'msg' => 'UPS is trimming incoming voltage (called "buck" in some hardware)'],
'BOOST' => ['severity' => 1, 'msg' => 'UPS is boosting incoming voltage'],
'FSD' => ['severity' => 1, 'msg' => 'Forced Shutdown'],
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ function nut_ups_status($rows, $valueOnly = false)
# keep the highest severity message level
$severity = max($severity, $nut_states[$var]['severity']);
return $nut_states[$var]['msg'];
# if unknown status flag, return it
} else {
return $var;
}
}, $status_values);
});
Expand Down

0 comments on commit 0f68bfa

Please sign in to comment.