Nagios XI - Apply Configuration Never Completes

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios XI - Apply Configuration Never Completes

Post by scottwilkerson »

Code: Select all

Error: Contact 'user' has no service notification commands defined!
Did you recently make changes in the CCM or add this user?

Did you set a service notification command?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
MOHANREDDY
Posts: 81
Joined: Tue Apr 10, 2018 4:14 pm

Re: Nagios XI - Apply Configuration Never Completes

Post by MOHANREDDY »

Previously, i set it and after the error i took out the user and tried to apply configuration but still the error persists.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios XI - Apply Configuration Never Completes

Post by scottwilkerson »

Go to CCM -> Config File Management
Click Delete Files
Click Write Files
Click Verify Files

If not any errors, Apply configuration, if you get errors post them here
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
MOHANREDDY
Posts: 81
Joined: Tue Apr 10, 2018 4:14 pm

Re: Nagios XI - Apply Configuration Never Completes

Post by MOHANREDDY »

scottwilkerson wrote:Go to CCM -> Config File Management
Click Delete Files
Click Write Files
Click Verify Files

If not any errors, Apply configuration, if you get errors post them here

I did all you said but am getting the same error as previous

Successfully deleted all Host / Service Config Files


Write host configurations ...
Configuration file: localhost.cfg successfully written!
Configuration file: server.cfg successfully written!
Host configuration files successfully written!

Write service configurations ...
Configuration file: localhost.cfg successfully written!
Configuration file: server.cfg successfully written!
Service configuration files successfully written!

Configuration file: hostgroups.cfg successfully written!
Configuration file: servicegroups.cfg successfully written!
Configuration file: hosttemplates.cfg successfully written!
Configuration file: servicetemplates.cfg successfully written!
Configuration file: timeperiods.cfg successfully written!
Configuration file: commands.cfg successfully written!
Configuration file: contacts.cfg successfully written!
Configuration file: contactgroups.cfg successfully written!
Configuration file: contacttemplates.cfg successfully written!
Configuration file: servicedependencies.cfg successfully written!
Configuration file: hostdependencies.cfg successfully written!
Configuration file: serviceescalations.cfg successfully written!
Configuration file: hostescalations.cfg successfully written!
Configuration file: serviceextinfo.cfg successfully written!
Configuration file: hostextinfo.cfg successfully written!

Nagios Core 4.2.4
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 12-07-2016
License: GPL

Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Read object config files okay...

Running pre-flight check on configuration data...

Checking objects...
Checked 20 services.
Checked 2 hosts.
Checked 1 host groups.
Checked 0 service groups.
Checked 2 contacts.
Checked 1 contact groups.
Checked 124 commands.
Checked 8 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 2 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 8 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors: 0


Things look okay - No serious problems were detected during the pre-flight check

while Apply configuration am getting the same error as before.

Apply Configuration
Reset config permissions failed.
An error occurred while attempting to apply your configuration to Nagios Core. Monitoring engine configuration files have been rolled back to their last known good checkpoint.
Try Again View Snapshot
Show Written Configs
Error: Contact "user" has no service notification commands defined!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios XI - Apply Configuration Never Completes

Post by scottwilkerson »

PM Sent
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios XI - Apply Configuration Never Completes

Post by scottwilkerson »

Can you run the following as the nagios user

sudo su nagios -c 'cd /usr/local/nagiosxi/scripts/ && ./reconfigure_nagios.sh'

This type of error is almost always permissions, or invalid sudoers file

Does your organizations use a traditional sudoers file?

Can you run

Code: Select all

visudo
Then enter the following

Code: Select all

:wq
and press enter

Do you get any errors?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
MOHANREDDY
Posts: 81
Joined: Tue Apr 10, 2018 4:14 pm

Re: Nagios XI - Apply Configuration Never Completes

Post by MOHANREDDY »

It ran successfully with no errors.
Checking objects...
Checked 20 services.
Checked 2 hosts.
Checked 1 host groups.
Checked 0 service groups.
Checked 3 contacts.
Checked 1 contact groups.
Checked 124 commands.
Checked 8 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 2 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 8 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 0
Total Errors: 0


Things look okay - No serious problems were detected during the pre-flight check

