From: Heidi E. <hei...@us...> - 2005-04-13 13:57:31
|
Update of /cvsroot/sblim/cmpi-base In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16000 Modified Files: cmpiOSBase_OperatingSystem.c Log Message: minor updates to retrieve the value of OperationalStatus Index: cmpiOSBase_OperatingSystem.c =================================================================== RCS file: /cvsroot/sblim/cmpi-base/cmpiOSBase_OperatingSystem.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- cmpiOSBase_OperatingSystem.c 6 Apr 2005 15:43:16 -0000 1.15 +++ cmpiOSBase_OperatingSystem.c 13 Apr 2005 13:57:22 -0000 1.16 @@ -139,7 +139,6 @@ return ci; } - static int getcpu(CpuSample * cps) { unsigned long user, system, nice, idle; @@ -172,9 +171,6 @@ CMPIArray * opstat = NULL; unsigned short status = 2; /* Enabled */ unsigned short opstatval = 2; /* 2 ... OK ; 4 ... Stressed */ -#ifndef NOEVENTS - int opval = 2; -#endif #endif _OSBASE_TRACE(2,("--- _makeOS() called")); @@ -309,12 +305,7 @@ goto exit; } else { -#ifndef NOEVENTS - check_OperationalStatus(&opval); - opstatval = opval; -#else - if( pctcpu > 90 ) { opstatval = 4; } -#endif + if( pctcpu >= 90 ) { opstatval = 4; } CMSetArrayElementAt(opstat,0,(CMPIValue*)&(opstatval),CMPI_uint16); CMSetProperty( ci, "OperationalStatus", (CMPIValue*)&(opstat), CMPI_uint16A); } @@ -342,11 +333,10 @@ CpuSample cs; unsigned short pctcpu = 0; - if(getcpu(&cs) == 0) { + if(getcpu(&cs) == 0) { pctcpu = 100*cs.cpu/cs.total; - _OSBASE_TRACE(2,("--- _check_OperationalStatus value : %d",pctcpu)); + _OSBASE_TRACE(2,("--- _check_OperationalStatus(): TotalCPUTimePct %d, OperationalStatus %i",pctcpu,*OperationalStatus)); if(pctcpu>=90 && *OperationalStatus!=4) { - // if(pctcpu>=10 && *OperationalStatus!=4) { *OperationalStatus = 4; return 1; } |