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

Install without built-in webserver #65

Closed djmattyg007 closed 7 years ago

djmattyg007 commented 10 years ago

How difficult would it be to install Monitorix without its built-in webserver?

graysky2 commented 10 years ago

The built in is disabled by default... just install and use your own... perl-http-server-simple is not provided but is a dependency.

mikaku commented 10 years ago

You can start by reading the FAQ: http://www.monitorix.org/faq.html#Q120

djmattyg007 commented 10 years ago

I don't think I communicated my question very well.

When I try and install this through the Arch Linux AUR (see this URL: https://aur.archlinux.org/packages/monitorix), one of its dependencies is perl-http-server-simple.

My question is, if I were to not install that package, would Monitorix still run (assuming the built-in webserver was disabled)?

mikaku commented 10 years ago

Forcing a package to install without satisfying some of its dependencies is not a good practice, mainly because the code might have not be thought with this in mind.

This is our case, Monitorix asks if its HTTP built-in is enabled or not before set it up: https://github.com/mikaku/Monitorix/blob/master/monitorix#L587-L590

The problem here is that in order make sure that it will be able to call the httpd_setup() function, it loads first the HTTPServer module in the beginning of the program: https://github.com/mikaku/Monitorix/blob/master/monitorix#L30

You might want to try to remove the line 30 and insert it right after the if (in line 588). Hence, it won't load that module unless you really enable the HTTP built-in.

Let me know if that works for you and I'll patch the official tree. Thanks.

mikaku commented 7 years ago

Please check https://github.com/mikaku/Monitorix/commit/0fdc7f2f6008d65113e505aa5e8e33f34f00375c commit.