nagiosxi stuck at applying configuration

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
nanz28v
Posts: 70
Joined: Tue Dec 11, 2012 2:59 pm

Re: nagiosxi stuck at applying configuration

Post by nanz28v »

abrist,

Thank you.

1) We have less than 10 hosts and services each since it's only in testing phase.
2) please see attached.
3) I have made the changes.

The problem is still there after a restart after step 3 above. Also I cannot restart nagios service with the following error message:

[root@sm5nag01 ~]# service nagios restart
Running configuration check... CONFIG ERROR! Restart aborted. Check your Nagios configuration.
You do not have the required permissions to view the files attached to this post.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: nagiosxi stuck at applying configuration

Post by abrist »

Just as I thought. xi_timeperiod_24x7 exists in both the xiobjects.cfg and timeperiods.cfg file. Our update script should have fixed this conflict on update - but it obviously did not. Comment out the following lines (by adding a '#' to the beginning of each line) in the /usr/local/nagios/etc/static/xiobjects.cfg file so that it resembles:

Code: Select all

#define timeperiod{
#	timeperiod_name xi_timeperiod_24x7
#	alias           24x7
#	sunday          00:00-24:00
#	monday          00:00-24:00
#	tuesday         00:00-24:00
#	wednesday       00:00-24:00
#	thursday        00:00-24:00
#	friday          00:00-24:00
#	saturday        00:00-24:00
#	}
And then verify your config:

Code: Select all

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
If it checks out ok, restart nagios. If it does not check out ok, post the errors here.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
nanz28v
Posts: 70
Joined: Tue Dec 11, 2012 2:59 pm

Re: nagiosxi stuck at applying configuration

Post by nanz28v »

It failed, here's the error message:

root@sm5nag01:~[root@sm5nag01 ~]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.
cfg

Nagios Core 3.5.0
Copyright (c) 2009-2011 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 03-15-2013
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/xiobjects.cfg'...
Processing object config file '/usr/local/nagios/etc/static/xitest.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 file '/usr/local/nagios/etc/hosts/www.google.com.cfg'...
Processing object config file '/usr/local/nagios/etc/hosts/AL5BITEC01.cfg'...
Processing object config file '/usr/local/nagios/etc/hosts/SM5UNITFS01.cfg'...
Processing object config file '/usr/local/nagios/etc/hosts/localhost.cfg'...
Processing object config file '/usr/local/nagios/etc/hosts/Exchange03-MEVS1.cfg'...
Processing object config file '/usr/local/nagios/etc/hosts/Ironmail-CT1.cfg'...
Processing object config directory '/usr/local/nagios/etc/services'...
Processing object config file '/usr/local/nagios/etc/services/www.google.com.cfg'...
Processing object config file '/usr/local/nagios/etc/services/AL5BITEC01.cfg'...
Processing object config file '/usr/local/nagios/etc/services/SM5UNITFS01.cfg'...
Processing object config file '/usr/local/nagios/etc/services/localhost.cfg'...
Processing object config file '/usr/local/nagios/etc/services/Exchange03-MEVS1.cfg'...
Processing object config file '/usr/local/nagios/etc/services/CT1.cfg'...
Read object config files okay...

Running pre-flight check on configuration data...

