summaryrefslogtreecommitdiff
path: root/util/oem_supermicro.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2017-06-25 08:13:40 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2017-06-25 08:13:40 +0200
commit401b3073c7af7fe89dd70955ef4431da91cc3f29 (patch)
tree0810163002c12b34f0a2c1784e7189a0730d6a33 /util/oem_supermicro.c
parent715160edeb4dfc4335f8def440806ad0d5307fec (diff)
parentde044ac29fcfc641dc1465f310be588ffe2fe8d3 (diff)
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'util/oem_supermicro.c')
-rw-r--r--util/oem_supermicro.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/util/oem_supermicro.c b/util/oem_supermicro.c
index a480b7f..d733213 100644
--- a/util/oem_supermicro.c
+++ b/util/oem_supermicro.c
@@ -68,7 +68,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
void set_loglevel(int level); /*prototype */
extern char fsm_debug; /*mem_if.c*/
-static char * progver = "3.04";
+static char * progver = "3.05";
static char * progname = "ismcoem";
static int verbose = 0;
static char fdebug = 0;
@@ -415,7 +415,7 @@ int decode_threshold_supermicro(uchar rval, uchar *thresh)
* pstring = contains the sensor reading interpretation string (if rv==0)
*/
int decode_sensor_supermicro(uchar *sdr,uchar *reading,char *pstring, int slen,
- int fsimple)
+ int fsimple, char fdbg)
{
int i, rv = -1;
uchar stype, etype, snum;
@@ -428,23 +428,25 @@ int decode_sensor_supermicro(uchar *sdr,uchar *reading,char *pstring, int slen,
if (sdr == NULL || reading == NULL) return(rv);
if (pstring == NULL || slen == 0) return(rv);
+ fdebug = fdbg;
bval = (reading[2] & 0x3f);
snum = sdr[7]; /*sdr01->sens_num*/
stype = sdr[12]; /*sensor_type*/
etype = sdr[13]; /*sdr01->ev_type*/
/* sdr[3] rec_type is 0x01 for Full, 0x02 for Compact */
if ((sdr[3] == 0x01) && (etype == 0x01)) { /* full threshold sensor */
- if (bval == 0) return(-1); /* OK, treat it normally */
- /*cannot rely upon the sensor reading[2], so get thresholds and compare*/
+ /*if Temp sensor, bits==0 would show BelowCrit, so handle normally */
+ if ((stype == 0x01) && (bval == 0)) return(-1);
+ /*Cannot rely upon the sensor reading[2], so get thresholds and compare*/
rv = GetSensorThresholds(snum,&thresh[0]);
if (rv != 0) return(rv);
i = decode_threshold_supermicro(reading[0],thresh);
if (fdebug)
- printf("decode_sensor_supermicro: snum=%x rdg=%x:%x thresh=%x:%x:%x:%x:%x:%x:%x i=%d rv=%d\n",
- snum,reading[0],reading[2], thresh[0], thresh[1], thresh[2], thresh[3],
+ printf("decode_sensor_supermicro: snum=%x stype=%x rdg=%x:%x thresh=%x:%x:%x:%x:%x:%x:%x i=%d rv=%d\n",
+ snum,stype,reading[0],reading[2], thresh[0], thresh[1], thresh[2], thresh[3],
thresh[4], thresh[5], thresh[6], i,rv);
switch(i) {
- case 0: pstr = "OK*"; break;
+ case 0: pstr = "OK"; break;
case 1: pstr = "Warn-lo"; break;
case 2: pstr = "Crit-lo"; break;
case 3: pstr = "BelowCrit"; break;