Cgi.cfg path embedded in binary CGIs


Hi, I am running into this issue and don’t know if there is an easy solution barring the rebuild of Nagios. I build Nagios from source on one machine with a given prefix ‘/ngs/app/lisd’. I have now deployed this app on another machine under ‘/ngs/app/lispmont’. When I try to run the Nagios UI, I get this error,

EError: Could not open CGI config file ‘/ngs/app/lisd/nagios-323-deploytar/nagios-323-deploytar–withgd/etc/cgi.cfg’ for reading!

It seems that the prefix ‘/ngs/app/lisd’ is embedded into the cgi scripts like status.cgi. Is there any way to override this through apache or some sort of configuration.


you could try creating a link from ‘/ngs/app/lisd’ to ‘/ngs/app/lispmont’. But it would be easier to rebuild nagios on the correct machine… :confused:


There is no option to create a link or to rebuild. I read in the Nagios documentation that this env variable NAGIOS_CGI_CONFIG can be used and configured in Apache to send the right path to the cgi.cfg file. Has anyone tried it out. It doesn’t seem to work for me. I did configure it in the Apache envvars file. It seems to pick up all the other vars except this one or maybe this is not the right way to use it.


rebuilding is always an option :slight_smile: you don’t need to build it on the target system.


Our’s is a very peculiar situation where rebuilding is not an option due to a variety of reasons. So is there any way we can get this to run in it’s present state by passing in this env variable at runtime to have it look for cgi.cfg at an alternate location.


The apache SetEnv directive in the appropriate ScriptAlias section solved this problem in case anyone else runs into this issue. No need to rebuild :slight_smile: