Nagios will not start after reboot


#1

Nagios will not start after reboot

Recent change:
I removed a server host file from the /usr/local/etc/nagios/servers dir.

I also edited the server hostgroup file that contained the hostname of the server of wich i removed the above file. The hostgtoup file is located In /usr/local/etc/nagios/hostgroup dir

After this, nagios will not start, not even if I undo the changes.

Im new to Nagios, fancy It but cant admin It yet.
Would appreciate some assistance.

TIA

McAllan


#2

See what errors you got when you execute this command in the terminal/shell:
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

And check you syslog for any errors.

Hm, and have you set the nagios to start from init.d? If not, then it is normal for nagios not to start after reboot automaticaly…


#3

Thanks Albin,

The output of the cmd is “command not found” .

The initd has been set, Is has worked earlier so if someone has not done any changes (no one has!), it all should work.

If the command says what it say, how can I check if im missing any files or if paths are wrong?
What file or executable could be missing?
How do I check the initd setting?


#4

The command I’ve told you to check in terminal is path relative, so it depends on where your nagios executable file is (where the nagios binaries are installed). Maybe it is in:
/usr/local/bin/nagios
so try to verify the configuration with that path. Also change the path to nagios.cfg in the mentioned command you should execute. You have to find those paths, 'cause they are different on every distribution of Linux and dependent on the installation itself. You could go to /etc/init.d/ and try to find nagiosX file there. If it is there, view it with some viewer and try to find DAEMON variable. It should point to your nagios binary executable file, so that would be the answer to your exact path finding. When you get some response after you find which paths you should use, that command should tell you if your config files are ok or not.

As for starting Nagios at the boot time, that depends on which distribution of Linux do you run Nagios. So that information is also valuable for us to help you diagnose your problem.
Can you manually control Nagios with executing (has to be executed under root or sudo):
/etc/init.d/nagiosX start|stop|reload
?


#5

Hi, thanks again for your time, Its much appreciated.

The patch you gave me Is the one documented by the person who set it up. That goes for both to the executable and the configuration file.

I will however doubblecheck both patchs.

Regarding the solution, Ive got 3.0.3 of the Enterorise Edition installed on a FreeBSD distribution.
The installation Ios running in VMWare Server 1.0.5.

Ill post the doubblecheck results In a while.

Thanks

//Henrik


#6

I looked and saw that the paths wre not accurate so I changed It, a basic check i should have done my slef :(, ran the cmd again and now the output changed.

root@nagios:~# /usr/local/bin/nagios -v /usr/local/etc/nagios//nagios.cfg

Nagios 3.0rc3
Copyright © 1999-2008 Ethan Galstad (nagios.org)
Last Modified: 02-26-2008
License: GPL

Reading configuration data…

Error: Could not find a service matching host name ‘lagad02’ and description ‘C:
\ Drive Space’ (config file ‘/usr/local/etc/nagios/servicegroups/diskspace.cfg’,
starting on line 1)
Error: Could not expand member services specified in servicegroup (config file ‘
/usr/local/etc/nagios/servicegroups/diskspace.cfg’, starting on line 1)

***> One or more problems was encountered while processing the config files…

 Check your configuration file(s) to ensure that they contain valid
 directives and data defintions.  If you are upgrading from a previous
 version of Nagios, you should be aware that some variables/definitions
 may have been removed or modified in this version.  Make sure to read
 the HTML documentation regarding the config files, as well as the
 'Whats New' section to find out what has changed.

I have noticed the errors my slef and will edit the files with wrong sections.
I will post back the results.

Thanks

//Henrik


#7

Ok, main problem solved. Now there is a problem only with .cfg files.

And try to reboot to see if Nagios starts at the boot time.


#8

I corrected the files were the error log said there were issues and then rebooted the Server.
This time everything went up and smoothly and Is now running as It should be.

Problem solved.

Many thanks :smiley:

Kind Regrads
Henrik/McAllan