Checking services...
Error: Contact 'tobiasa' specified in service 'CPU Usage' for host 'AL5BITEC01' is not defined anywhere!
Error: Contact 'tobiasa' specified in service 'Drive C: Disk Usage' for host 'AL5BITEC01' is not defined anywhere!
Error: Contact 'tobiasa' specified in service 'Memory Usage' for host 'AL5BITEC01' is not defined anywhere!
Error: Contact 'tobiasa' specified in service 'Ping' for host 'AL5BITEC01' is not defined anywhere!
Error: Contact 'zhangn' specified in service 'Symantec Endpoint Protection' for host 'AL5BITEC01' is not defined anywhere!
Error: Contact 'tobiasa' specified in service 'Uptime' for host 'AL5BITEC01' is not defined anywhere!
Error: Contact 'zhangn' specified in service 'OWA HTTP' for host 'Exchange03-MEVS1' is not defined anywhere!
Error: Contact 'zhangn' specified in service 'Ping' for host 'Exchange03-MEVS1' is not defined anywhere!
Error: Contact 'zhangn' specified in service 'SMTP' for host 'Exchange03-MEVS1' is not defined anywhere!
Error: Contact 'zhangn' specified in service 'Ping' for host 'Ironmail-CT1' is not defined anywhere!
Error: Contact 'zhangn' specified in service 'Application EventLog' for host 'SM5UNITFS01' is not defined anywhere!
Error: Contact 'zhangn' specified in service 'CPU Usage' for host 'SM5UNITFS01' is not defined anywhere!
Error: Contact 'zhangn' specified in service 'Drive C: Disk Usage' for host 'SM5UNITFS01' is not defined anywhere!
Error: Contact 'zhangn' specified in service 'Drive D: Disk Usage' for host 'SM5UNITFS01' is not defined anywhere!
Error: Contact 'zhangn' specified in service 'EventLog Agent' for host 'SM5UNITFS01' is not defined anywhere!
Error: Contact 'zhangn' specified in service 'Logon Errors' for host 'SM5UNITFS01' is not defined anywhere!
Error: Contact 'zhangn' specified in service 'Memory Usage' for host 'SM5UNITFS01' is not defined anywhere!
Error: Contact 'zhangn' specified in service 'Page File Usage' for host 'SM5UNITFS01' is not defined anywhere!
Error: Contact 'zhangn' specified in service 'Ping' for host 'SM5UNITFS01' is not defined anywhere!
Error: Contact 'zhangn' specified in service 'Security EventLog' for host 'SM5UNITFS01' is not defined anywhere!
Error: Contact 'zhangn' specified in service 'Server Work Queues' for host 'SM5UNITFS01' is not defined anywhere!
Error: Contact 'zhangn' specified in service 'Symantec Endpoint Protection' for host 'SM5UNITFS01' is not defined anywhere!
Error: Contact 'zhangn' specified in service 'System EventLog' for host 'SM5UNITFS01' is not defined anywhere!
Error: Contact 'zhangn' specified in service 'Uptime' for host 'SM5UNITFS01' is not defined anywhere!
Error: Contact 'zhangn' specified in service 'Windows Time' for host 'SM5UNITFS01' is not defined anywhere!
Error: Contact 'zhangn' specified in service 'ActiveHostChecks 5mn' for host 'localhost' is not defined anywhere!
Error: Contact 'zhangn' specified in service 'ActiveServiceChecks 5mn' for host 'localhost' is not defined anywhere!
Error: Contact 'zhangn' specified in service 'PassiveHostChecks 5mn' for host 'localhost' is not defined anywhere!
Error: Contact 'zhangn' specified in service 'PassiveServiceChecks 5mn' for host 'localhost' is not defined anywhere!
Error: Contact 'zhangn' specified in service 'DNS IP Match' for host 'www.google.com' is not defined anywhere!
Error: Contact 'zhangn' specified in service 'DNS Resolution' for host 'www.google.com' is not defined anywhere!
Error: Contact 'zhangn' specified in service 'HTTP' for host 'www.google.com' is not defined anywhere!
Error: Contact 'zhangn' specified in service 'Ping' for host 'www.google.com' is not defined anywhere!
Checked 41 services.
Checking hosts...
Warning: Host 'AL5BITEC01' has no default contacts or contactgroups defined!
Error: Contact 'zhangn' specified in host 'Exchange03-MEVS1' is not defined anywhere!
Error: Contact 'zhangn' specified in host 'Ironmail-CT1' is not defined anywhere!
Error: Contact 'zhangn' specified in host 'SM5UNITFS01' is not defined anywhere!
Error: Contact 'zhangn' specified in host 'www.google.com' is not defined anywhere!
Checked 6 hosts.
Checking host groups...
Checked 8 host groups.
Checking service groups...
Checked 3 service groups.
Checking contacts...
Checked 3 contacts.
Checking contact groups...
Checked 2 contact groups.
Checking service escalations...
Checked 0 service escalations.
Checking service dependencies...
Checked 0 service dependencies.
Checking host escalations...
Error: Contact 'zhangn' specified in host escalation for host 'Exchange03-MEVS1' is not defined anywhere!
Error: Contact 'zhangn' specified in host escalation for host 'Exchange03-MEVS1' is not defined anywhere!
Error: Contact 'zhangn' specified in host escalation for host 'SM5UNITFS01' is not defined anywhere!
Error: Contact 'zhangn' specified in host escalation for host 'SM5UNITFS01' is not defined anywhere!
Checked 4 host escalations.
Checking host dependencies...
Checked 0 host dependencies.
Checking commands...
Checked 109 commands.
Checking time periods...
Checked 12 time periods.
Checking for circular paths between hosts...
Checking for circular host and service dependencies...
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 1
Total Errors: 41