and the output of visudo is
User_Alias NAGIOSXI=nagios
User_Alias NAGIOSXIWEB=apache
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios start
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios stop
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios restart
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios reload
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios status
NAGIOSXI ALL = NOPASSWD:/etc/init.d/nagios checkconfig
NAGIOSXI ALL = NOPASSWD:/etc/init.d/ndo2db start
NAGIOSXI ALL = NOPASSWD:/etc/init.d/ndo2db stop
NAGIOSXI ALL = NOPASSWD:/etc/init.d/ndo2db restart
NAGIOSXI ALL = NOPASSWD:/etc/init.d/ndo2db reload
NAGIOSXI ALL = NOPASSWD:/etc/init.d/ndo2db status
NAGIOSXI ALL = NOPASSWD:/etc/init.d/npcd start
NAGIOSXI ALL = NOPASSWD:/etc/init.d/npcd stop
NAGIOSXI ALL = NOPASSWD:/etc/init.d/npcd restart
NAGIOSXI ALL = NOPASSWD:/etc/init.d/npcd reload
NAGIOSXI ALL = NOPASSWD:/etc/init.d/npcd status
NAGIOSXI ALL = NOPASSWD:/usr/bin/php /usr/local/nagiosxi/html/includes/components/autodiscovery/scripts/autodiscover_new.php *
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/html/includes/components/profile/getprofile.sh
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/scripts/upgrade_to_latest.sh
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/scripts/change_timezone.sh
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/scripts/manage_services.sh *
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/scripts/reset_config_perms.sh
NAGIOSXI ALL = NOPASSWD:/usr/local/nagiosxi/scripts/backup_xi.sh *
NAGIOSXIWEB ALL = NOPASSWD:/usr/bin/tail -100 /var/log/messages
NAGIOSXIWEB ALL = NOPASSWD:/usr/bin/tail -100 /var/log/httpd/error_log
NAGIOSXIWEB ALL = NOPASSWD:/usr/bin/tail -100 /var/log/mysqld.log
NAGIOSXIWEB ALL = NOPASSWD:/usr/bin/php /usr/local/nagiosxi/html/includes/components/autodiscovery/scripts/autodiscover_new.php *
NAGIOSXIWEB ALL = NOPASSWD:/usr/local/nagiosxi/html/includes/components/profile/getprofile.sh
NAGIOSXIWEB ALL = NOPASSWD:/etc/init.d/snmptt restart
NAGIOSXIWEB ALL = NOPASSWD:/usr/local/nagiosxi/scripts/repair_databases.sh
NAGIOSXIWEB ALL = NOPASSWD:/usr/local/nagiosxi/scripts/manage_services.sh *
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios XI - Apply Configuration Never Completes

Post by scottwilkerson »

Is that all that was in the file when you ran visudo?

Because that is mussing all of the defaults.. Can you check with an administrator to make sure you use standard sudoers?

Also when you had it open and saved it with

Code: Select all

:wq
did you get any errors?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Nagios XI - Apply Configuration Never Completes

Post by npolovenko »

@MOHANREDDY, In addition to @scottwilkerson post I'd like to see the following file on your system:

Code: Select all

/etc/httpd/conf.d/nagios.conf
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
MOHANREDDY
Posts: 81
Joined: Tue Apr 10, 2018 4:14 pm

Re: Nagios XI - Apply Configuration Never Completes

Post by MOHANREDDY »

npolovenko wrote:@MOHANREDDY, In addition to @scottwilkerson post I'd like to see the following file on your system:

Code: Select all

/etc/httpd/conf.d/nagios.conf
cat /etc/httpd/conf.d/nagios.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.

ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"

<Directory "/usr/local/nagios/sbin">
# SSLRequireSSL
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
AuthName "Nagios Core"
AuthType Basic
AuthUserFile /usr/local/nagiosxi/etc/htpasswd.users
Require valid-user
Require all denied
</Directory>

Alias /nagios "/usr/local/nagios/share"

<Directory "/usr/local/nagios/share">
# SSLRequireSSL
Options None
AllowOverride None
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
AuthName "Nagios Core"
AuthType Basic
AuthUserFile /usr/local/nagiosxi/etc/htpasswd.users
Require valid-user
Require all denied
</Directory>
Locked