Cannot open main configuration file


#1

Hi
I have vefrified the configuration of nagios using the following command
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

and got the following error message in the nagios.log.

Could anyone help me out of this ?

[1152179656] Error: Cannot open main configuration file ‘/home/kbsenthilkumar/Nagios/nagios-2.4/usr/local/nagios/etc/nagios.cfg’ for reading!


#2

Looks like you set the root-dir for Nagios to your homedirectory. That’s probably not right, is it? :smiley:


#3

By the looks of your error, you seemed to have found instructions on how to install nagios that have some big mistakes in them.
Try following the official nagios install docs this time, and recompile, install again. You will NOT be able to use your present nagios install in the shape that it is in now.

nagios.sourceforge.net/docs/2_0/


#4

Thank u for giving suggestions.

Now the nagios running, but i have authentication problem and i received the following message

“It appears as though you do not have permission to view information for any of the hosts you requested…”

"If you believe this is an error, check the HTTP server authentication requirements for accessing this CGI and check the authorization options in your CGI configuration file. "

what could be the problem ?

Senthil


#5

Well, as it said, check the HTTP server authentication requirements for accessing this CGI and check the authorization options in your CGI configuration file.

It sounds like you are using authentication, but missed some important steps like making sure apache has access to the htpassword file, or any number of other things, all pointed out in the nagios, step by step, docs.


#6

hi

Thank u. I successfully rectified the authentication problem, but i am not able retrieve any info in the browser.
The following log message is found in the nagios log:

[1152519717] Warning: Return code of 127 for check of service ‘Current Load’ on host ‘localhost’ was out of bounds. Make sure the plugin you’re trying to run actually exists.
[1152519777] Warning: Return code of 127 for check of service ‘Current Users’ on host ‘localhost’ was out of bounds. Make sure the plugin you’re trying to run actually exists.

The browser displays the following message instead of required info.

Return code of 127 is out of bounds - plugin may be missing) .

I have installed nagios plugins in /usr/local/nagios/libexec folder.

what could be the problem.


#7

the plugins may be missing, but nagios might not have access to them.
Try to run one of them by hand, after you have
su -nagios
now run one of them.
Or perhaps, you have $USER1$ defined to the wrong place, or perhaps the plugin you have defined to run, doesn’t exist.


#8

[quote]I have installed nagios plugins in /usr/local/nagios/libexec folder.
[/quote]

Ah! But have you installed them on your -clients- in said directory? Because each client running NRPE will need to have the scripts installed locally.


#9

Warning: Return code of 127 for check of service ‘Current Load’ on host ‘localhost’ was out of bounds.
That doesn’t sound like a remote host to me. It sounds like he is attempting to check host localhost with the check_load check. So, again, he has bad permissions on the libexec/ files or the check does not exist.


#10

Yep… good point…

Don’t see why you would want to check local services through NRPE, but you’re right :slight_smile: