mikaku / Monitorix

Monitorix is a free, open source, lightweight system monitoring tool.
https://www.monitorix.org
GNU General Public License v2.0
1.12k stars 167 forks source link

fs devmap seems all or nothing #398

Closed H-Sachse closed 2 years ago

H-Sachse commented 2 years ago

the \<devmap> list in the \<fs> section seems to be an all or nothing parameter. I have the situation on a raspberry pi that without the devmap, the root mount did not show I/O activity, because the device for "/" is listed as /dev/root. So I added a devmap entry for / to map to /dev/mmcblk0p2, which then showed I/O activity, but the other usb drives, that showed I/O activity before, then all had no activity shown. Commenting out the mapping for "/" then showed I/O activity for the usb disks, but none for root.

It would be nice if only problematic mounts needed to be mapped manually, and those FSes without mappings would be treated as normal.

mikaku commented 2 years ago

It would be nice if only problematic mounts needed to be mapped manually, and those FSes without mappings would be treated as normal.

Yes, that's the idea. This is exactly how it should work. Can you, please, paste here your entire <fs> section and your /proc/diskstats?

H-Sachse commented 2 years ago

Here's the \<fs>-section

<fs>
        <list>
                0 = /, /boot, /mnt/WD20EARX-2TB-SN11, /mnt/WD20EARX-2TB-SN91, /mnt/WD30PURX-3TB-SNC3
        </list>
        <desc>
        </desc>
        <devmap>
                #/ = mmcblk0p2  
        </devmap>
        rigid = 2, 0, 2, 0
        limit = 100, 1000, 100, 1000
        <alerts>
        </alerts>
</fs>

and /proc/diskstats

179       0 mmcblk0 88002 33831 4240601 209788 185940 59387 5196106 9025620 0 567860 9235788 123 35 23586051 379 0 0
 179       1 mmcblk0p1 295 7016 24935 1249 2 0 2 7 0 864 1262 1 1 454491 6 0 0
 179       2 mmcblk0p2 87687 26815 4214610 208506 185938 59387 5196104 9025613 0 567620 9234492 122 34 23131560 373 0 0
   8       0 sda 9313 3057 63780 71595 91 437 4224 168 0 88936 71763 0 0 0 0 0 0
   8       1 sda1 3328 3057 56642 6207 91 437 4224 168 0 7228 6375 0 0 0 0 0 0
   8      16 sdb 6214 414 17953 43831 19 46 520 30 0 60108 43862 0 0 0 0 0 0
   8      17 sdb1 244 414 10826 1647 19 46 520 30 0 1700 1678 0 0 0 0 0 0
   8      32 sdc 615289 18522 145786499 1459234 17652986 8224910 935544760 21468125 0 26139868 22927359 0 0 0 0 0 0
   8      33 sdc1 609304 18522 145779380 1418157 17652986 8224910 935544760 21468125 0 26102980 22886282 0 0 0 0 0 0

and the output of df:

Filesystem      1K-blocks       Used  Available Use% Mounted on
/dev/root        15030204    3056236   11333184  22% /
devtmpfs           781452          0     781452   0% /dev
tmpfs              947148          0     947148   0% /dev/shm
tmpfs              378860       2960     375900   1% /run
tmpfs                5120          4       5116   1% /run/lock
/dev/mmcblk0p1     258095      30518     227577  12% /boot
/dev/sdb1      1921723584 1626764804  197266776  90% /mnt/WD20EARX-2TB-SN91
/dev/sda1      1921723584 1564618048  259413532  86% /mnt/WD20EARX-2TB-SN11
/dev/sdc1      2884152988  897403860 1840219468  33% /mnt/WD30PURX-3TB-SNC3
tmpfs              189428          0     189428   0% /run/user/1001
mikaku commented 2 years ago

The df output looks incomplete, I don't see the / file system listed. Also the last disk in your <fs> section has an incomplete name.

H-Sachse commented 2 years ago

Fixed my comment.

mikaku commented 2 years ago

OK, now I'd need to see the error messages in the Monitorix log file. Please, restart Monitorix and paste here all the lines in the log file that appeared after your made the restart.

H-Sachse commented 2 years ago

here's a log with the map disabled:

