summaryrefslogtreecommitdiff
path: root/util/ihealth.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2017-12-14 13:37:21 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2017-12-14 13:37:21 +0100
commit09863e30b4f27257be0299024d5a0de255f8ea84 (patch)
tree4176d07d460e015deffa29b82a4164561ff413c6 /util/ihealth.c
parent715160edeb4dfc4335f8def440806ad0d5307fec (diff)
parent1847c61e3994e17e1bd793a4fdc9f7860023826b (diff)
Merge branch 'release/3.0.7-1'3.0.7-1
Diffstat (limited to 'util/ihealth.c')
-rw-r--r--util/ihealth.c54
1 files changed, 30 insertions, 24 deletions
diff --git a/util/ihealth.c b/util/ihealth.c
index 974fa95..087fcdf 100644
--- a/util/ihealth.c
+++ b/util/ihealth.c
@@ -12,6 +12,7 @@
* 10/20/06 Andy Cress 1.1 - added -g for guid
* 01/10/07 Andy Cress 1.4 - added product strings
* 02/25/07 Andy Cress 2.8 - added more Chassis Status decoding
+ * 09/18/17 Andy Cress 3.07 - Set do_powerstate=0 for Sun, continue if failure
*/
/*M*
Copyright (c) 2006, Intel Corporation
@@ -82,7 +83,7 @@ extern int oem_supermicro_get_firmware_str(char *pstr, int sz); /*oem_supermicro
* Global variables
*/
static char * progname = "ihealth";
-static char * progver = "3.04";
+static char * progver = "3.07";
static char fdebug = 0;
static char fipmilan = 0;
static char fcanonical = 0;
@@ -421,9 +422,12 @@ static int get_power_state(uchar *rdata, int rlen)
uchar ccode;
int ret;
- ret = ipmi_cmdraw( GET_POWER_STATE, NETFN_APP,
- g_sa, g_bus, g_lun,
+ ret = ipmi_cmdraw( GET_POWER_STATE, NETFN_APP, g_sa, g_bus, g_lun,
+ idata,0, rdata,&rlen,&ccode, fdebug);
+ if (ret == 0 && ccode == 193) { /*0xB7, usu. SuperMicro, retry */
+ ret = ipmi_cmdraw( GET_POWER_STATE, NETFN_APP, g_sa, g_bus, g_lun,
idata,0, rdata,&rlen,&ccode, fdebug);
+ }
if (ret == 0 && ccode != 0) ret = ccode;
return(ret);
} /*end get_power_state()*/
@@ -613,12 +617,13 @@ void show_devid_all(int dtype, uchar *devrec, int sdevrec)
/* The product ids below only apply to BMCs */
switch(mfg) {
case VENDOR_NSC: /*=0x000322*/
- fmBMC = 1;
+ fmBMC = 1;
if (dtype == BMC) tag="mBMC";
if (prod == 0x4311) prodstr = "(TIGPT1U)"; /*Intel*/
break;
case VENDOR_SUN: /*=0x00002a*/
- if (prod == 0x4701) prodstr = "(X4140)";
+ if (prod == 0x4701) prodstr = "(X4140)";
+ do_powerstate = 0;
break;
case VENDOR_TYAN: /*=0x0019fd*/
switch(prod) { /* show product names for some */
@@ -631,12 +636,12 @@ void show_devid_all(int dtype, uchar *devrec, int sdevrec)
}
break;
case VENDOR_FUJITSU: /*=0x002880*/
- if (prod >= 0x200) prodstr = "(iRMC S2)";
- else prodstr = "";
+ if (prod >= 0x200) prodstr = "(iRMC S2)";
+ else prodstr = "";
break;
case VENDOR_CISCO: /*=0x00168b, 5771.*/
- if (prod == 0x0005) prodstr = "(UCS C200)";
- else prodstr = "";
+ if (prod == 0x0005) prodstr = "(UCS C200)";
+ else prodstr = "";
if (fipmilan) lan_ch_restrict = 1; /*fw bug, gets 0xC1 on ipmilan*/
break;
case 0x003C0A: /*=15370, Giga-Byte*/
@@ -644,9 +649,9 @@ void show_devid_all(int dtype, uchar *devrec, int sdevrec)
lan_ch_restrict = 1; /*fw bug, gets 0xC1*/
break;
case VENDOR_INTEL: /*=0x000157*/
- if (do_hsc && (dtype == BMC)) /*if HSC option, also show extra*/
+ if (do_hsc && (dtype == BMC)) /*if HSC option, also show extra*/
sprintf(extraver," (Boot %x.%x PIA %x.%x)", /*BMC extra*/
- devrec[11],devrec[12],devrec[13],devrec[14]);
+ devrec[11],devrec[12],devrec[13],devrec[14]);
switch(prod) { /* show product names for some */
case 0x000C: prodstr = "(TSRLT2)"; /*SCB2*/
bChan = 7; break;
@@ -659,24 +664,24 @@ void show_devid_all(int dtype, uchar *devrec, int sdevrec)
case 0x002B: prodstr = "(S5000VSA)"; break;
case 0x002D: prodstr = "(MFSYS25)"; break; /*ClearBay*/
case 0x003E: prodstr = "(S5520UR)"; /*CG2100 or NSN2U*/
- do_me = 1; kcs_loops = URNLOOPS;
+ do_me = 1; kcs_loops = URNLOOPS;
bChan = 1; break;
case 0x0040: prodstr = "(QSSC-S4R)"; /*Stoutland*/
- do_me = 1; kcs_loops = URNLOOPS;
+ do_me = 1; kcs_loops = URNLOOPS;
bChan = 1; break;
case 0x0100: prodstr = "(Tiger4)"; break;
case 0x0103: prodstr = "(McCarran)"; /*BladeCenter*/
- do_powerstate = 0; break;
+ do_powerstate = 0; break;
case 0x0800: prodstr = "(ZT5504)"; /*ZiaTech*/
- do_powerstate = 0; break;
+ do_powerstate = 0; break;
case 0x0808: prodstr = "(MPCBL0001)"; /*ATCA Blade*/
- do_powerstate = 0; break;
+ do_powerstate = 0; break;
case 0x0841: prodstr = "(MPCMM0001)"; /*ATCA CMM*/
- do_powerstate = 0; break;
+ do_powerstate = 0; break;
case 0x0811: prodstr = "(TIGW1U)"; break; /*S5000PHB*/
case 0x4311: prodstr = "(NSI2U)"; /*SE7520JR23*/
- if (dtype == BMC) tag="mBMC";
- fmBMC = 1; break;
+ if (dtype == BMC) tag="mBMC";
+ fmBMC = 1; break;
default: prodstr = ""; break;
}
if (is_romley(mfg,prod)) {
@@ -768,6 +773,7 @@ void show_devid_all(int dtype, uchar *devrec, int sdevrec)
do_powerstate = 0; break;
case 2137: prodstr = "(X10DRH)"; break; /*0x0859*/
case 2203: prodstr = "(X11SSW-F)"; break; /*0x089b*/
+ case 2327: prodstr = "(X11DPi)"; break; /*0x0917*/
case 4520: prodstr = "(H8DGU)"; break;
case 43025: prodstr = "(H8DGU-F)"; break;
case 43707: prodstr = "(X8DTH)"; break;
@@ -1021,12 +1027,12 @@ main(int argc, char **argv)
{ /* Some BMCs dont support get_power_state*/
ret = get_power_state(selfbuf,4);
if (ret != 0) {
- printf("ipmi_getpowerstate error, ret = %d\n",ret);
- goto health_end;
+ printf("ipmi_getpowerstate error, ret = %d\n",ret);
+ pwr_state = 0;
} else {
pwr_state = selfbuf[0] & 0x7f;
- printf("Power State %c %02x (%s)\n",
- bdelim,pwr_state,pwr_string(pwr_state));
+ printf("Power State %c %02x (%s)\n",
+ bdelim,pwr_state,pwr_string(pwr_state));
}
}
@@ -1036,7 +1042,7 @@ main(int argc, char **argv)
goto health_end;
} else {
selfstatus = selfbuf[0] + (selfbuf[1] << 8);
- s = decode_selftest(selfstatus);
+ s = decode_selftest(selfstatus);
if (fmBMC) {
sprintf(selfstr,"%s",s);
} else {