XavierBerger / RPi-Monitor

Real time monitoring for embedded devices
https://xavierberger.github.io/RPi-Monitor-docs/index.html
GNU General Public License v3.0
1.15k stars 175 forks source link

Statistics graph with wrong datetime #367

Open monojk opened 3 years ago

monojk commented 3 years ago

I have rpimonitor running on 3 Raspberries. On all, the datetime on the x-axis is very different but never recent, even after reset selection was pressed. Today is May 18th The rpimonitors were all installed and activated on the same day. Info for the 2 Raspberries: Processor: BCM2835 Distribution: Raspbian GNU/Linux 10 (buster) Kernel version: Linux 5.10.17-v7+ armv7l Firmware: #1403 Package(s): 15 upgradable(s)

Processor: BCM2835 Distribution: Raspbian GNU/Linux 10 (buster) Kernel version: Linux 5.10.17-v7+ armv7l Firmware: #1403 Package(s): 16 upgradable(s)

rpimonitor

telemaxx commented 3 years ago

have you checked Date/Time eg via console?

monojk commented 3 years ago

In the status tab of rpimonitor as well as in the console the date and time is correct.

telemaxx commented 3 years ago

strange.

psa-jforestier commented 3 years ago

Hello. Can you check what is the date in the /var/log/rpimonitor.log file ? Also, add some verbosity to the log by doing sudo killall -USR1 rpimonitor and check the date displayed on the log file.

monojk commented 3 years ago
pi@rp3b0:/var/log $ ls -latr rpimonitor.log
-rw-r--r-- 1 root root 224 May 24 12:33 rpimonitor.log

pi@rp3b0:/var/log $ sudo killall -USR1 rpimonitord

pi@rp3b0:/var/log $ ls -latr rpimonitor.log
-rw-r--r-- 1 root root 353 May 26 09:52 rpimonitor.log

pi@rp3b0:/var/log $ tail -f rpimonitor.log
[2021/05/24-12:33:45] RPi-Monitor has been started
                  Log level can be increased or decreased during runtime
                  by sending signal USR1 or USR2 with the command killall -USRx rpimonitord
[2021/05/26-09:52:51] Change loglevel to 1
[[2021/05/26-09:52:512021/05/26-09:52:51] Change loglevel to ] Change loglevel to 11
monojk commented 3 years ago

Any ideas?

monojk commented 3 years ago

I see that when selecting "Uptime", "CPU Loads", or "Temperature", the charts have the correct date/time in contrast to "Memory", "Swap", and "Disks" I also see that the files in /var/lib/rpimonitor/stat are up to date

/var/lib/rpimonitor/stat# ls -latr total 2076 drwxrwxr-x 3 pi pi 4096 May 2 10:44 .. -rw-r--r-- 1 pi pi 191804 May 24 12:33 empty.rrd drwxr-xr-x 2 root root 4096 May 24 12:33 . -rw-r--r-- 1 root root 191804 Jun 7 10:12 uptime.rrd -rw-r--r-- 1 root root 191804 Jun 7 10:12 swap_used.rrd -rw-r--r-- 1 root root 191804 Jun 7 10:12 soc_temp.rrd -rw-r--r-- 1 root root 191804 Jun 7 10:12 sdcard_root_used.rrd -rw-r--r-- 1 root root 191804 Jun 7 10:12 sdcard_boot_used.rrd -rw-r--r-- 1 root root 191804 Jun 7 10:12 memory_free.rrd -rw-r--r-- 1 root root 191804 Jun 7 10:12 memory_available.rrd -rw-r--r-- 1 root root 191804 Jun 7 10:12 load5.rrd -rw-r--r-- 1 root root 191804 Jun 7 10:12 load1.rrd -rw-r--r-- 1 root root 191804 Jun 7 10:12 load15.rrd

telemaxx commented 3 years ago

can try to stop rpimonitor, rename one of the rrd database files and start the service again. (/var/lib/rpimonitor/stat/swap.rrd)

monojk commented 3 years ago

stopped rpimonitor renamed sdcard_root_used.rrd started rpimonitor sdcard_root_used.rrd gets created but the graph is the same as before for "Disks - root" all rrd files have the same size

telemaxx commented 3 years ago

no idea. same size is normal.

gilarelli commented 3 years ago

Try to put the "Total Memory" graph (the static one) not in first place :

web.statistics.1.content.1.name=Memory web.statistics.1.content.1.graph.1=memory_available web.statistics.1.content.1.graph.2=memory_total web.statistics.1.content.1.ds_graph_options.memory_available.label=Available Memory (GB) web.statistics.1.content.1.ds_graph_options.memory_total.label=Total Memory(GB)

I had the same troubles as you and found this solution on the web (can't remember where tho)

monojk commented 3 years ago

Try to put the "Total Memory" graph (the static one) not in first place :

web.statistics.1.content.1.name=Memory web.statistics.1.content.1.graph.1=memory_available web.statistics.1.content.1.graph.2=memory_total web.statistics.1.content.1.ds_graph_options.memory_available.label=Available Memory (GB) web.statistics.1.content.1.ds_graph_options.memory_total.label=Total Memory(GB)

I had the same troubles as you and found this solution on the web (can't remember where tho)

Which file(s) would I have to change? I was looking into the files under /etc/rpimonitor and /etc/rpimonitor/template

gilarelli commented 3 years ago

Which file(s) would I have to change? I was looking into the files under /etc/rpimonitor and /etc/rpimonitor/template

In the .conf file for the metrics you want to graph that is called in your /etc/rpimonitor/data.conf with an "include" line

/etc/rpimonitor]# cat data.conf web.page.icon='img/hwmonitor.png' [...] include=/etc/rpimonitor/nanopim4/memory.conf

/etc/rpimonitor]# cat nanopim4/memory.conf static.1.name=memory_total static.1.source=/proc/meminfo static.1.regexp=MemTotal:\s+(\d+) static.1.postprocess=$1/1048576

dynamic.1.name=memory_available dynamic.1.source=/proc/meminfo dynamic.1.regexp=MemAvailable:\s+(\d+) dynamic.1.postprocess=$1/1048576 dynamic.1.rrd=GAUGE

[...]

web.statistics.1.content.1.name=Memory web.statistics.1.content.1.graph.1=memory_available web.statistics.1.content.1.graph.2=memory_total web.statistics.1.content.1.ds_graph_options.memory_available.label=Available Memory (GB) web.statistics.1.content.1.ds_graph_options.memory_total.label=Total Memory (GB)

monojk commented 3 years ago

Thanks, that did the trick. So, these statistics are affected: Memory, Swap, Disks - boot, Disks - root

gilarelli commented 3 years ago

Thanks, that did the trick.

You're welcome :)

So, these statistics are affected: Memory, Swap, Disks - boot, Disks - root

Basically, each time you want to have a static value in your graph, you have to put it NOT in first place

monojk commented 3 years ago

Thanks, that did the trick.

You're welcome :)

So, these statistics are affected: Memory, Swap, Disks - boot, Disks - root

Basically, each time you want to have a static value in your graph, you have to put it NOT in first place

So, yes. Initially I didn't change anything from the fresh install and got the problem. I guess it needs to be fixed there also.

Robyxxx commented 2 years ago

I had the same problem and following your suggestion I solved it