[Nut-upsdev] apcsmart and ambient data

Steffen Plotner swplotner at amherst.edu
Mon Sep 8 03:06:34 UTC 2008


Perhaps someone else could confirm this, I have an APC UPS with a built-in network management card with environmental sensor for temp/humidity.  The OID index for the sensors appears to be .1 (the last component for each of the OIDs listed below). The original source code has them at .0
 
drivers/apccmib.h
 
#define APCC_OID_IEM_TEMP       ".1.3.6.1.4.1.318.1.1.10.2.3.2.1.4.1"
#define APCC_OID_IEM_TEMP_UNIT  ".1.3.6.1.4.1.318.1.1.10.2.3.2.1.5.1"
#define APCC_IEM_FAHRENHEIT     2
#define APCC_OID_IEM_HUMID      ".1.3.6.1.4.1.318.1.1.10.2.3.2.1.6.1"

The snmp-ups.c code has a simple logic bug that causes the temperature APCC_OID_IEM_TEMP to not be utilized, even so it was able to obtain the temperature value using the OID APCC_OID_IEM_TEMP.
 
--- nut-2.2.0/drivers/snmp-ups.c.orig   2008-09-07 22:47:06.000000000 -0400
+++ nut-2.2.0/drivers/snmp-ups.c        2008-09-07 22:47:30.000000000 -0400
@@ -800,6 +800,8 @@
                        /* no response, or units == F */
                        if ((su == FALSE) || (units == APCC_IEM_FAHRENHEIT))
                                temp = (value - 32) / 1.8;
+                       else
+                               temp=value;
                }
                else {
                        temp=value;

Steffen
 
________________________________ 
Steffen Plotner 
Systems Administrator/Programmer 
Systems & Networking 
Amherst College 
PO BOX 5000 
Amherst, MA 01002-5000 
Tel (413) 542-2348 
Fax (413) 542-2626 
Email: swplotner at amherst.edu 
________________________________ 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.alioth.debian.org/pipermail/nut-upsdev/attachments/20080907/e5b4f47f/attachment.htm 


More information about the Nut-upsdev mailing list