Page 1 of 1

Error running ./E-importnagiosql script

Posted: Tue Feb 22, 2011 4:40 am
by alexm3
Hello,

We're tring to deploy NagiosXi trial to evaluate if we migrate to Enterprise version. We're doing the manual installation running all scripts. The server is Centos 5.5 32 bits.

When we run the script ./E-importnagiosql, there is an error because .cfg in nagios core configuration are not on its place (/usr/local/nagios/etc/). This is the exact error:


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/xitest.cfg'...
Processing object config file '/usr/local/nagios/etc/static/xitemplates.cfg'...
Processing object config file '/usr/local/nagios/etc/static/xiobjects.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!




At the end it says that configurtion is invalid.

ERROR: NagiosQL import appears to have failed - exiting. (Reason: Nagios Core configuration is invalid)

All previous scripts run successfull without errors. Can anyone help me with that?

Thanks.

Alex.

Re: Error running ./E-importnagiosql script

Posted: Tue Feb 22, 2011 11:21 am
by tonyyarusso
Usually problems with this particular step indicates that there actually was some sort of problem with an earlier step that wasn't caught, particularly with installing, initializing, or starting the MySQL and/or PostgreSQL database servers. You might try restarting the relevant daemon and running the import script again.

Re: Error running ./E-importnagiosql script

Posted: Tue Feb 22, 2011 11:32 am
by alexm3
Thanks for the answer

I've found a workaround to solve the problem. Is to edit the script /tmp/nagiosxi/subcomponents/nagioscore/install and uncomment the line

#make install-config

When it runs that make install-config line it loads the .cfg templates. Now i've found another problem, I got nagios xi running but when I access the Nagios Configuration Manager (Nagiosql) it shows nothing on the main frame, just white page.

Re: Error running ./E-importnagiosql script

Posted: Tue Feb 22, 2011 11:54 am
by alexm3
I have tried a brand new installation of Centos5.5 and I have the same issue. In nagios.cfg that Nagiosxi writes this missing cfg files have the comment "# OBJECTS EXPORTED FROM NAGIOSQL", what script is exporting this objects? Is the A-subcomponents? Where does it imports the files from? From Database right? For me the database looks good

mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| nagios |
| nagiosql |
| test |
+--------------------+
mysql> use nagiosql
mysql> show tables;
+--------------------------------------------+
| Tables_in_nagiosql |
+--------------------------------------------+
| tbl_command |
| tbl_contact
| tbl_contactgroup |
....

If it's not the database it should be the nagiosql apache2 configuration. This is the httpd configuration created with scripts:

#> ls -ltr /etc/httpd/conf.d/nagiosql.conf
-rwxr-xr-x 1 root root 427 Feb 22 16:28 /etc/httpd/conf.d/nagiosql.conf
#> cat /etc/httpd/conf.d/nagiosql.conf

# SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER
# Last Modified: 11-26-2005
#
# This file contains examples of entries that need
# to be incorporated into your Apache web server
# configuration file. Customize the paths, etc. as
# needed to fit your system.

Alias /nagiosql "/var/www/html/nagiosql"

<Directory "/var/www/html/nagiosql">
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>



And this is the automatic Root directory created:

> ls -ltr /var/www/html/nagiosql
total 72
drwxr-xr-x 4 apache apache 4096 Feb 22 16:28 templates
drwxr-xr-x 8 apache apache 4096 Feb 22 16:28 install
-rwxr-xr-x 1 apache apache 3851 Feb 22 16:28 index.php
drwxr-xr-x 2 apache apache 4096 Feb 22 16:28 images
drwxr-xr-x 4 apache apache 4096 Feb 22 16:28 functions
-rwxr-xr-x 1 apache apache 1150 Feb 22 16:28 favicon.ico
drwxr-xr-x 3 apache apache 4096 Feb 22 16:28 config
-rwxr-xr-x 1 apache apache 1572 Feb 22 16:28 admin.php
drwxr-xr-x 2 apache apache 4096 Feb 22 16:28 admin
[/i]

When I access http://my_server_ip/nagiosql I just get a white packge, but no error on browser. If i check the http error_log I see some entries like those:

[Tue Feb 22 16:50:18 2011] [error] [client 127.0.0.1] File does not exist: /var/www/html/nagiosxi
[Tue Feb 22 16:50:21 2011] [error] [client 10.30.61.254] File does not exist: /var/www/html/favicon.ico
[Tue Feb 22 16:50:22 2011] [error] [client 10.30.61.254] File does not exist: /var/www/html/favicon.ico
[Tue Feb 22 16:50:27 2011] [error] [client 10.30.61.254] File does not exist: /var/www/html/nagiosxi, referer: http://10.30.108.28/nagiosxi/config/nagioscorecfg/
[Tue Feb 22 16:50:34 2011] [error] [client 127.0.0.1] File does not exist: /var/www/html/nagiosxi
[Tue Feb 22 16:50:49 2011] [error] [client 127.0.0.1] File does not exist: /var/www/html/nagiosxi
[Tue Feb 22 16:50:57 2011] [error] [client 10.30.61.254] File does not exist: /var/www/html/nagiosxi, referer: http://10.30.108.28/nagiosxi/config/nagioscorecfg/
[Tue Feb 22 16:51:02 2011] [error] [client 127.0.0.1] File does not exist: /var/www/html/nagiosxi

Any idea?

Re: Error running ./E-importnagiosql script

Posted: Tue Feb 22, 2011 3:30 pm
by mguthrie
Are you installing this on a "clean" system?
Do you have a proxy running on your system?

You should not have to modify the install scripts on a clean system without a proxy. We do not recommend doing this at all as it will almost certainly break the installation process.

Re: Error running ./E-importnagiosql script

Posted: Tue Feb 22, 2011 4:37 pm
by alexm3
Yes it's a clean install and we do have proxy

I have configured the yum file and the wget config file as described in this forum avoiding proxy for localhost and 127.0.0.1

Re: Error running ./E-importnagiosql script

Posted: Tue Feb 22, 2011 4:51 pm
by mguthrie
We don't officially support proxy installs because of the endless variations we'd have to support with it, sounds like you may have already read our FAQ about proxy installs, but these may help.
http://support.nagios.com/wiki/index.ph ... th_Proxies

We highly recommend turning off the proxy for the installation process, but if your system requires that you leave it on, you may have to do some searching on our forums. Some of our users have muscled their way through it and found solutions, but again, this varies based on their system's configuration.