Alarm Flag on UPS-Nut Application (#14635)

* Alarm Flag on UPS-Nut Application

* code adjustemnt
This commit is contained in:
SourceDoctor 2022-11-18 21:15:21 +01:00 committed by GitHub
parent 1dbe8cf0fa
commit e851c9abd4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -62,8 +62,9 @@ if (! $ups_nut) {
$UPSUPSOverloaded,
$UPSUPSBuck,
$UPSUPSBoost,
$UPSForcedShutdown
] = explode("\n", $ups_nut);
$UPSForcedShutdown,
$UPSAlarm
] = array_pad(explode("\n", $ups_nut), 23, 0);
$rrd_name = ['app', $name, $app->app_id];
$rrd_def = RrdDefinition::make()
@ -102,6 +103,7 @@ $sensors = [
['state_name' => 'UPSUPSBuck', 'value' => $UPSUPSBuck],
['state_name' => 'UPSUPSBoost', 'value' => $UPSUPSBoost],
['state_name' => 'UPSForcedShutdown', 'value' => $UPSForcedShutdown],
['state_name' => 'UPSAlarm', 'value' => $UPSAlarm],
];
foreach ($sensors as $index => $sensor) {