***> 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.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: nagiosxi stuck at applying configuration

Post by abrist »

You need to either create the following contacts, or remove them from any objects:

Code: Select all

tobiasa
zhangn
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
nanz28v
Posts: 70
Joined: Tue Dec 11, 2012 2:59 pm

Re: nagiosxi stuck at applying configuration

Post by nanz28v »

I tried to remove these 2 contacts directly, but it showed they are linked to services and hosts, so I removed all services and hosts from Nagios, then deleted both contact accounts. And the apply configuration still hangs.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: nagiosxi stuck at applying configuration

Post by slansing »

You would have had to remove them from hosts and services, then run the verification again, and then move on to the next configuration file(s) that needed to be altered. Please provide a new:

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

It is going to be telling you what you need to change..
nanz28v
Posts: 70
Joined: Tue Dec 11, 2012 2:59 pm

Re: nagiosxi stuck at applying configuration

Post by nanz28v »

I rerun /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios and get the following messages. Did I do something wrong?


root@sm5nag01:~[root@sm5nag01 ~]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios

Nagios Core 3.5.0
Copyright (c) 2009-2011 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 03-15-2013
License: GPL

Website: http://www.nagios.org
Reading configuration data...
Error: Cannot open main configuration file '/usr/local/nagios/etc/nagios' for reading!
Error processing main config file!



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

]0;root@sm5nag01:~[root@sm5nag01 ~]#
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: nagiosxi stuck at applying configuration

Post by abrist »

Looks like the verification command posted by Sam got truncated. Try:

Code: Select all

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
nanz28v
Posts: 70
Joined: Tue Dec 11, 2012 2:59 pm

Re: nagiosxi stuck at applying configuration

Post by nanz28v »

Here's the rerun, I don't see 'Ironmail-CT1' in hostgroup at all in the web console:

[root@sm5nag01 ~]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Nagios Core 3.5.0
Copyright (c) 2009-2011 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 03-15-2013
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/xiobjects.cfg'...
Processing object config file '/usr/local/nagios/etc/static/xitest.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'...
Error: Could not find any host matching 'Ironmail-CT1' (config file '/usr/local/nagios/etc/hostgroups.cfg', starting on line 41)
Error: Could not expand members specified in hostgroup (config file '/usr/local/nagios/etc/hostgroups.cfg', starting on line 41)
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.

[root@sm5nag01 ~]#
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: nagiosxi stuck at applying configuration

Post by abrist »

nanz28v wrote:Error: Could not find any host matching 'Ironmail-CT1' (config file '/usr/local/nagios/etc/hostgroups.cfg', starting on line 41)
You need to remove the host declaration "Ironmail-CT1" from any hostgroups or recreate the "Ironmail-CT1" host.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked