[Nut-upsdev] [Nut-upsuser] Powerware 9155 with SNMP card
Bernd Markgraf
Bernd.Markgraf at med.ovgu.de
Wed Aug 15 09:34:05 UTC 2007
Hi,
over the last few days I spent a little time on playing with pwmib.h and
surroundings. Here is how far I got up to now... maybe someone has a
similar setup and is willing to test things...
First things are in snmp-ups.c:
--- nut-2.2.0.org/drivers/snmp-ups.c 2007-05-26 16:24:26.000000000 +0200
+++ nut-2.2.0/drivers/snmp-ups.c 2007-08-15 11:03:57.031031000 +0200
@@ -75,10 +75,11 @@
dstate_setinfo("driver.version.internal", version);
/* add instant commands to the info database. */
- for (su_info_p = &snmp_info[0]; su_info_p->info_type != NULL ; su_info_p++)
+ for (su_info_p = &snmp_info[0]; su_info_p->info_type != NULL ; su_info_p++) {
su_info_p->flags |= SU_FLAG_OK;
if (SU_TYPE(su_info_p) == SU_TYPE_CMD)
dstate_addcmd(su_info_p->info_type);
+ }
/* setup handlers for instcmd and setvar functions */
upsh.setvar = su_setvar;
@@ -316,6 +317,7 @@
buf[len] = '\0';
break;
case ASN_INTEGER:
+ case ASN_COUNTER:
case ASN_GAUGE:
if(oid2info) {
const char *str;
@@ -367,6 +369,7 @@
free(buf);
break;
case ASN_INTEGER:
+ case ASN_COUNTER:
case ASN_GAUGE:
value = *pdu->variables->val.integer;
break;
The first part now really add instant commands... The second part add
ASN_COUNTER as type for data we might get from the ups (needed for the
number of nie failures one can retrieve from the ups).
ietfmib.h got the following changes:
--- nut-2.2.0.org/drivers/ietfmib.h 2007-01-19 07:45:46.000000000 +0100
+++ nut-2.2.0/drivers/ietfmib.h 2007-08-15 11:03:55.241993000 +0200
@@ -55,7 +55,13 @@
#define IETF_OID_OUT_POWER "1.3.6.1.2.1.33.1.4.4.1.4" /* UPS-MIB::upsOutputPower */
#define IETF_OID_LOAD_LEVEL "1.3.6.1.2.1.33.1.4.4.1.5" /* UPS-MIB::upsOutputPercentLoad */
+#define IETF_OID_UPS_TEST_ID "1.3.6.1.2.1.33.1.7.1.0" /* UPS-MIB::upsTestID.0 */
+#define IETF_OID_UPS_TEST_RES "1.3.6.1.2.1.33.1.7.3.0" /* UPS-MIB::upsTestResultsSummary.0 */
+#define IETF_OID_UPS_TEST_RESDET "1.3.6.1.2.1.33.1.7.4.0" /* UPS-MIB::upsTestResultsDetail.0 */
+#define IETF_OID_UPS_TEST_QBATT "1.3.6.1.2.1.33.1.7.7.4" /* UPS-MIB::upsTestQuickBatteryTest.0 */
+
#define IETF_OID_CONF_VOLTAGE "1.3.6.1.2.1.33.1.9.3.0" /* UPS-MIB::upsConfigOutputVoltage.0 */
+#define IETF_OID_CONF_OUT_VA "1.3.6.1.2.1.33.1.9.5.0" /* UPS-MIB::upsConfigOutputVA.0 */
#define IETF_OID_CONF_RUNTIME_LOW "1.3.6.1.2.1.33.1.9.7.0" /* UPS-MIB::upsConfigLowBattTime.0 */
/* Defines for IETF_OID_POWER_STATUS (1) */
@@ -126,6 +132,8 @@
SU_STATUS_PWR, &ietf_pwr_info[0] },
{ "ups.status", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_BATT_STATUS, "",
SU_STATUS_BATT, &ietf_batt_info[0] },
+ { "ups.test.result", ST_FLAG_STRING, SU_INFOSIZE, IETF_OID_UPS_TEST_RESDET, "",
+ 0, NULL },
/* Battery page */
{ "battery.charge", 0, 1.0, IETF_OID_BATT_CHARGE, "",
added a few OIDs for the battery test and report last test result. I'll
add the instant command to run a battery test soonish.
pwmib.h got quite some work so it's attached rather than diff'ed. Lots
of added OIDs (now sorted for readability).
http://149.203.91.65/cgi-bin/nut/upsstats.cgi?host=ups2@149.203.91.145&treemode
gives the status page one of the upses with all added info. Also it's
now possible to run a battery test.
Cheers,
Bernd
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pwmib.h.gz
Type: application/x-gzip
Size: 2715 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/nut-upsdev/attachments/20070815/1024f6b0/attachment-0001.bin
More information about the Nut-upsdev
mailing list