9/11/2023 0 Comments Ubuntu temperature monitor![]() ![]() The data is appended at the end of the CSV file, so it’s ok to leave the property unchanged between runs, or even have this run regularly from a cron job (you’ll have to do a bit of shell magic to find out it PID and have another job kill it after a given time). ![]() # Default is /usr/bin/sensors, change it here if your installation is different ![]() The program itself can be run from the command line with: $ java -jar sensors_0.1alpha.jarĪnd a simple properties file looks something like: # Configuration file for the sensor data storage utility I have written a very simple Java utility to take readings from the CPU temperature sensors utility (/usr/bin/sensor) and dump it to a CSV file.Īlthough of fairly limited utility, I just wanted to see how to run a binary from Java and capture its output – and, let’s face it, it is a rainy Saturday in Silicon Valley this afternoon and I’d just installed this new CPU cooler and just felt like doing some fuzzying around.Īll the code, javadocs and a full working jar are available from the usual place, just remember to create a sensor.properties file under a. Update: I’ve figured out that it makes a lot more sense to have a reading of the CPU load to correlate with the temperature reading, so I’ve added that too using /usr/bin/uptime. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |