RPi-Monitor icon indicating copy to clipboard operation
RPi-Monitor copied to clipboard

Statistics graph with wrong datetime

Open monojk opened this issue 3 years ago • 17 comments

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

monojk avatar May 18 '21 06:05 monojk

have you checked Date/Time eg via console?

telemaxx avatar May 18 '21 18:05 telemaxx

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

monojk avatar May 18 '21 18:05 monojk

strange.

telemaxx avatar May 19 '21 15:05 telemaxx

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.

psa-jforestier avatar May 26 '21 07:05 psa-jforestier

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 avatar May 26 '21 07:05 monojk

Any ideas?

monojk avatar Jun 05 '21 11:06 monojk

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

monojk avatar Jun 07 '21 07:06 monojk

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

telemaxx avatar Jun 07 '21 08:06 telemaxx

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

monojk avatar Jun 07 '21 15:06 monojk

no idea. same size is normal.

telemaxx avatar Jun 07 '21 18:06 telemaxx

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)

gilarelli avatar Jun 09 '21 21:06 gilarelli

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

monojk avatar Jun 10 '21 06:06 monojk

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)

gilarelli avatar Jun 10 '21 07:06 gilarelli

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

monojk avatar Jun 11 '21 16:06 monojk

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

gilarelli avatar Jun 11 '21 16:06 gilarelli

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.

monojk avatar Jun 11 '21 16:06 monojk

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

Robyxxx avatar Jun 01 '22 16:06 Robyxxx