|
|
|
@ -1417,9 +1417,32 @@ bool hardwareManager::updateSysInfo( DBC_SYS_LOAD_INFO *ptr ){ |
|
|
|
} else { |
|
|
|
LOG_ERROR("Error while getting Disk Info!"); |
|
|
|
}; |
|
|
|
|
|
|
|
//FILE *fd = popen("","r");
|
|
|
|
ptr->temperature = 46.7; |
|
|
|
//Temperature reading
|
|
|
|
ptr->temperature = -1; |
|
|
|
if( fileExist( "/sys/class/thermal" ) ) { |
|
|
|
char tB[128]; |
|
|
|
// Check first 8 zones to find CPU one
|
|
|
|
for ( uint8_t i = 0; i < 8; i++ ) { |
|
|
|
sprintf( tB, "/sys/class/thermal/thermal_zone%d", i ); |
|
|
|
if ( fileExist( tB ) ) { |
|
|
|
sprintf( tB, "/sys/class/thermal/thermal_zone%d/type", i ); |
|
|
|
if ( fileExist( tB ) ) { |
|
|
|
FILE *fd = fopen( tB, "r" ); |
|
|
|
readLine( fd, tB, 128 ); |
|
|
|
fclose(fd); |
|
|
|
if ( strcasestr(tB,"cpu")!=NULL || strcasestr(tB,"x86_pkg")!=NULL) { |
|
|
|
sprintf( tB, "/sys/class/thermal/thermal_zone%d/temp", i ); |
|
|
|
FILE *fd = fopen( tB, "r" ); |
|
|
|
readLine( fd, tB, 128 ); |
|
|
|
fclose(fd); |
|
|
|
ptr->temperature = ((float) atoll( tB )) / 1000.0f; |
|
|
|
break; |
|
|
|
}; |
|
|
|
} else continue; |
|
|
|
} else break; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
return m_pDBC->updateServerUtilisation( ptr ); |
|
|
|
}; |
|
|
|
|
|
|
|
|