summaryrefslogtreecommitdiff
path: root/util/ihealth.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2017-09-26 05:07:36 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2017-09-26 05:07:36 +0200
commit4b28a392fa890390755f58e0755ab56e8edaa295 (patch)
treeafc91b260fb8df69fdd19c93261ea68cadf9eaed /util/ihealth.c
parentdcc89cc2006fea0ca21fbe267930a0ac3c850b52 (diff)
New upstream version 3.0.7upstream/3.0.7
Diffstat (limited to 'util/ihealth.c')
-rw-r--r--util/ihealth.c46
1 files changed, 24 insertions, 22 deletions
diff --git a/util/ihealth.c b/util/ihealth.c
index fcef947..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.06";
+static char * progver = "3.07";
static char fdebug = 0;
static char fipmilan = 0;
static char fcanonical = 0;
@@ -616,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 */
@@ -634,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*/
@@ -647,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;
@@ -662,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)) {
@@ -1025,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));
}
}
@@ -1040,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 {