Page 1 of 1

Nagios XI installation errors [importnagiosql]

Posted: Mon Dec 13, 2010 3:14 am
by juki
Hi all,

I'm performing a new installation of Nagios XI on RHEL 5.1 32-bit. All went well till I got to executing the command "./E-importnagiosql". This command returned the following errors shown below. The errors in particular are "DB Connect Error [nagiosxi]: Database connection failed" and "Error: Cannot open config file '/usr/local/nagios/etc/contacttemplates.cfg' for reading: No such file or directory". The installation is under /tmp and I downloaded and used the file "xi-2009r1.3g.tar.gz"


The exact errors are below;

Code: Select all

[color=#FF0000][root@nagiosXI nagiosxi]# ./E-importnagiosql 
Starting httpd: 
/var/tmp/nagiosxi/nagiosxi/basedir/scripts /var/tmp/nagiosxi
DB Connect Error [nagiosxi]: Database connection failed 
ERROR CONNECTING TO DATABASES!
IMPORTING CONFIG FILES...Array
(
[0] => nagiosadmin.cfg
)
IMPORTING /usr/local/nagios/etc/import/nagiosadmin.cfg
CMDLINE:
/usr/bin/wget --load-cookies=nagiosql.cookies http://localhost/nagiosql/admin/import.php --no-check-certificate --post-data 'chbOverwrite=1&selImportFile[]=/usr/local/nagios/etc/import/nagiosadmin.cfg' -O nagiosql.import.monitoring
--10:35:02-- http://localhost/nagiosql/admin/import.php
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 0 [text/html]
Saving to: `nagiosql.import.monitoring'

[ <=> ] 0 --.-K/s in 0s 

10:35:02 (0.00 B/s) - `nagiosql.import.monitoring' saved [0/0]

SETUID ROOT OK
RESETTING PERMS
DB Connect Error [nagiosxi]: Database connection failed 
ERROR CONNECTING TO DATABASES!
CMDLINE:
/usr/bin/wget --load-cookies=nagiosql.cookies http://localhost/nagiosql/admin/verify.php --no-check-certificate --post-data 'writeMonitoring=Go' -O nagiosql.export.monitoring
--10:35:03-- http://localhost/nagiosql/admin/verify.php
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 0 [text/html]
Saving to: `nagiosql.export.monitoring'

[ <=> ] 0 --.-K/s in 0s 

10:35:03 (0.00 B/s) - `nagiosql.export.monitoring' saved [0/0]

--10:35:03-- http://localhost/nagiosql/admin/verify.php
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 0 [text/html]
Saving to: `nagiosql.export.additional'

[ <=> ] 0 --.-K/s in 0s 

10:35:03 (0.00 B/s) - `nagiosql.export.additional' saved [0/0]

CMDLINE:
/usr/bin/wget --load-cookies=nagiosql.cookies http://localhost/nagiosql/admin/verify.php --no-check-certificate --post-data 'writeAdditional=Go' -O nagiosql.export.additional
OUTPUT: 
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 directory '/usr/local/nagios/etc/static'...
Processing object config file '/usr/local/nagios/etc/static/xiobjects.cfg'...
Processing object config file '/usr/local/nagios/etc/static/xitest.cfg'...
Processing object config file '/usr/local/nagios/etc/static/xitemplates.cfg'...
Processing object config file '/usr/local/nagios/etc/contacttemplates.cfg'...
Error: Cannot open config file '/usr/local/nagios/etc/contacttemplates.cfg' for reading: No such file or directory
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.
RET: 254
/usr/local/nagiosxi/nom/checkpoints/nagioscore/errors /var/tmp/nagiosxi/nagiosxi/basedir/scripts
tar: Removing leading `/' from member names
/var/tmp/nagiosxi/nagiosxi/basedir/scripts
ls: /usr/local/nagiosxi/nom/checkpoints/nagioscore/*.gz: No such file or directory
NO NOM SNAPSHOT FOUND!
/var/tmp/nagiosXI[/color]


I then checked the nagios folder but that contacttemplates file and some others do not exist.

[color=#FF0040][root@nagios ~]# ls -l /usr/local/nagios/etc/
total 68
-rwxrwxr-x 1 apache nagios 744 Dec 2 10:13 cgi.cfg
drwsrwsr-x 2 apache nagios 4096 Dec 2 10:13 hosts
drwsrwsr-x 2 apache nagios 4096 Dec 2 11:31 import
-rwxrwxr-x 1 apache nagios 5714 Dec 2 10:13 nagios.cfg
-rwxrwxr-x 1 apache nagios 2229 Dec 2 10:13 ndo2db.cfg
-rwxrwxr-x 1 apache nagios 4723 Dec 2 10:13 ndomod.cfg
-rw-rw-r-- 1 apache nagios 7207 Dec 2 10:14 nrpe.cfg
-rwxrwxr-x 1 apache nagios 5345 Dec 2 10:14 nsca.cfg
-rwxrwxr-x 1 apache nagios 3417 Dec 2 10:14 pnp
-rwxrwxr-x 1 apache nagios 210 Dec 2 10:13 resource.cfg
-rwxrwxr-x 1 apache nagios 1627 Dec 2 10:14 send_nsca.cfg
drwsrwsr-x 2 apache nagios 4096 Dec 2 10:13 services
drwsrwsr-x 2 apache nagios 4096 Dec 2 10:13 static[/color]
As you can see, I do not have contacttemplates.cfg, contacts.cfg, contactgroups.cfg files. This is quite baffling since it is a fresh installation.


Anyone know how I can resolve this?

Thanks,
Juki

Re: Nagios XI installation errors [importnagiosql]

Posted: Mon Dec 13, 2010 11:14 am
by mguthrie
There are have some reports of problems installing mysql and postgresql on some RHEL installations. I try making sure both mysql and postgresql are installed and able to be started, then try running the installer scripts again. Don't set up root user password for either DB, the installer scripts will take care of them.

If you're using a proxy, turn it off during the install as it will cause a variety of issues.

Re: Nagios XI installation errors [importnagiosql]

Posted: Tue Dec 14, 2010 12:52 am
by juki
Hello Guthrie,

Both mysql and postgresql are installed and start up without a hitch. Please note that it's a default fresh installation from the original DVD for both packages. I have noted that when I run the "./A-subcomponents" command, I see an error;

chmod: cannot access `/usr/local/nagios/etc/hosts/*.cfg` : No such file or directory
chmod: cannot access `/usr/local/nagios/etc/services/*.cfg` : No such file or directory

The contents of both these directories are currently empty. How can this be?

Re: Nagios XI installation errors [importnagiosql]

Posted: Tue Dec 14, 2010 5:58 pm
by mguthrie
We've come across this issue with a few installations on RHEL, I'm going to run some tests and see if I can track down where this is going wrong. I might send you a debugging version of the E-nagiosql scripts so that we can isolate where that script is failing. I'll try and send you an update tomorrow.

Re: Nagios XI installation errors [importnagiosql]

Posted: Wed Dec 15, 2010 11:34 am
by mguthrie
Question for you. Have you registered your copy of RHEL with the RHN (Redhat Network)? Without this you won't have full access to all of the packages repo's and several of the required packages will fail to install.

Re: Nagios XI installation errors [importnagiosql]

Posted: Tue May 31, 2011 3:58 pm
by usitech
Was a fix ever found for this? I am having this same error but with CentOS 5.5 when running the "./E-importnagiosql" script. This is from xi-2011-latest.tar.gz downloaded April 11, 2011.
Note, I edited the init.sh script to fill in the MySQL root password as the MySQL server is in use for other unrelated services as well.

Code: Select all

$./E-importnagiosql 
<SNIP>
Processing object config file '/usr/local/nagios/etc/contacttemplates.cfg'...
Error: Cannot open config file '/usr/local/nagios/etc/contacttemplates.cfg' for reading: No such file or directory
   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.
RET: 254
/usr/local/nagiosxi/nom/checkpoints/nagioscore/errors ~/tmp/nagiosxi/nagiosxi/basedir/scripts
tar: Removing leading `/' from member names
~/tmp/nagiosxi/nagiosxi/basedir/scripts
ls: /usr/local/nagiosxi/nom/checkpoints/nagioscore/*.gz: No such file or directory
NO NOM SNAPSHOT FOUND!
~/tmp/nagiosxi
ERROR: NagiosQL import appears to have failed - exiting.  (Reason: Nagios Core configuration is invalid)
Subsequent runs of the "E" script gives this error

Code: Select all

$./E-importnagiosql 
NOTE: If prompted, enter the MySQL root password
NagiosQL database appears OK - continuing...
NDOUtils database appears OK - continuing...
ERROR: No files to import - exiting.  Were Nagios Core and NagiosQL installed?
Since the "E" script does not finish successfully the "installed" file is not created and the "F" script fails to run as is.

Re: Nagios XI installation errors [importnagiosql]

Posted: Tue May 31, 2011 4:01 pm
by mguthrie
Are you running the install scripts from the /tmp directory? This script will fail if it's run from the /root or some other directory.