Page 1 of 2

Nagios XI installation problems

Posted: Wed Dec 01, 2010 11:03 am
by Nikel
Hello Everybody,

I get this message if i try to open the nagios Webinterface: DB Connect Error [nagiosxi]: Database connection failed.


During the installation i get this message (by typing ./E-importnagiosql) I installed it as a root and i was in the folder /tmp/nagiosxi

Code: Select all

[root@localhost nagiosxi]# ./E-importnagiosql
httpd starten: 
/tmp/nagiosxi/nagiosxi/basedir/scripts /tmp/nagiosxi
PHP Warning:  pg_pconnect(): Unable to connect to PostgreSQL server: FATAL:  Datenbank ?nagiosxi? existiert nicht in /tmp/nagiosxi/nagiosxi/basedir/html/db/adodb/drivers/adodb-postgres64.inc.php on line 676
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
--2010-12-01 16:42:17--  http://localhost/nagiosql/admin/import.php
Aufl?sen des Rechnernamens ?localhost?.... 127.0.0.1
Aufl?sen des Rechnernamens ?localhost?.... 127.0.0.1
Verbindungsaufbau mit localhost[127.0.0.1]:80... verbunden.
HTTP-Anfrage gesendet, warte auf Antwort... 302 Found
Platz: http://localhost/nagiosql/index.php [folge]
--2010-12-01 16:42:17--  http://localhost/nagiosql/index.php
Verbindungsaufbau mit localhost[127.0.0.1]:80... verbunden.
HTTP-Anfrage gesendet, warte auf Antwort... 200 OK
L?nge: 5259 (5,1K) [text/html]
Speichere nach: ?nagiosql.import.monitoring?

100%[======================================>] 5.259       --.-K/s   in 0s      

2010-12-01 16:42:17 (502 MB/s) - ?nagiosql.import.monitoring? gespeichert [5259/5259]

SETUID ROOT OK
RESETTING PERMS
PHP Warning:  pg_pconnect(): Unable to connect to PostgreSQL server: FATAL:  Datenbank ?nagiosxi? existiert nicht in /tmp/nagiosxi/nagiosxi/basedir/html/db/adodb/drivers/adodb-postgres64.inc.php on line 676
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
--2010-12-01 16:42:18--  http://localhost/nagiosql/admin/verify.php
Aufl?sen des Rechnernamens ?localhost?.... 127.0.0.1
Verbindungsaufbau mit localhost[127.0.0.1]:80... verbunden.
HTTP-Anfrage gesendet, warte auf Antwort... 302 Found
Platz: http://localhost/nagiosql/index.php [folge]
--2010-12-01 16:42:18--  http://localhost/nagiosql/index.php
Verbindungsaufbau mit localhost[127.0.0.1]:80... verbunden.
HTTP-Anfrage gesendet, warte auf Antwort... 200 OK
L?nge: 5259 (5,1K) [text/html]
Speichere nach: ?nagiosql.export.monitoring?

100%[======================================>] 5.259       --.-K/s   in 0s      

2010-12-01 16:42:18 (502 MB/s) - ?nagiosql.export.monitoring? gespeichert [5259/5259]
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 /tmp/nagiosxi/nagiosxi/basedir/scripts
tar: Removing leading `/' from member names
/tmp/nagiosxi/nagiosxi/basedir/scripts
ls: /usr/local/nagiosxi/nom/checkpoints/nagioscore/*.gz: Datei oder Verzeichnis nicht gefunden
NO NOM SNAPSHOT FOUND!
/tmp/nagiosxi

Re: Nagios XI installation problems

Posted: Wed Dec 01, 2010 11:10 am
by tonyyarusso
Some people have experienced the PostgreSQL server not starting up properly on boot. Try issuing this command and then re-running the E-importnagiosql script:

Code: Select all

service postgresql start

Re: Nagios XI installation problems

Posted: Wed Dec 01, 2010 11:22 am
by Nikel
thanks for your post but it didn't work.

I get this message:

Code: Select all

[root@localhost nagiosxi]# service postgresql start
postgresql-Dienst starten:[  OK  ]
[root@localhost nagiosxi]# ./E-importnagiosql
httpd starten: 
/tmp/nagiosxi/nagiosxi/basedir/scripts /tmp/nagiosxi
PHP Warning:  pg_pconnect(): Unable to connect to PostgreSQL server: FATAL:  Datenbank ?nagiosxi? existiert nicht in /tmp/nagiosxi/nagiosxi/basedir/html/db/adodb/drivers/adodb-postgres64.inc.php on line 676
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
--2010-12-01 17:10:41--  http://localhost/nagiosql/admin/import.php
Aufl?sen des Rechnernamens ?localhost?.... 127.0.0.1
Verbindungsaufbau mit localhost[127.0.0.1]:80... verbunden.
HTTP-Anfrage gesendet, warte auf Antwort... 302 Found
Platz: http://localhost/nagiosql/index.php [folge]
--2010-12-01 17:10:41--  http://localhost/nagiosql/index.php
Verbindungsaufbau mit localhost[127.0.0.1]:80... verbunden.
HTTP-Anfrage gesendet, warte auf Antwort... 200 OK
L?nge: 5259 (5,1K) [text/html]
Speichere nach: ?nagiosql.import.monitoring?

100%[======================================>] 5.259       --.-K/s   in 0s  

2010-12-01 17:10:41 (502 MB/s) - ?nagiosql.import.monitoring? gespeichert [5259/5259]

SETUID ROOT OK
RESETTING PERMS
PHP Warning:  pg_pconnect(): Unable to connect to PostgreSQL server: FATAL:  Datenbank ?nagiosxi? existiert nicht in /tmp/nagiosxi/nagiosxi/basedir/html/db/adodb/drivers/adodb-postgres64.inc.php on line 676
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
--2010-12-01 17:10:41--  http://localhost/nagiosql/admin/verify.php
Aufl?sen des Rechnernamens ?localhost?.... 127.0.0.1
Verbindungsaufbau mit localhost[127.0.0.1]:80... verbunden.
HTTP-Anfrage gesendet, warte auf Antwort... 302 Found
Platz: http://localhost/nagiosql/index.php [folge]
--2010-12-01 17:10:41--  http://localhost/nagiosql/index.php
Verbindungsaufbau mit localhost[127.0.0.1]:80... verbunden.
HTTP-Anfrage gesendet, warte auf Antwort... 200 OK
HTTP-Anfrage gesendet, warte auf Antwort... 200 OK
L?nge: 5259 (5,1K) [text/html]
Speichere nach: ?nagiosql.export.monitoring?

100%[======================================>] 5.259       --.-K/s   in 0s      

2010-12-01 17:10:41 (502 MB/s) - ?nagiosql.export.monitoring? gespeichert [5259/5259]

--2010-12-01 17:10:41--  http://localhost/nagiosql/admin/verify.php
Aufl?sen des Rechnernamens ?localhost?.... 127.0.0.1
Verbindungsaufbau mit localhost[127.0.0.1]:80... verbunden.
HTTP-Anfrage gesendet, warte auf Antwort... 302 Found
Platz: http://localhost/nagiosql/index.php [folge]
--2010-12-01 17:10:41--  http://localhost/nagiosql/index.php
Verbindungsaufbau mit localhost[127.0.0.1]:80... verbunden.
HTTP-Anfrage gesendet, warte auf Antwort... 200 OK
L?nge: 5259 (5,1K) [text/html]
Speichere nach: ?nagiosql.export.additional?

100%[======================================>] 5.259       --.-K/s   in 0s 
2010-12-01 17:10:41 (418 MB/s) - ?nagiosql.export.additional? gespeichert [5259/5259]

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 /tmp/nagiosxi/nagiosxi/basedir/scripts
tar: Removing leading `/' from member names
/tmp/nagiosxi/nagiosxi/basedir/scripts
ls: /usr/local/nagiosxi/nom/checkpoints/nagioscore/*.gz: Datei oder Verzeichnis nicht gefunden
NO NOM SNAPSHOT FOUND!
/tmp/nagiosxi

Re: Nagios XI installation problems

Posted: Wed Dec 01, 2010 1:31 pm
by mguthrie
From looking at your error messages, it doesn't look like the postgres databases were imported correctly. Are you using a proxy on your install?

Did you run the install scripts from the /tmp directory?
Which Linux Distro?
32 or 64bit?

Re: Nagios XI installation problems

Posted: Thu Dec 02, 2010 2:55 am
by Nikel
Well, it is a VM (XenServer). I installed it with VNC Viewer. I'm using CentOS 5.5 (32bit).

I start the ./1 ./2 .... in the /tmp directory

Re: Nagios XI installation problems

Posted: Thu Dec 02, 2010 10:43 am
by tonyyarusso
Does this command work?

Code: Select all

psql template1 postgres

Re: Nagios XI installation problems

Posted: Thu Dec 02, 2010 10:54 am
by Nikel
I get this infos

Code: Select all

 
[root@localhost nagiosxi]# psql template1 postgres
Dies ist psql 8.1.22, das interaktive PostgreSQL-Terminal.

Geben Sie ein:  \copyright f?r Urheberrechtsinformationen
                \h f?r Hilfe ?ber SQL-Anweisungen
                \? f?r Hilfe ?ber interne Anweisungen
                \g oder Semikolon, um eine Anfrage auszuf?hren
                \q um zu beenden

template1=# 

Re: Nagios XI installation problems

Posted: Thu Dec 02, 2010 11:51 am
by tonyyarusso
Okay, good. So PostgreSQL is running and accepting connections, but the nagiosxi database didn't get created apparently (or has permissions issues). From the postgres prompt, what's the output of

Code: Select all

\l
(That's an "L".)

Re: Nagios XI installation problems

Posted: Fri Dec 03, 2010 1:34 am
by Nikel
i get this here

Code: Select all

template1=# \l
       Liste der Datenbanken
   Name    | Eigent?mer | Kodierung 
-----------+------------+-----------
 postgres  | postgres   | UTF8
 template0 | postgres   | UTF8
 template1 | postgres   | UTF8
(3 Zeilen)

Re: Nagios XI installation problems

Posted: Fri Dec 03, 2010 11:08 am
by mguthrie
Do you by chance have gnome installed on your CentOS server?