Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[state_controller] system value #51

Closed
Ddoiron-cidco opened this issue Jan 22, 2020 · 2 comments
Closed

[state_controller] system value #51

Ddoiron-cidco opened this issue Jan 22, 2020 · 2 comments
Labels
duplicate This issue or pull request already exists

Comments

@Ddoiron-cidco
Copy link
Contributor

   //CPU temps
   ifstream fcputemp;
       fcputemp.open ("/sys/class/thermal/thermal_zone0/temp");
       if (fcputemp.is_open()){
	     getline (fcputemp,cputemp);  
       fcputemp.close();}
   cputemp.erase (cputemp.begin()+2); 
   cputemp.insert(2,".");
   //cputemp = température en string xx.xx C 

   //CPU load
   ifstream fcpustat;
       fcpustat.open ("/proc/loadavg");
       if (fcpustat.is_open()){
	     getline (fcpustat,cpustat);  
       fcpustat.close();}
   ret = sscanf(cpustat.c_str(), "%lf",&loadavg);
   loadavg = loadavg / 8.0 * 100.0;
   //loadavg = charge cpu sur 100 tenant compte que le raspberry a 4 core et 2 thread par core.
@Ddoiron-cidco
Copy link
Contributor Author

mémoire dispo dans /proc/meminfo

disque dur dans /proc/diskstats

up time dans /proc/uptime

@glabmoris
Copy link
Collaborator

Duplicata de #44

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants