Nagios config error

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
hasselol
Posts: 2
Joined: Thu Mar 28, 2013 2:25 am

Nagios config error

Post by hasselol »

Hi! I got a problem i havent been able to solve after i reorganized my config files (It worked before i did it).

When i restart nagios:

Code: Select all

ekonomi@ubuntu-it-lab:~$ service nagios restart
Running configuration check... CONFIG ERROR!  Restart aborted.  Check your Nagios configuration.
ekonomi@ubuntu-it-lab:~$
And then when i do config check:

Code: Select all

ekonomi@ubuntu-it-lab:~$ sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Nagios Core 3.4.4
Copyright (c) 2009-2011 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 01-12-2013
License: GPL

Website: http://www.nagios.org
Reading configuration data...
   Read main config file okay...
Processing object config file '/usr/local/nagios/etc/objects/commands.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/contacts.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/timeperiods.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/templates.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/hosts.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/services.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/dependencies.cfg'...
Processing object config file '/usr/local/nagios/etc/objects/hostgroups.cfg'...
   Read object config files okay...

Running pre-flight check on configuration data...

Checking services...
        Checked 51 services.
Checking hosts...
        Checked 9 hosts.
Checking host groups...
        Checked 5 host groups.
Checking service groups...
        Checked 0 service groups.
Checking contacts...
        Checked 1 contacts.
Checking contact groups...
        Checked 1 contact groups.
Checking service escalations...
        Checked 0 service escalations.
Checking service dependencies...
        Checked 0 service dependencies.
Checking host escalations...
        Checked 0 host escalations.
Checking host dependencies...
        Checked 1 host dependencies.
Checking commands...
        Checked 24 commands.
Checking time periods...
        Checked 5 time periods.
Checking for circular paths between hosts...
Checking for circular host and service dependencies...
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors:   0

Things look okay - No serious problems were detected during the pre-flight check
ekonomi@ubuntu-it-lab:~$
And when i use some sh command:

Code: Select all

ekonomi@ubuntu-it-lab:~$ sh -x /etc/init.d/nagios start                         + test -f /etc/sysconfig/nagios
+ [ -f /etc/rc.d/init.d/functions ]
+ [ -f /etc/init.d/functions ]
+ prefix=/usr/local/nagios
+ exec_prefix=/usr/local/nagios
+ NagiosBin=/usr/local/nagios/bin/nagios
+ NagiosCfgFile=/usr/local/nagios/etc/nagios.cfg
+ NagiosStatusFile=/usr/local/nagios/var/status.dat
+ NagiosRetentionFile=/usr/local/nagios/var/retention.dat
+ NagiosCommandFile=/usr/local/nagios/var/rw/nagios.cmd
+ NagiosVarDir=/usr/local/nagios/var
+ NagiosRunFile=/usr/local/nagios/var/nagios.lock
+ NagiosLockDir=/var/lock/subsys
+ NagiosLockFile=nagios
+ NagiosCGIDir=/usr/local/nagios/sbin
+ NagiosUser=nagios
+ NagiosGroup=nagios
+ [ ! -f /usr/local/nagios/bin/nagios ]
+ [ ! -f /usr/local/nagios/etc/nagios.cfg ]
+ echo -n Starting nagios:
Starting nagios:+ /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
+ [ 126 -eq 0 ]
+ echo CONFIG ERROR!  Start aborted.  Check your Nagios configuration.
CONFIG ERROR!  Start aborted.  Check your Nagios configuration.
+ exit 1
ekonomi@ubuntu-it-lab:~$
Got any ideas?

Thanks in advance!
User avatar
gshergill
Posts: 231
Joined: Tue Aug 07, 2012 5:08 am

Re: Nagios config error

Post by gshergill »

Hi hasselol,

Try running below:

Code: Select all

sudo service nagios restart
Kind Regards,

Gary Shergill
hasselol
Posts: 2
Joined: Thu Mar 28, 2013 2:25 am

Re: Nagios config error

Post by hasselol »

Hi gshergill,

Yes i realized afterwards that i didn't have permission. Sudo did the trick.

Thanks alot!

Regards, Hasselol
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Nagios config error

Post by slansing »

Great, thanks for the help Gshergill!
Locked