Hi,
I've been asked to add upsBatteryAbmStatus to the cpqpower mib. We use
it purely for the CGI display. Here are the patches for data/cmdvartab
and drivers/cpqpowermib.h
-
Philip Ward
Unix Systems Administrator
Ext 7274
--
The Sunday Times Scottish University of the Year 2009/2010
The University of Stirling is a charity registered in Scotland,
number SC 011159.
--- cmdvartab.old 2010-02-04 13:39:06.000000000 +0000
+++ cmdvartab 2010-02-04 13:39:17.000000000 +0000
@@ -93,6 +93,7 @@
VARDESC battery.type "Battery chemistry"
VARDESC battery.protection "Prevent deep discharge of battery"
VARDESC battery.energysave "Switch off when running on battery and no/low load"
+VARDESC battery.abmstatus "Advanced Battery Management Status"
VARDESC ambient.temperature "Ambient temperature (degrees C)"
VARDESC ambient.temperature.alarm "Ambient temperature alarm is active"
--- cpqpowermib.h.old 2010-02-04 13:41:31.000000000 +0000
+++ cpqpowermib.h 2010-02-04 13:49:43.000000000 +0000
@@ -198,6 +198,15 @@
{ 0, "NULL" }
} ;
+info_lkp_t cpqpower_battery_abm_status[] = {
+ { 1, "Charging" },
+ { 2, "Discharging" },
+ { 3, "Floating" },
+ { 4, "Resting" },
+ { 5, "Unknown" },
+ { 0, "NULL" }
+} ;
+
#define CPQPOWER_OID_SD_AFTER_DELAY CPQPOWER_OID_UPS_MIB ".8.1.0" /* UPS-MIB::upsShutdownAfterDelay */
#define CPQPOWER_OFF_DO 0
@@ -226,6 +235,8 @@
{ "battery.runtime", 0, 60.0, CPQPOWER_OID_BATT_RUNTIME, "", 0, NULL },
{ "battery.voltage", 0, 0.1, CPQPOWER_OID_BATT_VOLTAGE, "", 0, NULL },
{ "battery.current", 0, 0.1, CPQPOWER_OID_BATT_CURRENT, "", 0, NULL },
+ { "battery.abmstatus", ST_FLAG_STRING, SU_INFOSIZE, CPQPOWER_OID_BATT_STATUS, "",
+ 0, &cpqpower_battery_abm_status[0] },
/* Input page */
{ "input.phases", 0, 1.0, CPQPOWER_OID_IN_LINES, "", SU_FLAG_SETINT, NULL, &input_phases },
_______________________________________________
Nut-upsdev mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/nut-upsdev