How to find 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
rames
Posts: 3
Joined: Tue Apr 19, 2011 8:31 am

How to find config error?

Post by rames »

Hello,

I've Nagios core 3.2.0, which was today upgraded to 3.2.3. After upgrading I cannot run it,
I get following output:

s-25 log # /usr/sbin/nagios --verify-config /etc/nagios/nagios.cfg

Nagios Core 3.2.3
Copyright (c) 2009-2010 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 10-03-2010
License: GPL

Website: http://www.nagios.org
Reading configuration data...
Read main config file okay...
Processing object config file '/etc/nagios/objects/commands.cfg'...
Processing object config file '/etc/nagios/objects/contacts.cfg'...
Processing object config file '/etc/nagios/objects/contactgroups.cfg'...
Processing object config file '/etc/nagios/objects/timeperiods.cfg'...
Processing object config file '/etc/nagios/objects/templates.cfg'...
Processing object config file '/etc/nagios/objects/localhost.cfg'...
Error processing object config files!


***> 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.

It doesn't contain any concrete error or warning. Could you please recommend
any tip, how to localize configuration error? When I read configfiles and compare
with "What's new" document, I cannot be able to find any problem...

Kindly thank you very much in advance

Best regards

Vladislav Rames
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: How to find config error?

Post by mguthrie »

What Linux distribution are you running on?

Can you post the localhost.cfg?
rames
Posts: 3
Joined: Tue Apr 19, 2011 8:31 am

Re: How to find config error?

Post by rames »

Hi, it's 2.6.28-gentoo-r5, I uploaded localhost.cfg.

Thanx.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: How to find config error?

Post by mguthrie »

Can you try pasting the cfg directly? I'm not seeing the cfg.
rames
Posts: 3
Joined: Tue Apr 19, 2011 8:31 am

Re: How to find config error?

Post by rames »

Hello,

thank you. My colleague meanwhile backuped /etc/nagios directory, re-installed
nagios, over this he installed nagiosql and imported config files from backup. Then
we had to do some adjustments, and now it works.

So, it isn't necessary to solve the original problem, hovewer I'm curious why
the original configuration afrer upgrading didn't work withouth any concrete
error message...

Thank you for your willingness, for sure I've post original localhost.cfg
(sending via attachement wasn't successfull, I don't know why).

Best regards

Vladislav Rames
----------------------------------------------------------------
here is original localhost.cfg:

###############################################################################
# LOCALHOST.CFG - SAMPLE OBJECT CONFIG FILE FOR MONITORING THIS MACHINE
#
# Last Modified: 05-31-2007
#
# NOTE: This config file is intended to serve as an *extremely* simple
# example of how you can create configuration entries to monitor
# the local (Linux) machine.
#
###############################################################################




###############################################################################
###############################################################################
#
# HOST DEFINITION
#
###############################################################################
###############################################################################

# Define a host for the local machine

define host{
use linux-server ; Name of host template to use
; This host definition will inherit all variables that are defined
; in (or inherited by) the linux-server host template definition.
host_name localhost
alias localhost
address 127.0.0.1
}



###############################################################################
###############################################################################
#
# HOST GROUP DEFINITION
#
###############################################################################
###############################################################################

# Define an optional hostgroup for Linux machines

define hostgroup{
hostgroup_name linux-servers ; The name of the hostgroup
alias Linux Servers ; Long name of the group
members localhost ; Comma separated list of hosts that belong to this group
}



###############################################################################
###############################################################################
#
# SERVICE DEFINITIONS
#
###############################################################################
###############################################################################




# Define a service to check the disk space of the root partition
# on the local machine. Warning if < 20% free, critical if
# < 10% free space on partition.




# Define a service to check the number of currently logged in
# users on the local machine. Warning if > 20 users, critical
# if > 50 users.

define service{
use local-service ; Name of service template to use
host_name localhost
service_description Current Users
check_command check_local_users!20!50
}


# Define a service to check the number of currently running procs
# on the local machine. Warning if > 250 processes, critical if
# > 400 users.

#define service{
# use local-service ; Name of service template to use
# host_name localhost
# service_description Total Processes
# check_command check_local_procs!250!400!RSZDT
# }



# Define a service to check the load on the local machine.

define service{
use local-service ; Name of service template to use
host_name localhost
service_description Current Load
check_command check_local_load!5.0,4.0,3.0!10.0,6.0,4.0
}



# Define a service to check the swap usage the local machine.
# Critical if less than 10% of swap is free, warning if less than 20% is free

define service{
use local-service ; Name of service template to use
host_name localhost
service_description Swap Usage
check_command check_local_swap!20!10
}



# Define a service to check SSH on the local machine.
# Disable notifications for this service by default, as not all users may have SSH enabled.

define service{
use local-service ; Name of service template to use
host_name localhost
service_description SSH
check_command check_ssh
notifications_enabled 0
}



# Define a service to check HTTP on the local machine.
# Disable notifications for this service by default, as not all users may have HTTP enabled.

define service{
use local-service ; Name of service template to use
host_name localhost
service_description HTTP
check_command check_http
notifications_enabled 0
}
Locked