Sun Feb 13 20:48:25 2022 - Starting Monitorix version 3.14.0 (pid 75505).
Sun Feb 13 20:48:25 2022 - Loaded main configuration file '/etc/monitorix/monitorix.conf'.
Sun Feb 13 20:48:25 2022 - Loading extra configuration file '/etc/monitorix/conf.d/00-debian.conf'.
Sun Feb 13 20:48:25 2022 - Loading extra configuration file '/etc/monitorix/conf.d/10-avconvpi.conf'.
Sun Feb 13 20:48:25 2022 - Initializing graphs.
Sun Feb 13 20:48:26 2022 - Generating the 'index.html' file.
Sun Feb 13 20:48:26 2022 - WARNING: the HTTP built-in server has authentication disabled.
HTTPServer: You can connect to your server at http://localhost:8080/
Sun Feb 13 20:48:26 2022 - Started HTTP built-in server (pid 75521).
Sun Feb 13 20:48:26 2022 - Ok, ready.
Sun Feb 13 20:52:14 2022 - SIGTERM caught.
Sun Feb 13 20:52:14 2022 - Exiting.
Sun Feb 13 20:52:15 2022 - Starting Monitorix version 3.14.0 (pid 75819).
Sun Feb 13 20:52:15 2022 - Loaded main configuration file '/etc/monitorix/monitorix.conf'.
Sun Feb 13 20:52:15 2022 - Loading extra configuration file '/etc/monitorix/conf.d/00-debian.conf'.
Sun Feb 13 20:52:15 2022 - Loading extra configuration file '/etc/monitorix/conf.d/10-avconvpi.conf'.
Sun Feb 13 20:52:15 2022 - Initializing graphs.
Sun Feb 13 20:52:15 2022 - fs::fs_init: Unable to detect the device name of '/', I/O stats won't be shown in graph. If this is really a mount point then consider using <devmap> to map it manually to a device name.
Sun Feb 13 20:52:15 2022 - Generating the 'index.html' file.
Sun Feb 13 20:52:15 2022 - WARNING: the HTTP built-in server has authentication disabled.
HTTPServer: You can connect to your server at http://localhost:8080/
Sun Feb 13 20:52:15 2022 - Started HTTP built-in server (pid 75837).
Sun Feb 13 20:52:15 2022 - Ok, ready.
Tue Feb 15 17:56:08 2022 - SIGTERM caught.
Tue Feb 15 17:56:08 2022 - Exiting.

and here's one with the map enabled:

ue Feb 15 17:56:09 2022 - Starting Monitorix version 3.14.0 (pid 226296).
Tue Feb 15 17:56:09 2022 - Loaded main configuration file '/etc/monitorix/monitorix.conf'.
Tue Feb 15 17:56:09 2022 - Loading extra configuration file '/etc/monitorix/conf.d/00-debian.conf'.
Tue Feb 15 17:56:09 2022 - Loading extra configuration file '/etc/monitorix/conf.d/10-avconvpi.conf'.
Tue Feb 15 17:56:09 2022 - Initializing graphs.
Tue Feb 15 17:56:09 2022 - Generating the 'index.html' file.
Tue Feb 15 17:56:09 2022 - Started HTTP built-in server (pid 226312).
Tue Feb 15 17:56:09 2022 - Ok, ready.
Tue Feb 15 17:56:09 2022 - WARNING: the HTTP built-in server has authentication disabled.
HTTPServer: You can connect to your server at http://localhost:8080/
Tue Feb 15 17:58:33 2022 - SIGTERM caught.
Tue Feb 15 17:58:34 2022 - Exiting.
Tue Feb 15 17:58:34 2022 - Starting Monitorix version 3.14.0 (pid 226478).
Tue Feb 15 17:58:34 2022 - Loaded main configuration file '/etc/monitorix/monitorix.conf'.
Tue Feb 15 17:58:34 2022 - Loading extra configuration file '/etc/monitorix/conf.d/00-debian.conf'.
Tue Feb 15 17:58:34 2022 - Loading extra configuration file '/etc/monitorix/conf.d/10-avconvpi.conf'.
Tue Feb 15 17:58:34 2022 - Initializing graphs.
Tue Feb 15 17:58:35 2022 - Generating the 'index.html' file.
Tue Feb 15 17:58:35 2022 - Started HTTP built-in server (pid 226494).
Tue Feb 15 17:58:35 2022 - Ok, ready.
Tue Feb 15 17:58:35 2022 - WARNING: the HTTP built-in server has authentication disabled.

right now it is logging both / and the other fses, but the following graph shows the issue I had: image on saturday I had the map enabled and it only logged for "/" but not for the "mnt" fses

I'l leave it running with the map for "/" enabled and see what happens.

mikaku commented 2 years ago

I've setup a similar configuration here where root filesystem is /dev/root and after mapping the correct drive in <devmap>:

        <devmap>
                / = sda3
        </devmap>

all is working fine. The rest of drives are reporting I/O stats in the graph without any problem.

I see that you have two extra configuration files:

Tue Feb 15 17:58:34 2022 - Loading extra configuration file '/etc/monitorix/conf.d/00-debian.conf'. Tue Feb 15 17:58:34 2022 - Loading extra configuration file '/etc/monitorix/conf.d/10-avconvpi.conf'.

If you are modifying the main configuration file, then make sure you have not defined another <fs> section in those extra files that is overriding your settings.

H-Sachse commented 2 years ago

The monitorix.conf is the one that came with the debian packkage. I only edit 10-avconvpi.conf so a package update does not kill my settings.

I'll close this now. Seems the issue is no longer there. No idea what the reason for the initial malfunction might have been.

mikaku commented 2 years ago

The monitorix.conf is the one that came with the debian packkage. I only edit 10-avconvpi.conf so a package update does not kill my settings.

That's indeed the correct way to configure Monitorix.

I'll close this now. Seems the issue is no longer there. No idea what the reason for the initial malfunction might have been.

OK, thanks anyway for your feedback.