Page 1 of 4

unable to start Nagios service

Posted: Wed Nov 03, 2010 4:01 pm
by ericsson_att
We are in the process of evaluating Nagios XI.

We successfully ran the manual installation for Nagios XI on CentOS 5.5

However, we are unable to start the Nagios server. Error given below.

[root@ltenav1 etc]# service nagios start
Starting nagios:CONFIG ERROR! Start aborted. Check your Nagios configuration.
You have new mail in /var/spool/mail/root

Re: unable to start Nagios service

Posted: Wed Nov 03, 2010 4:11 pm
by admin
What does the output of the following command indicate?

Code: Select all

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Re: unable to start Nagios service

Posted: Wed Nov 03, 2010 4:17 pm
by ericsson_att
[root@ltenav1 etc]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Nagios Core 3.2.2
Copyright (c) 2009-2010 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 09-01-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/xitemplates.cfg'...
Processing object config file '/usr/local/nagios/etc/static/xitest.cfg'...
Processing object config file '/usr/local/nagios/etc/static/xiobjects.cfg'...
Processing object config file '/usr/local/nagios/etc/contacttemplates.cfg'...
Processing object config file '/usr/local/nagios/etc/contactgroups.cfg'...
Processing object config file '/usr/local/nagios/etc/contacts.cfg'...
Processing object config file '/usr/local/nagios/etc/timeperiods.cfg'...
Processing object config file '/usr/local/nagios/etc/commands.cfg'...
Processing object config file '/usr/local/nagios/etc/hostgroups.cfg'...
Processing object config file '/usr/local/nagios/etc/servicegroups.cfg'...
Processing object config file '/usr/local/nagios/etc/hosttemplates.cfg'...
Processing object config file '/usr/local/nagios/etc/servicetemplates.cfg'...
Processing object config file '/usr/local/nagios/etc/servicedependencies.cfg'...
Processing object config file '/usr/local/nagios/etc/serviceescalations.cfg'...
Processing object config file '/usr/local/nagios/etc/hostdependencies.cfg'...
Processing object config file '/usr/local/nagios/etc/hostescalations.cfg'...
Processing object config file '/usr/local/nagios/etc/hostextinfo.cfg'...
Processing object config file '/usr/local/nagios/etc/serviceextinfo.cfg'...
Processing object config directory '/usr/local/nagios/etc/hosts'...
Processing object config directory '/usr/local/nagios/etc/services'...
Read object config files okay...

Running pre-flight check on configuration data...

Checking services...
Error: There are no services defined!
Checked 0 services.
Checking hosts...
Error: There are no hosts defined!
Checked 0 hosts.
Checking host groups...
Checked 0 host groups.
Checking service groups...
Checked 0 service groups.
Checking contacts...
Error: Service notification command 'xi_service_notification_handler' specified for contact 'xi_default_contact' is not defined anywhere!
Error: Host notification command 'xi_host_notification_handler' specified for contact 'xi_default_contact' is not defined anywhere!
Checked 1 contacts.
Checking contact groups...
Checked 0 contact groups.
Checking service escalations...
Checked 0 service escalations.
Checking service dependencies...
Checked 0 service dependencies.
Checking host escalations...
Checked 0 host escalations.
Checking host dependencies...
Checked 0 host dependencies.
Checking commands...
Checked 0 commands.
Checking time periods...
Checked 2 time periods.
Checking for circular paths between hosts...
Checking for circular host and service dependencies...
Checking global event handlers...
Error: Global host event handler command 'xi_host_event_handler' is not defined anywhere!
Error: Global service event handler command 'xi_service_event_handler' is not defined anywhere!
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors: 6

***> One or more problems was encountered while running the pre-flight check...

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.

[root@ltenav1 etc]#

Re: unable to start Nagios service

Posted: Wed Nov 03, 2010 4:39 pm
by admin
It sounds like the default object definitions didn't get setup properly. Did you go through all the commands outlines in the manual installation document?

Also, are you running or using any type of proxy software on this server?

Re: unable to start Nagios service

Posted: Wed Nov 03, 2010 4:46 pm
by ericsson_att
We did go through all the commands (./0-yum until ./Z-webroot) outlines in the manual installation document.

Yes we are behind proxy server. Accordingly, we did update the following-

In /etc/yum.conf :
proxy=http://someproxyserver:port/

In /etc/wgetrc :
http_proxy=http://someproxyserver:port/
no_proxy=localhost,127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16

Only then, it started to install all packages/rpm's.

Re: unable to start Nagios service

Posted: Wed Nov 03, 2010 4:54 pm
by ericsson_att
After a fresh installation, are we expected to update the nagios.cfg file. If yes, then could you please send us a sample nagios.cfg file. There is no information on this in the Manual Installation Document.

Re: unable to start Nagios service

