
Aero AIO: cpu/mem plugin mod
Source (link to git-repo or to original if based on someone elses unmodified work):
FEATURES:
- default backend that supports CPU temeratures via /proc/acpi/thermal_zone and hard disk temperatures via hddtemp. You can start hddtemp by (as root)
hddtemp -d /dev/hda
Replace hda with the hard disk you want monitored.
- ibmacpi backend (for IBM laptops). Thanks to Frank Fiene. Supports CPU, GPU, hdd, fan and pci data, via the ibm acpi kernel module. Boy those IBM laptops have a lot of sensors!
- i8k backend (for Dell laptops). Supports cpu temp and fan speeds via the i8k kernel module.
- nvidia backend that support reading the nvidia gpu core temp
- The backends are cascaded. The code automatically looks through all backends for support of each feature. the final feature set is the union of all backends
- If an update temporarily fails (this tends to happen with hddtemp), it is indicated on the theme by the : in front of the sensor name becoming an _
REQUIREMENTS: >= Aero AIO 0.9.1
USAGE:
- Use the config dialog of Aero AIO to install the .aiz file
- The port on which the plugin tries to communicate with hddtemp can be configured
- If your hardware isn't supported write a backend and send it to me
ver 2.1.4
- Add support for NVidia GPU core temp
ver 2.1.3
- Use Aero AIO 0.9.1 API
ver 2.1.2
- Improved exception handling code in hddtemp module in default backend
ver 2.1.1
- Fixed possible division by zero bug in mem module
ver 2.1.0
- Moved CPU temp information into title
ver 2.0.4
- Fixed a bug that could cause the swap bar to not show up
ver 2.0.3
- Added a backend for IBM laptops and fixed a couple of typos. Big thank you to Frank Fiene
ver 2.0.2
- Changed to the .aiz Aer AIO plugin format
ver 2.0.1
- Made backend loading fully automatic, all you need to do is write the backend and put it in the scripts folder. It will be automatically detected and used where applicable
- Fixed various minor API bugs
ver 2.0.0
- Separated the hardware detection/monitoring code into backends
- Wrote the default and Dell i8k backends
ver 1.0.3
- Added auto-detection of ibm ACPI temp file
ver 1.0.2
- added debugging code to hddTemp
Ratings & Comments
39 Comments
With my AMD64 Winchester, on openSUSE 10.2, the CPU temp should be form the CPU_Temp sensor instead of from ACPI Thermal Zone... anyone know how to change this? Aero-AIO sensors/HD temp monitor has it right. I'm guessing i need the correct /proc? Thanks (semi-n00b here).
Are the reported temperatures significantly different? i.e. different by something other than a constant offset?
It shows 22C all the time, instead of fluctuating from 50C to 35C. The 50-35 is what the BIOS reports, and other tools in Windows, so I am confident these temps are correct... Thanks for any help you can provide... and even if we don't resolve it, thanks for taking a interest!
Well how is the temperature reported? If you can provide a file from which it is read or a command used to get it, I can integrate that into the code.
The other Aero AIO monitor (see above) gets CPU_Temp from a hardware sensor called "w83627thf" according to KDE System Guard, for my nforce4 motherboard. ~> sensors w83627thf-isa-0290 Adapter: ISA adapter VCore: +1.04 V (min = +0.00 V, max = +3.84 V) +12V: +12.46 V (min = +11.86 V, max = +2.74 V) ALARM +3.3V: +3.14 V (min = +0.64 V, max = +0.51 V) ALARM +5V: +4.99 V (min = +3.44 V, max = +0.96 V) ALARM -12V: -12.53 V (min = -11.95 V, max = -4.38 V) ALARM V5SB: +5.03 V (min = +3.23 V, max = +1.08 V) ALARM VBat: +2.99 V (min = +0.32 V, max = +1.76 V) ALARM fan1: 0 RPM (min = 33750 RPM, div = 2) ALARM CPU Fan: 1739 RPM (min = -1 RPM, div = 8) ALARM fan3: 8035 RPM (min = 9642 RPM, div = 2) ALARM M/B Temp: +42°C (high = +0°C, hyst = +64°C) sensor = thermistor CPU Temp: +46.0°C (high = +80°C, hyst = +75°C) sensor = thermistor temp3: +27.5°C (high = +80°C, hyst = +75°C) sensor = diode vid: +0.000 V (VRM Version 2.4) Thanks. I don't know enough about your monitor to say how it could get this info...
Does the following command (run as normal user get the info?) sensors | cut -d' ' -f3 | tr -d "+°C"
~> sensors | cut -d' ' -f3 | tr -d "+°C" w83627thf-isa-0290 adapter beep_enable: If a /etc/sensors.conf file would help, I'll email (too large to post here) input set to -f6 displays the CPU Temp and other results: > cut -d' ' -f6 w83627thf-isa-0290 +1.04 +12.40 +3.15 -12.44 7941 +43°C (high +22.0°C beep_enable:
Send me a command that extracts just the CPU temp from the sensors output and I can add it
I am not having any luck figuring out the brute-force method of outputting just the CPU Temp from the sensors command... it would appear that this is unnecessary though, since: sensor=sensor type="CPU Temp" should suffice (properly inserted of course)? I really don't know Python... so that is about all the help I can give. Thanks for trying... I wish I could have helped more... if I do eventually figure this out, I'll be sure and post here. Thanks.
Just wanted to say thanks for all the hard work in making this a professional looking and usable tool. You have lowered my frustration level significantly.
Great work i love the the way it takes up less space and till shows all the funtions but it would be great if it could show the upload and download speeds when using ppp0
Thanks. There is a network plugin for aero aio that does this, you can set it up on an autoswitch with the cpu/mem plugin, or have two aios running.
Hi! This is a really cool plugin, thanks for your work! Is there another way to show the CPU temp (and other things)? ACPI doesn't work for me (the directory /proc/acpi/thermal_zone/... is always empty), but sensors works great. Is there a way to use that instead? Thanks again!!
Well it supports pluggable backends for reading temperatures from different sources. I dont have a system with sensors, so I can't write a backend to use lmsensors to get tempertaures. But you are welcome to try. Writing a backend is really easy. Look at the files cpumemv2_backend.py, cpumemv2_default.py and cpumemv2_i8k.py to learn how to write backends.
Hi, I've just added a plugin for Aero AIO 0.9.1 that solve your problem (that was mine too). With this plugin, you can monitor temperatures through 'lmsensor' instead of /proc/acpi/thermal_zone. You can find my plugin on: http://www.kde-look.org/content/show.php?content=39609 I hope it can be useful for you :) Francesco
thanks! exactly what I was looking for. Great job!!
There seems to be a bug when using hddtemp sensor reading. Every read causes a new socket connection which isn't closed, and thus after short time after running AIO it is impossible to run some of the applications that are using these (e.g. ktorrent). You can see that behaviour with netstat -A inet.
I don't see this behavior on my machine, however, auditing the code, I noticed a weakness in exception handling, that may be causing it for you. I've fixed that in version 2.1.2
Damn, you're fast! I'll check it and let you know.
Nope, each 5 seconds it opens a new socket and doesn't close it, unless I close AIO. Soon after running there are 9 or 10 sockets opened. But seems it's not your fault. Does your script telnet to localhost:port hddtemp rather that use http connection to localhost:port? Because if it does, it seems that the problem is here, as after telneting it leaves socker open. Also, telnet connection is closed immediately after displaying disk&temp info here, I guess it shouldn't be like that.
It uses the python socket module to create the connection. The relevant code is s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) try: s.connect(("localhost", self.port)) data = s.recv(1024) finally: s.close() The try -> finally block ensures that if there is an error, the socket is closed by the close() call. Can you try setting DEBUG=True in ~/.aero-aio/scripts/cpumemv2_backend.py and then running SK and posting the output. Thanks, Kovid.
Nothing special here, Importing DefaultBackend... OK Importing I8kBackend... OK Importing IbmacpiBackend... OK Hdd temp data: |/dev/sda|HTS726060M9AT00|40|C| End Hdd temp data: |/dev/sda|HTS726060M9AT00|40|C| End and so on. It has to be hddtemp's fault, otherwise why would telneting to it didn't close sockets? I am not sure if it should break connection after displaying data, too. I'll have to report it to distro devs or hddtemp devs.
Oh well...good luck with getting it fixed.
Hey Kovid, thx for the citation! It was quiet easy with your code! The Thinkpad has a lot more sensors, but there is no place in the text field for the battery temperature! :-( Maybe we have to put the fan speed into the title!? Or the CPU temp? For example: CPU: 2.0 GHz at 47C Regards! Frank.
I like the idea of putting the CPU temp into the title, however I'll have to write failover code, since not all boxes (my dell desktop for instance) have CPU temperature sensors.