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

Move web assets to /usr/share/monitorix #294

Closed lyknode closed 4 years ago

lyknode commented 4 years ago

Currently, /var/lib/monitorix is used to store two types of content:

The FHS defines /var/lib as the location for "Variable state information".

Therefor I would suggest to move the web assets files to a more appropriate location, such as /usr/share/monitorix (Used for "Architecture-independent data").

mikaku commented 4 years ago

The reports/ directory only holds static data that was placed during the Monitorix installation. I think this directory can, indeed, be safely moved to a different location.

The www/ directory though is used to store variable information:

I mean, all the tree under www/ is what forms the web files to be able see the Monitorix graphs.

lyknode commented 4 years ago

Ah you're right, under www/, only the following files are installed from the Makefile:

It would be nice to be able to split that from the dynamic stuff, but I can already see that becoming more of a hassle than actually solving a minor issue. Might be better to drop that part and only do the reports/

mikaku commented 4 years ago

I've been thinking about moving reports/ out from the www/ tree, and it would bring some cumbersome changes.

The reason why reports/ is inside the www/ tree is because Monitorix can locate it easily by just using the option base_dir as a prefix. If you change it out from www/ tree and install it in /usr/share/monitorix, the option base_dir cannot be used anymore and, instead, it will be necessary to create a new specific option for this (something like base_reports_dir).

Such new option must be synced with the directory where reports/ will be installed, and this changes on BSD systems, and might change even between Linux distributions, forcing to adapt the default configuration file to that directory.

So, the question is: does this location change worth all this work?

Don't get me wrong, I'm with you that ideally the reports/ directory should go to a read-only part of the file system.

lyknode commented 4 years ago

That's a valid point. Configuration file gets modified, requires a user intervention to work. Far from ideal.

In that case I would do the same as for the 8080 port issue. Keep that in the background until a new major/breaking version comes out. Maybe for monitorix 4.x then? ^^

Feel free to close the issue if you wish to.

mikaku commented 4 years ago

Keep that in the background until a new major/breaking version comes out. Maybe for monitorix 4.x then? ^^

You're right.

I've just created the new issue #295 for exactly this purpose. Please, feel free to include those major/breaking new features.

Thanks!