Posted: Wed Nov 03, 2010 4:55 pm
by admin
Did you re-run all the scripts after configuring things for your proxy?

In particular, it sounds like the configure import failed. This is accomplished with scripts that issue wgets to localhost. These scripts are kicked off by the following step in the install:

Code: Select all

./E-importnagiosql
You might be able to just re-run that particular command to get things imported.

Re: unable to start Nagios service

Posted: Wed Nov 03, 2010 5:07 pm
by ericsson_att
We don't see an issue with it... but here are the logs for you to trace ....


]0;root@ltenav1:~/nagios/nagiosxi[root@ltenav1 nagiosxi]# ./E-importnagiosql
Starting httpd:
~/nagios/nagiosxi/nagiosxi/basedir/scripts ~/nagios/nagiosxi
PHP Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: database "nagiosxi" does not exist in /root/nagios/nagiosxi/nagiosxi/basedir/html/db/adodb/drivers/adodb-postgres64.inc.php on line 686
DB Connect Error [nagiosxi]: Database connection failed
ERROR CONNECTING TO DATABASES!
IMPORTING CONFIG FILES...Array
(
[0] => commands.cfg
[1] => contacts.cfg
[2] => localhost.cfg
[3] => nagiosadmin.cfg
[4] => templates.cfg
[5] => timeperiods.cfg
[6] => xicommands.cfg
[7] => xiobjects.cfg
[8] => xitemplates.cfg
[9] => xiwzardtemplates.cfg
)
IMPORTING /usr/local/nagios/etc/import/commands.cfg
CMDLINE:
/usr/bin/wget --load-cookies=nagiosql.cookies http://localhost/nagiosql/admin/import.php --post-data 'chbOverwrite=1&selImportFile[]=/usr/local/nagios/etc/import/commands.cfg' -O nagiosql.import.monitoring
--2010-11-03 13:28:36-- 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
[ <=> ] 0 --.-K/s in 0s

2010-11-03 13:28:36 (0.00 B/s) - `nagiosql.import.monitoring' saved [0/0]

IMPORTING /usr/local/nagios/etc/import/contacts.cfg
CMDLINE:
/usr/bin/wget --load-cookies=nagiosql.cookies http://localhost/nagiosql/admin/import.php --post-data 'chbOverwrite=1&selImportFile[]=/usr/local/nagios/etc/import/contacts.cfg' -O nagiosql.import.monitoring
--2010-11-03 13:28:36-- 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
[ <=> ] 0 --.-K/s in 0s

2010-11-03 13:28:36 (0.00 B/s) - `nagiosql.import.monitoring' saved [0/0]

IMPORTING /usr/local/nagios/etc/import/localhost.cfg
CMDLINE:
/usr/bin/wget --load-cookies=nagiosql.cookies http://localhost/nagiosql/admin/import.php --post-data 'chbOverwrite=1&selImportFile[]=/usr/local/nagios/etc/import/localhost.cfg' -O nagiosql.import.monitoring
--2010-11-03 13:28:36-- 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
[ <=> ] 0 --.-K/s in 0s

2010-11-03 13:28:36 (0.00 B/s) - `nagiosql.import.monitoring' saved [0/0]

IMPORTING /usr/local/nagios/etc/import/nagiosadmin.cfg
CMDLINE:
/usr/bin/wget --load-cookies=nagiosql.cookies http://localhost/nagiosql/admin/import.php --post-data 'chbOverwrite=1&selImportFile[]=/usr/local/nagios/etc/import/nagiosadmin.cfg' -O nagiosql.import.monitoring
--2010-11-03 13:28:36-- 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
[ <=> ] 0 --.-K/s in 0s

2010-11-03 13:28:36 (0.00 B/s) - `nagiosql.import.monitoring' saved [0/0]

IMPORTING /usr/local/nagios/etc/import/templates.cfg
CMDLINE:
/usr/bin/wget --load-cookies=nagiosql.cookies http://localhost/nagiosql/admin/import.php --post-data 'chbOverwrite=1&selImportFile[]=/usr/local/nagios/etc/import/templates.cfg' -O nagiosql.import.monitoring
--2010-11-03 13:28:36-- 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
[ <=> ] 0 --.-K/s in 0s

2010-11-03 13:28:37 (0.00 B/s) - `nagiosql.import.monitoring' saved [0/0]

IMPORTING /usr/local/nagios/etc/import/timeperiods.cfg
CMDLINE:
/usr/bin/wget --load-cookies=nagiosql.cookies http://localhost/nagiosql/admin/import.php --post-data 'chbOverwrite=1&selImportFile[]=/usr/local/nagios/etc/import/timeperiods.cfg' -O nagiosql.import.monitoring
--2010-11-03 13:28:37-- 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
[ <=> ] 0 --.-K/s in 0s

2010-11-03 13:28:37 (0.00 B/s) - `nagiosql.import.monitoring' saved [0/0]

IMPORTING /usr/local/nagios/etc/import/xicommands.cfg
CMDLINE:
/usr/bin/wget --load-cookies=nagiosql.cookies http://localhost/nagiosql/admin/import.php --post-data 'chbOverwrite=1&selImportFile[]=/usr/local/nagios/etc/import/xicommands.cfg' -O nagiosql.import.monitoring
--2010-11-03 13:28:37-- 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
[ <=> ] 0 --.-K/s in 0s

2010-11-03 13:28:37 (0.00 B/s) - `nagiosql.import.monitoring' saved [0/0]

IMPORTING /usr/local/nagios/etc/import/xiobjects.cfg
CMDLINE:
/usr/bin/wget --load-cookies=nagiosql.cookies http://localhost/nagiosql/admin/import.php --post-data 'chbOverwrite=1&selImportFile[]=/usr/local/nagios/etc/import/xiobjects.cfg' -O nagiosql.import.monitoring
--2010-11-03 13:28:37-- 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
[ <=> ] 0 --.-K/s in 0s

2010-11-03 13:28:37 (0.00 B/s) - `nagiosql.import.monitoring' saved [0/0]

IMPORTING /usr/local/nagios/etc/import/xitemplates.cfg
CMDLINE:
/usr/bin/wget --load-cookies=nagiosql.cookies http://localhost/nagiosql/admin/import.php --post-data 'chbOverwrite=1&selImportFile[]=/usr/local/nagios/etc/import/xitemplates.cfg' -O nagiosql.import.monitoring
--2010-11-03 13:28:37-- 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
[ <=> ] 0 --.-K/s in 0s

2010-11-03 13:28:37 (0.00 B/s) - `nagiosql.import.monitoring' saved [0/0]

IMPORTING /usr/local/nagios/etc/import/xiwzardtemplates.cfg
CMDLINE:
/usr/bin/wget --load-cookies=nagiosql.cookies http://localhost/nagiosql/admin/import.php --post-data 'chbOverwrite=1&selImportFile[]=/usr/local/nagios/etc/import/xiwzardtemplates.cfg' -O nagiosql.import.monitoring
--2010-11-03 13:28:37-- 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
[ <=> ] 0 --.-K/s in 0s

2010-11-03 13:28:37 (0.00 B/s) - `nagiosql.import.monitoring' saved [0/0]

SETUID ROOT OK
RESETTING PERMS
PHP Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: database "nagiosxi" does not exist in /root/nagios/nagiosxi/nagiosxi/basedir/html/db/adodb/drivers/adodb-postgres64.inc.php on line 686
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 --post-data 'writeMonitoring=Go' -O nagiosql.export.monitoring
--2010-11-03 13:28:37-- 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
[ <=> ] 0 --.-K/s in 0s

2010-11-03 13:28:37 (0.00 B/s) - `nagiosql.export.monitoring' saved [0/0]

--2010-11-03 13:28:37-- 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
[ <=> ] 0 --.-K/s in 0s

2010-11-03 13:28:38 (0.00 B/s) - `nagiosql.export.additional' saved [0/0]

CMDLINE:
/usr/bin/wget --load-cookies=nagiosql.cookies http://localhost/nagiosql/admin/verify.php --post-data 'writeAdditional=Go' -O nagiosql.export.additional
OUTPUT:
Nagios Core 3.2.2
Copyright (c) 2009-2010 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 09-01-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/xitemplates.cfg'...
Processing object config file '/usr/local/nagios/etc/static/xitest.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!


***> 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 ~/nagios/nagiosxi/nagiosxi/basedir/scripts
tar: Removing leading `/' from member names
~/nagios/nagiosxi/nagiosxi/basedir/scripts
ls: /usr/local/nagiosxi/nom/checkpoints/nagioscore/*.gz: No such file or directory
NO NOM SNAPSHOT FOUND!
~/nagios/nagiosxi

Re: unable to start Nagios service

Posted: Wed Nov 03, 2010 8:28 pm
by mguthrie
I'm noticing there may have been some problems with postgresql installing or starting correctly. Check the following:

service postgresql status
service postgresql restart

If it's not installed then I'm guessing that had an issue with the proxy. See if you can get it installed if it isn't there already, then try running through the install scripts again.

Re: unable to start Nagios service

Posted: Thu Nov 04, 2010 9:42 am
by ericsson_att
Since the db_servertype=mysql in ndo2db.cfg, shouldnt Nagios use MySQL DB? Does nagios require both Postgress and MySQL?

Anyways,here is the status from the commands:

[root@ltenav1 etc]# service postgresql status
postmaster (pid 9172 9171 9170 9164 9105) is running...
You have new mail in /var/spool/mail/root
[root@ltenav1 etc]# service postgresql restart
Stopping postgresql service: [ OK ]
Starting postgresql service: [ OK ]
[root@ltenav1 etc]#