Generate Config

Support requests, bug reports, questions etc.
Locked
Terry

Generate Config

Post by Terry » Tue Jul 07, 2009 15:35

I have just built a new Ubuntu server 9.04 with Nconf 1.2.5 on it but i can't generate a config file. I have nconf version 1.2.4 working just fine on another Hyper-V virtual server running Ubuntu 9.04.

The error i'm getting when trying to run the generate_config.pl is as follows,

[INFO] Starting generate_config script
[ERROR] Could not open configuration file ./config/nconf.php

nconf.php is definitely in the correct location and as far as i can tell has the correct authorities. I have played around with the authorities but this makes no difference.

If i try to generate the config from the browser i get the following error,

Generating config:


Running syntax check:

default: Error generating config

Nagios 3.1.2
Copyright (c) 2009 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 06-23-2009
License: GPL

Website: http://www.nagios.org
Reading configuration data...
Error: Cannot open main configuration file '/var/www/nconf/temp/test/default.cfg' for reading!
Error processing main config file!

***> The name of the main configuration file looks suspicious...

Make sure you are specifying the name of the MAIN configuration file on
the command line and not the name of another configuration file. The
main configuration file is typically '/usr/local/nagios/etc/nagios.cfg'

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

Deployment not possible due to errors in configuration.

My Apace 2 error.log has the following error,

DBD::mysql::st execute failed: Unknown column 'nagios_object' in 'field list' at /var/www/nconf/bin/generate_config.pl line 1446.
DBD::mysql::st execute failed: Unknown column 'nagios_object' in 'field list' at /var/www/nconf/bin/generate_config.pl line 1446.
tar: default: Cannot stat: No such file or directory
tar: Error exit delayed from previous errors

I am 99.9% sure the authorities are correct. I have exactly the same config as my other working 1.2.4 virutal server.

I have spent days looking at this now and i can't see whats wrong.

Any help would be greatly appreciated.

Terry

Re: Generate Config

Post by Terry » Tue Jul 07, 2009 15:38

Sorry should have put that i am running Nagios version 3.1.2 with nconf 1.2.5 and on the other working server Nagios version 3.1.0.

terrydlm
beginner
beginner
Posts: 8
Joined: Wed Jul 08, 2009 09:52

Re: Generate Config

Post by terrydlm » Wed Jul 08, 2009 11:25

I have now upgraded my nconf 1.2.4 box to nconf 1.2.5 and i get exactly the same error. I have not changed anything else just an upgrade.

terrydlm
beginner
beginner
Posts: 8
Joined: Wed Jul 08, 2009 09:52

Re: Generate Config

Post by terrydlm » Wed Jul 08, 2009 12:41

Just for kicks i copied the nconf 1.2.4 generate_config.pl into my nconf 1.2.5 bin directory and ran it and it works fine! I have put the 1.2.5 generate_config.pl back and it errors like before, It looks like a problem with the last section of the generate_config.pl below. Is this something i have not done or is this a problem with Ubuntu?

########################################################################################
# SUB fetch_class_info
# Get class information from ConfigClasses table

sub fetch_class_info {

$sth = $dbh->prepare("SELECT config_class, nagios_object, out_file FROM ConfigClasses ORDER BY ordering");
$sth->execute();

my $hash_ref = $sth->fetchall_hashref("config_class");
return %{$hash_ref};
}

User avatar
agargiulo
NConf developer
NConf developer
Posts: 725
Joined: Fri Mar 06, 2009 17:50
Location: Zurich, Switzerland
Contact:

Re: Generate Config

Post by agargiulo » Wed Jul 08, 2009 15:30

Hi.

This could be a problem with your perl module versions. Make sure you meet the following minimum requirements:

- perl 5.6 or higher
- perl-DBI 1.38 or higher
- perl-DBD-MySQL 2.1 or higher

terrydlm
beginner
beginner
Posts: 8
Joined: Wed Jul 08, 2009 09:52

Re: Generate Config

Post by terrydlm » Wed Jul 08, 2009 16:04

Is Perl 5.6 or higher really correct ? I have version 5.10 which according to Perl's web site is the latest stable version also i can't update it as apt-get tells me i am already on the latest version.

I have Perl-DBI version 1.607-1 and perl-DBD-mysql version 4.008-1

User avatar
agargiulo
NConf developer
NConf developer
Posts: 725
Joined: Fri Mar 06, 2009 17:50
Location: Zurich, Switzerland
Contact:

Re: Generate Config

Post by agargiulo » Wed Jul 08, 2009 18:37

Have you applied the updates for 1.2.5 to your existing 1.2.4 installation? One thing which was changed in the database was that we added an attribute named 'nagios_object' to the ConfigClasses table. Please check if the attribute is there. If not, chances are the update procedure was not completed properly.

NConf 1.2.5 will not be able to generate the config, if this attribute is not in the database...

terrydlm
beginner
beginner
Posts: 8
Joined: Wed Jul 08, 2009 09:52

Re: Generate Config

Post by terrydlm » Thu Jul 09, 2009 12:18

Yes that seems to have fixed the problem. I did not think i would need the upgrade as i did a clean installation of 1.2.5.

Thanks for your help.

Locked