Disk space display

A PR from @Andy_Taylor has just been added to the Master branch of emoncms which now clearly displays disk space (or lack of it). It’s a useful check to see how your SD cards are filling up, and whether it’s time to buy a bigger one!
Also displays CPU temp.



Fantastic! A great addition. I’ll add a note to the guide to alert users to check disk space before importing a backup.

1 Like

Nice work, Andy! VERY useful tool.

I like it! A very nice addition. Thank you Andy!

Want to bet that someone will want to start tracking the moment by moment CPU temp with graphs and dashboards? :grin:

Can be easily done via node-red. I’ve attached a rough flow which will obtain the temp every minute and send it to the debug window.
Substitute the debug node with either the emoncms or a MQTT node to send the data to emoncms.
Once in emoncms, divide the input by 1000 to get the temp in deg C.

PS - don’t know why anyone would want this though, but yes Jon agree, someone will want to log it!

CPU Temp.txt (598 Bytes)


Ha! I tried it and it works as advertised! Too funny! Now we need to finish it off and write the results to the emoncms in node!

maybe like this?

CPU Temp v2.txt (1.1 KB)

Are you that person Jon??

nope! :grinning:

1 Like

The disc (card) space indication is a useful addition and the cpu temperature is also useful.

See these 2 threads (1, 2) from the old forum, especially the images provided by Eric. His script was very useful whilst debugging.

I now include at least cpu temp, ram usage and network speeds (wifi and/or Ethernet) on all remote installs as a minimum, since they are usually read-only forwarding only installs the disc space isn’t so important.

Although I currently I use a custom “stat node” script to post via a emonhub socket interfacer I did have a “stat interfacer” working with the experimental branch of emonhub so it was included by default but optional.

Agree Paul that Ram usage & network speeds would be a welcome addition. We’ve had a number of posts where the size of log files written to RAM has made the system unstable.


Perhaps a warning system either by email or on the App warning of low disk space? IIRC there used to be something for no data received for a period of time but I may have imagined that :smile:

Monitoring the size /var/log in ram on a read-only filesystem is a good idea as the overall size is fixed and can cause big issues when certain software cannot write to log files, although not quite so important on a normal filesystem it can still be very useful to know when there is a serious amount of error logging going on,

The info can easily be parsed from df in a bash script using awk

SIZE=$(df -k /var/log/ | tail -1 | awk '{print $2}')
USED=$(df -k /var/log | tail -1 | awk '{print $3}')
FREE=$(df -k /var/log | tail -1 | awk '{print $4}')

When this data reported via the usual inputs page it can then be easily used for normal logging and display, but also using either the publish to MQTT process or the eventp module, email warnings and other events can be triggered.

It is also scaleable in that you can have several remote devices as well as the local one and the emoncms code doesn’t need to interact with the host to get the data making a cross platform solution easier to implement.

Although this gives you the full range of processing, feeds, visualisations and dashboards it might also be worth considering something along the lines of a “DeviceStatus” app to match the MyElectric & MySolar apps ?

Although I currently report most of my stats via a bash script for personal ease, I intended to look at using something like the psutils module to make a fully cross-platform solution for emonhub if there was the demand. The concept for the “stat node” was similar to the “Wunderground” weather node, where there would be a range of available variables to choose from so the user could easily construct a payload of the things they wanted to see just by including the variable name in the conf eg no point reporting wifi signal strength, quality and speed on a wired Ethernet only device.

Yes, monitoring var log would be a useful addition to the emoncms admin stats page. In the past we have had issues with log rotate not working correctly and the tempfs partition filling up. This should now be fixed

Latest update from @Andy_Taylor now also displayes Pi RAM usage :thumbsup: :

RAM usage has been added (along with system load), what do you guys want to see in relation to network speeds?
The speed of the WiFi connection is already available on the wifi configuration page.

The issues of the /var/log volume filling up should be behind us in the recent releases, I can add it if we really want it?

It would be nice to head off problems before things grind to a halt.

Using my car as an example, it constantly monitors it’s own health - tyre pressures, oil level, fuel, brake pad wear and so on, and goes through a series of prompts & alerts before finally breaking down at the roadside.
As @borpin has suggested above, a similar thing could apply here, monitoring the system in the background, and producing a pop-up alert, push message, email or whatever to alert users that there is a problem (and maybe how to resolve it?).


1 Like

There are a couple of things we can do for sure, setting up e-mail alerts is one, but that is more likely to be troublesome. Having an auto reboot is another possibility when the log volume runs to 95% or so.

I have written the code for having the /var/log partition displayed when its mounted on tempfs, so that is coming very soon.

I’ve also been beavering away to get a reboot button working on the admin page too - that is also now done, I’ll do the PR once I am actually awake in the morning.

Great forum and great projects, it inspires me to expand my house with Sensors.
I noticed that on the Admin page the disk space display is colored, with me this is transparent and hardly readable, how can I modify this?

It seems readable to me, bit feel free to modify on your own setup

Just edit: