Error on generating Config

Support requests, bug reports, questions etc.
Locked
KW
Error on generating Config

Post by KW » Tue Apr 14, 2009 14:20

Hi,

I had installed nconf and nagios in the same server. Nconf on /var/www/html/nconf while nagios is in /usr/local/nagios/.

I managed to install nconf successfully and managed to view the nconf webpage correct. The problem happened when I try to generate config file and it return the following error.

I checked and confirm that my nagios binary on /usr/loca/nagios/bin/ has full access by granting it chmod 777 and confirm that /var/www/html/nconf/temp has full access too. I wonder where to configure the path for following main configuration file . I try to copy nagious.cfg from /usr/local/nagios/etc and rename it exactly the same with the file name below and put into the path as it specify following, but the temp folder will be blank after I click on the generate config button. I really no idea on it. Please kindly help

Generating config:

Running tests:

localhost: Error generating config

--------------------------------------------------------------------------------
Nagios 3.0.6
Copyright (c) 1999-2008 Ethan Galstad (http://www.nagios.org)
Last Modified: 12-01-2008
License: GPL

Reading configuration data...

Error: Cannot open main configuration file '/var/www/html/nconf/temp/test/localhost.cfg' for reading!

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

Miro

Re: Error on generating Config

Post by Miro » Tue Apr 14, 2009 21:11

KW please try to run /var/www/html/nconf/bin/generate_config.pl from shell and look for error messages. It is possible that you are missing DBD::mysql for perl. See viewtopic.php?f=3&t=9&st=0&sk=t&sd=a&si ... rt=10#p173 and post before this one.

KW

Re: Error on generating Config

Post by KW » Wed Apr 15, 2009 12:53

Miro wrote:KW please try to run /var/www/html/nconf/bin/generate_config.pl from shell and look for error messages. It is possible that you are missing DBD::mysql for perl. See viewtopic.php?f=3&t=9&st=0&sk=t&sd=a&si ... rt=10#p173 and post before this one.

Hi,

I found this error. How should I enable my perl to support mysql. I try to yum install perl-mysql..but it cant find any package.
Please kindly advise.

[root@localhost nconf]# ./bin/generate_config.pl
install_driver(mysql) failed: Can't locate DBD/mysql.pm in @INC (@INC contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.7/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.6/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.8.7/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.8.6/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at (eval 3) line 3.
Perhaps the DBD::mysql perl module hasn't been fully installed,
or perhaps the capitalisation of 'mysql' isn't right.
Available drivers: DBM, ExampleP, File, Proxy, Sponge.
at ./bin/generate_config.pl line 71

User avatar
linux-onkel
beginner
beginner
Posts:7
Joined:Tue Mar 10, 2009 15:32
Location:Offenburg, Germany
Contact:

Re: Error on generating Config

Post by linux-onkel » Wed Apr 15, 2009 14:03

Hi KW,

please try

Code: Select all

yum install perl-DBD-mysql
Without using yum you can install perl modules by using the following command in a shell:

Code: Select all

perl -MCPAN -e 'install DBD::mysql'
Regards
Steffen
Image

KW

Re: Error on generating Config

Post by KW » Thu Apr 16, 2009 14:00

hi,

I already yum install perl-DBD-mysql and it is install successfully, but yet i found the following error when I try to run generate_config.pl.

Please kindly advise.




[root@localhost nconf]# ./bin/generate_config.pl
install_driver(mysql) failed: Can't load '/usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/auto/DBD/mysql/mysql.so' for module DBD::mysql: libmysqlclient.so.16: cannot open shared object file: No such file or directory at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/DynaLoader.pm line 230.
at (eval 3) line 3
Compilation failed in require at (eval 3) line 3.
Perhaps a required shared library or dll isn't installed where expected
at ./bin/generate_config.pl line 71

User avatar
linux-onkel
beginner
beginner
Posts:7
Joined:Tue Mar 10, 2009 15:32
Location:Offenburg, Germany
Contact:

Re: Error on generating Config

Post by linux-onkel » Sun Apr 19, 2009 23:33

Hi KW,

please run

Code: Select all

updatedb ; locate mysql.so
and post output here.

Regards
Steffen
Image

Fred

Re: Error on generating Config

Post by Fred » Thu Apr 23, 2009 06:47

Nagios & nconf installed on the same server. All seems to function OK until I try to generate a Nagios Config as below:

Generating config:
Running tests:
lxcl003.hdwa.health.wa.gov.au: Total Warnings: 0 Total Errors: 1

I have commented out the section that deletes the files created in the temp folder when it fails.
I have the manually run nagios -v temp/test/lxcl003.hdwa.health.wa.gov.au.cfg and this returns 0 Warnings & 0 Errors which is different to the message from nconf above.

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

Re: Error on generating Config

Post by agargiulo » Thu Apr 23, 2009 09:37

If you expand the status in NConf where it sais "Errors: 1", you should see the whole output of "nagios -v". That should give some idea...

Fred

Re: Error on generating Config

Post by Fred » Thu Apr 23, 2009 10:27

Thanks for your prompt response. I take it that when you say expand, you mean select the plus sign to the left of the message?
If so, I get nothing. Now that I know that I should expect something, I've tried this on several browsers now.
Originally was tried with Firefox on RedHat. Then I tried it with Firefox on Windows - same result - can't expand.
Then tried it with IE on Windows and get a popup Error box when I try to expand

Code: Select all

A runtime Error has occurred.  Do you wish to debug?
Line: 246
Error: 'set_lxcl003' is undefined 

Fred

Re: Error on generating Config

Post by Fred » Thu Apr 23, 2009 10:36

I ran the MS Debug and think I found the problem - all the hidden text is embedded!
Basically - it was unable to write to the nagios/var/spool/checkresults.
So I will check this.

The problem with not being able to expand is the onclick statement...

Code: Select all

<b>Running Tests:</b><br><br>
 <table cellspacing=0 celpadding=0>
<tr onClick="set_lxcl003.hdwa.health.wa.gov.au()"><td> .....
I'm wondering if it doesn't like the dots in the FQDN?

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

Re: Error on generating Config

Post by agargiulo » Thu Apr 23, 2009 15:53

Yes, you're right. The dots are not accepted by JavaScript. I have corrected this. The dots are now replaced by underscore.
Thank you for bringing this up.

Fred

Re: Error on generating Config

Post by Fred » Fri Apr 24, 2009 02:11

Changing the collector name to just the hostname (not the FQDN with the dots) allows me now to expand and display the error messages

Locked