summaryrefslogtreecommitdiff
path: root/util/isensor.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2017-02-24 21:18:15 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2017-02-24 21:18:15 +0100
commite6806f1d217e07f52759e4fa1c792d1fe02f0d50 (patch)
tree9d88be25642b4dee4821a135522615970ac8e59f /util/isensor.c
parentf85b8b834b7ff85c80503faa73f237040330087b (diff)
New upstream version 3.0.2upstream/3.0.2
Diffstat (limited to 'util/isensor.c')
-rw-r--r--util/isensor.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/util/isensor.c b/util/isensor.c
index 9456613..7dd746e 100644
--- a/util/isensor.c
+++ b/util/isensor.c
@@ -168,6 +168,7 @@ extern int decode_sensor_dell(uchar *sdr,uchar *reading,char *pstring,
int slen); /*see oem_dell.c*/
extern int decode_sensor_lenovo(uchar *sdr,uchar *reading,char *pstring,
int slen); /*see oem_lenovo.c*/
+extern int decode_sensor_asus(uchar *sdr,uchar *reading,char *pstring,int slen);
extern int decode_sensor_hp(uchar *sdr,uchar *reading,char *pstring,
int slen); /*see oem_hp.c*/
extern void show_oemsdr_hp(uchar *sdr);
@@ -254,7 +255,7 @@ char *decode_entity_id(int id) {
* Global Data
************************/
static char *progname = "isensor";
-static char *progver = "3.01";
+static char *progver = "3.02";
#ifdef WIN32
static char savefile[] = "%ipmiutildir%\\thresholds.cmd";
#else
@@ -1962,14 +1963,18 @@ int decode_oem_sensor(uchar *sdr,uchar *reading,char *pstring,int slen)
case VENDOR_DELL:
rv = decode_sensor_dell(sdr, reading, pstring, slen);
break;
+ case VENDOR_IBM:
case VENDOR_LENOVO:
case VENDOR_LENOVO2:
rv = decode_sensor_lenovo(sdr, reading, pstring, slen);
break;
+ case VENDOR_ASUS:
+ rv = decode_sensor_asus(sdr, reading, pstring, slen);
+ break;
default:
break;
} /*end-switch vend_id*/
- if (fdebug && rv == 0)
+ if (fdebug) // && rv == 0)
printf("decode_oem_sensor rv=%d vend=%x string=%s\n",rv,vend_id,pstring);
#endif
return (rv);
@@ -2363,7 +2368,7 @@ decode_comp_reading(uchar type, uchar evtype, uchar num,
if (reading1 & 0x02) istr = 9; /*Present/Inserted*/
else if (reading1 & 0x01) istr = 10; /*Absent/Removed*/
else /*reading1==00*/ istr = 47; /*Unused*/
- } else { /* HSC slot status sensors (evtype==0x6f) */
+ } else { /* HSC slot status sensors (evtype==0x6f)*/
/* usually reading2 == 0x82 or 0x8E if healthy */
if (reading2 & 0x01) istr = 12; /*state8=Rebuild stopped*/
else if (reading2 & 0x02) istr = 11; /*state9=Inserted/Ready */
@@ -2371,7 +2376,7 @@ decode_comp_reading(uchar type, uchar evtype, uchar num,
else if (reading2 & 0x08) istr = 11; /*state11=Ready */
else if (reading2 == 0x80) istr = 47; /*no states, Unused*/
else istr = 12; /*faulty*/
- b = 8; /*if no bits set, no raid state */
+ b = 8; /*if no bits set, no raid state */
if (reading1 & 0x01) { b = 0; } /*state0=Faulty*/
else if (reading1 & 0x02) b = 1; /*state1=Rebuilding*/
else if (reading1 & 0x04) b = 2; /*state2=InFailedArray*/
@@ -2380,15 +2385,15 @@ decode_comp_reading(uchar type, uchar evtype, uchar num,
else if (reading1 & 0x20) b = 5; /*state5=PredictedFault*/
else if (reading1 & 0x40) b = 6; /*state6=Un-configured*/
else if (reading1 & 0x80) b = 7; /*state7=HotSpare*/
- if (b < 8) {
+ if (b < 8) {
/* also include a raid_state, via custom string */
sprintf(customstr,"%s %s",
sensor_dstatus[istr], raid_states[b]);
istr = STR_CUSTOM;
sensor_dstatus[istr] = customstr;
if (fdebug) printf("dstatus=%s\n",sensor_dstatus[istr]);
- }
- } /*end-else HSC slot status*/
+ }
+ } /*end-else-if HSC slot status (0x6f)*/
}
break;
case 0x10: /*Event Logging*/
@@ -2662,7 +2667,8 @@ ShowSDR(char *tag, uchar *sdr)
}
rc = decode_oem_sensor(sdr,sens,oem_string,sizeof(oem_string));
if (rc == 0) {
- strncpy(rdgstr,oem_string,sizeof(rdgstr));
+ if (fsimple) strncpy(rdgstr,oem_string,sizeof(rdgstr));
+ else snprintf(rdgstr,sizeof(rdgstr),"%02x %s",sens[0],oem_string);
} else {
if (fsimple)
snprintf(rdgstr,sizeof(rdgstr),"%s %c %.2f %s",