how do i get my server temperature to display in a PHP file?

  • Thread starter Thread starter Hessr
  • Start date Start date
H

Hessr

Guest
I just set up a private site for our compnay for stats on servers, clients, etc
well i want to be able to call all the stats to a php file
and i know in order todo i need to set up a cron file but idk how
and then call that data to a mysql database and idk how once its there i can pull it from there please help....basically cpu temp, percentage of ram being used and TOP
 
The cron job would use something called lm_sensors and it will run the application to then log the data. You would read the data from that file into your script using simple file IO. You would then use the mysql function to insert the data into your database. If you want the data to be set directly into the database without having to run a PHP script, you can set a timer on the cron job and just have it insert the data into the database by accessing MySQL directly. I recommend creating a shell script with this functionality and just have the cron job run the script under root so it may have full access. Be sure to keep the script away from any web folders and you should be fine.


Words of Wisdom,
- Hex
 
Back
Top