Project

General

Profile

Actions

Bug #14398

open

ONBATT Status Missing in apcupsd.widget.php

Added by Nick ... over 1 year ago. Updated 6 months ago.

Status:
New
Priority:
Low
Assignee:
-
Category:
apcupsd
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
Affected Version:
Affected Plus Version:
23.01
Affected Architecture:
amd64

Description

Description:
The file apcupsd.widget.php is currently lacking the "ONBATT" status. Due to this, when the system is on battery, it erroneously displays "Unknown(ONBATT)".

Steps to Reproduce:
  1. Switch to battery power while observing the APC UPSD Widget.
  2. The status will be displayed as "Unknown(ONBATT)".

Expected Result:
The status should correctly display "ONBATT" when on battery power.

Actual Result:
The status displays as "Unknown(ONBATT)".

Proposed Fix:
A possible fix would involve adding the "ONBATT" status to the mainstatarray on line 93 and including a case for "ONBATT" below line 114.

Line 93 (Current):

$mainstatarray = array("ONLINE", "ON-BATTERY", "OVERLOADED", "BATTERY-LOW", "LOWBATT", "REPLACE-BATTERY", "REPLACEBATT", "COMM-LOST", "COMMLOST", "NOBATT"); //Taken from apcupsd source

Line 93 (Proposed Fix):
$mainstatarray = array("ONLINE", "ON-BATTERY", "ONBATT", "OVERLOADED", "BATTERY-LOW", "LOWBATT", "REPLACE-BATTERY", "REPLACEBATT", "COMM-LOST", "COMMLOST", "NOBATT"); //Taken from apcupsd source

Line 114 (Current):
case "ON-BATTERY":
case "BATTERY-LOW":
case "LOWBATT":
case "NOBATT":

Line 114 (Proposed Fix):
case "ON-BATTERY":
case "ONBATT":
case "BATTERY-LOW":
case "LOWBATT":
case "NOBATT":

Actions

Also available in: Atom PDF