CoreElec HW monitor

Edit /opt/etc/netdata/netdata.conf:

debug log = /opt/var/log/netdata/debug.log
error log = /opt/var/log/netdata/error.log
access log = /opt/var/log/netdata/access.log

So, I managed to install Netdata and it’s working fine. But the temperature is really the main function I need, to keep an eye on the KIII PRO cpu temp. I also found unofficial app for iOS, called NetData, but when I add in the server address, it says Invalid server - weird.
Anyway, lets focus on temp display first.

BTW, NetData is amazing. I really like the design and the amount of data. It shows both of the external hard drives connected to USBs. Really cool

The bash method using charts.d modules won’t work, because it apparently needs a full blown version of bash instead of the busybox we are using in CE.

What I found out so far:
The charts.d module needs to be enabled to be used for sensors.
This can be done in /opt/etc/netdata/netdata.conf

charts.d = yes

According to the article previously posted by Uukrul, sensors should be disabled in /opt/etc/netdata/python.d.conf to prevent using the lm-sensors method:

sensors = no

…and enabled in /opt/etc/netdata/charts.d.conf, to use the bash method instead:

sensors = force

But after a restart of the netdata service, it’s still not included in the navigation.

If you are executing the charts.d.plugin script manually with debug option enabled, you are getting an error message:

# /opt/lib/netdata/plugins.d/charts.d.plugin debug 1
bash: 0: unknown operand
/opt/lib/netdata/plugins.d/charts.d.plugin: line 97: syntax error: bad substitution

This is a problem in the function “require_cmd()”, which only checks for available bash commands.
Even if you comment out this function, the corresponding command checks and another line a bit below, which parses the output of this function (because this isn’t required for the execution of the script itself), it fails with another error in a charts.d plugin file.

I think, we would really need to rewrite the whole charts.d.plugin script as well as all modules started with it. This is a bit too much work for a simple temperature graph.
It would be easier for sure to write a python.d plugin, which checks /sys/devices/virtual/thermal/thermal_zone0/temp, but that’s out of my comfort zone.

You have to do this:

opkg install bash tc coreutils-timeout

and you’ll get this nice screen without data:

and this error:

2018-09-26 23:22:04: netdata INFO : PLUGINSD[charts.d] : Initializing file /opt/var/cache/netdata/sensors.temp_thermal_zone0_thermal_thermal_zone0/main.db.
2018-09-26 23:22:04: netdata INFO : PLUGINSD[charts.d] : Initializing file /opt/var/cache/netdata/sensors.temp_thermal_zone0_thermal_thermal_zone0/sys_devices_virtual_thermal_thermal_zone0_temp.db.
/opt/lib/netdata/plugins.d/charts.d.plugin: Cannot use current_time_ms_from_uptime() - new time 510 is older than the last 82256790 - falling back to current_time_ms_from_date().
/opt/lib/netdata/plugins.d/loopsleepms.sh.inc: line 22: 1537996924 * 1000 + %-N / 1000000 : syntax error: operand expected (error token is "%-N / 1000000 ")
2018-09-26 23:22:04: netdata ERROR : PLUGINSD[charts.d] : read failed
2018-09-26 23:22:04: netdata ERROR : PLUGINSD[charts.d] : ‘/opt/lib/netdata/plugins.d/charts.d.plugin’ (pid 22207) disconnected after 0 successful data collections (ENDs).
2018-09-26 23:22:04: netdata ERROR : PLUGINSD[charts.d] : ‘/opt/lib/netdata/plugins.d/charts.d.plugin’ (pid 22207) does not generate useful output but it reports success (exits with 0). Waiting a bit before starting it again…

I didn’t know, a bash installation was available in Entware.
That’s great…kind of…at least one step closer.

The main problem now seems to be this one (again executed charts.d.plugin with debug enabled):

2018-09-26 23:43:10: charts.d: INFO: main: started from '/opt/lib/netdata/plugins.d/charts.d.plugin' with options: debug 1
/opt/lib/netdata/plugins.d/loopsleepms.sh.inc: line 22: 1537998190 * 1000 + %-N / 1000000 : syntax error: operand expected (error token is "%-N / 1000000 ")
/opt/lib/netdata/plugins.d/loopsleepms.sh.inc: line 63: [: : integer expression expected
2018-09-26 23:43:10: charts.d: INFO: main: configuration file '/opt/lib/netdata/plugins.d/../../../../etc/netdata/charts.d.conf' not found. Using defaults.

This version of bash seems to have problems with calculations using $(( … )).
Furthermore it can’t find the file /opt/etc/netdata/charts.d.conf, though the path should be the right one.

EDIT: No, wait…the path to the charts.d.conf isn’t the right one, because it searches the file in /etc/netdata/ instead of /opt/etc/netdata.
At least, if I count the “…/” correctly, because my eyes begin to flicker, now. ^^

I got it working :slight_smile:

with a nasty hack. Replace /opt/lib/netdata/plugins.d/loopsleepms.sh.inc with this one and voilà

edit: Wrong file, use this instead:

loopsleepms.sh.inc (5.0 KB)

It works for me, too. :slight_smile:
Thank you for the hacked up file.

But I also changed line 125 in charts.d.plugin to the following one to get rid of the “configuration file not found” message:

myconfig="/opt/etc/netdata/charts.d.conf"

Unfortunately in my install of coreelec, glibc 2.27/28 seems to missing. I’m not sure if that’s the way it should be.

If you follow these steps, you shouldn’t have any problems:

Install Entware and reboot your box.

From ssh type this:
opkg install netdata bash tc coreutils-timeout

Unpack the attached file to /storage/.opt replacing the files.

netdata.zip (5.4 KB)

Now you can access the netdata dashboard from http://coreelec_box_ip:19999

9 Likes

Excellent write up @Uukrul :+1:

Excellent! @Uukrul
Entware Package Manager is the nicest thing added to CoreElec @anon88919003

3 Likes

Maybe I am being obtuse this am, but I am unsure whether some specific files or complete directories should overwrite existing directories/files.

Would it be possible to post a couple of commands to ensure the correct procedure is followed?

Thank you.

Here is a little script, which automates the installation:
entware_netdata.sh (649 Bytes)

After downloading it with wget, you need to add the execute flag:
chmod +x entware_netdata.sh

3 Likes

Thank you.
That cleared up my confusion.

Also very nice to have a script to do the job without having to decide on paths :slight_smile:

Appreciate the help :wink:

1 Like

I’ve modified the System Overview to include the temperature:

netdata.zip (55.6 KB)

1 Like

very cool. Is it possbile to move the items or you have to do it?

Nice to have temp up there with the rest! :smiley:

Thanks.

If you only want to do a quick hack moving around gauges, edit /storage/.opt/share/netdata/web/index.html (function headMain(os, charts, duration) at pos 1656)

I’ve added it to the install script I posted earlier:

@Uukrul:
Are your previous changes still included in the last zip you posted?

2 Likes