-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
showlog uses hardcoaded cgi.cfg not compatible with naemon #5
Comments
Thanks for another excellent report! In #3, I suggested to move/duplicate the configuration parameter from naemon.cfg to Ninja's configuration files, but in this case, I would propose another way of solving the issue. As you can tell, Ninja is a bit incoherent about where to look for data from external parts, which makes it sad to debug from time to time. A small recap: the showlog binary belongs to Merlin, which emits report events as text or HTML. One of the arguments to the showlog binary is the path to the file cgi.cfg, and as far as I can tell, it only uses the contents of cgi.cfg to find the value of So, basically, this API is a bit of a mess to begin with. I would like Ninja to be decoupled from Merlin, Ninja should at minimum not call hardcoded things from within the code. I think we will have to think about how to best approach this, because of its tight connection to Merlin (and on top of that, the Merlin that is shipped and configured with OP5 Monitor contrary to the open source version of Merlin). |
Hi Carl, One suggestion if I may. I would switch the execution from something like this : Maybe naemon.cfg can be reference in /var/www/html/ninja/application/config/config.php as something like: nagios_cfg will become a user defined variable, and then can be reused across all code. merlin - ninja integration .....I understand what you mean ...but hey...if its designed to work together...then it makes total sense to keep that tight integration and refine the api calls ;) Good luck and have a nice weekend, |
I totally agree with not pointing at cgi.cfg. It should be deprecated and each of its config-lines should be either discarded or moved to a better place. The "CGI" part of the filename refers to the now-dead interface of Nagios, i.e. a legacy; after that we just continued using some of the file's variables. I agree with your proposition, referring to naemon.cfg/nagios.cfg might be a good middleground. Ideally, Ninja should not depend on other programs' configuration files. "Bounded context", if I may throw in a buzzword. On the other hand, the user should not have to edit identical configuration values in different locations. Have a nice weekend! |
Hi Guys,
Please have a look at this line :
https://github.com/op5/ninja/blob/500b186445aba158ac1d8cc57072e785287e93be/modules/monitoring/helpers/showlog.php#L38 :
$etc_path = System_Model::get_nagios_etc_path();
$cgi_cfg = rtrim($etc_path, '/').'/cgi.cfg';
In a standard naemon install etc directory is here :
$config['nagios_etc_path'] = '/etc/naemon/';
as defined also in /var/www/html/ninja/application/config/config.php
showlog.php looks into this path for cgi.cfg : /etc/naemon/cgi.cfg but standard naemon install place cgi.cfg in /etc/thruk/cgi.cfg .
Quickfix is to create a symlink between /etc/thruk/cgi.cfg /etc/naemon/cgi.cfg but I would suggest cgi.cfg and nagios.cfg files not to be hardcoaded into the code but used as user defined variables in ninja/application/config/config.php .
The problem with cgi.cfg not being available to ninja is that Ninja will not display the Event Log in Menu : Report / EventLog
Cheers,
Adrian
The text was updated successfully, but these errors were encountered: