Page 1 of 1

Adding Services to a Host

Posted: Mon Nov 16, 2015 2:33 pm
by martincb
We are running an evaluation version of Nagiosxi:
Nagios XI Version : 5.2.0
ditlina550 3.10.0-229.11.1.el7.x86_64 x86_64
Red Hat Enterprise Linux Server release 7.1 (Maipo)
Gnome Installed

Our current production system is a Nagios Core 3.5.* and configuration is handled via NCONF. I did see an earlier posting of the same question earlier this year and going through the provided solution did not resolve the problem:

In this case the host is and initial services cfg files are both named hrisapp2.cfg. The services file contains only the xiwizard_linuxserver_ping_service service.

Adding a check_nrpe service to an existing host through the Configure > Core Configuration > Services > Add New seems to work, i.e. the new service appears as belonging to the hrisapp configuration, but after successful application of the new configuration the service never appears assigned to the host. The existing hrisapp2.cfg services file still only contains the xiwizard_linuxserver_ping_service

In the CCM Services page I choose the View Text Config which is as follows. As with the prior poster I am missing something very basic, but the resolution continues to allude me.

Regards,

Corrie

###############################################################################
#
# Service configuration file
#
# Created by: Nagios Core Config Manager 2.5.0
# Date: 2015-11-16 19:30:26
# Version: Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios CCM will overwrite all manual settings during the next update if you
# would like to edit files manually, place them in the 'static' directory or
# import your configs into the CCM by placing them in the 'import' directory.
#
###############################################################################

define service {
host_name hrisapp2
service_description check_adp
display_name FS:/adp
check_command check_nrpe!check_adp!!!!!!!
max_check_attempts 5
check_interval 5
retry_interval 1
active_checks_enabled 1
check_period 24x7
notifications_enabled 0
register 1
}

define service {
host_name hrisapp2
service_description Ping
use xiwizard_linuxserver_ping_service
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
notification_period xi_timeperiod_24x7
notifications_enabled 0
contacts martincb
_xiwizard solaris
register 1
}

###############################################################################
#
# Service configuration file
#
# END OF FILE
#
###############################################################################

Re: Adding Services to a Host

Posted: Mon Nov 16, 2015 3:27 pm
by hsmith
I need to point out that we only support Nagios XI on minimal install RHEL/CentOS systems. We do not support them if they have a desktop environment installed. With that out of the way, I would like to do some basic troubleshooting to see what we can find out here.

When you say the service never appears on the host, can you describe that a little more? If you go into the CCM, it is there, but it doesn't show up on the services view page?

Re: Adding Services to a Host

Posted: Mon Nov 16, 2015 3:45 pm
by martincb
This RHEL is a quick and dirty default install hence it does have the desktop, which can be rectified should we proceed with xi. Unless, of course, the desktop is a contributing factor.

In the CCM, there are two services, Ping and check_adp, both in the hrisapp2 configuration. Selecting the View Text Config in the Actions column for either service I see the output previously provided.

In the Home > Service Detail or Home> Host Detail the only service showing up in the Ping generated from the initial Solaris Configuration Wizard.

I have run a check_nrpe command with the check_adp argument against this host from the command line and it does return the OK status with the expected information.

Re: Adding Services to a Host

Posted: Tue Nov 17, 2015 12:37 am
by Box293
It sounds like the flat config file is not being written to disk.

Try this:

Go into CCM
Tools > Write Config Files
Click the Delete button
It will say "Successfully deleted all Host / Service Config Files"
Click the Write Button
It will show an output of all the files it creates
Quick Tools > Apply Configuration
Click the Apply Configuration button

Does the service appear now?

Also, can you browse to http://xiserverip/nagios and does the service appear there? Notice the URL is /nagios NOT /nagiosxi

Re: Adding Services to a Host

Posted: Wed Nov 18, 2015 9:53 am
by martincb
The service does appear now in both xi and core

In testing this implementation I have noticed this behavior frequently and have attributed it to misconfiguration or ineptitude on my part. Is there a reason for the flat file not being written?

Is there a white paper covering the stages of configuration changes, i.e. write change record to database, generate flat file, and then generate config file on disc?

Thanks and Regards,

Corrie

Re: Adding Services to a Host

Posted: Wed Nov 18, 2015 1:42 pm
by rkennedy
I'm kind of confused by this thread, but I'll do my best to explain what I think the underlying issue is -

1. After making changes in CCM, you must apply configuration in order for it to initiate. It will restart the Nagios service.
2. Any chances made to the raw files will not work as the values are stored in SQL with XI, rather than flat text files for everything as you were probably used to in core.

Does this provide clarification for you?

Re: Adding Services to a Host

Posted: Fri Nov 20, 2015 10:13 am
by martincb
Hopefully the following will be more illuminating, but is certainly long winded.

For some reason the changes made in CCM were not being written to the configuration files even after applying the changes. Deleting and writing the config files from the Tools page followed by Apply Changes did complete successfully.

My follow up questions were to understand why my initial Apply Changes did not work, if this is a common occurrence, and if there is a particular reason it could happen (misconfiguration or permissions) which could be altered to rectify the problem since it seems to happen quite frequently with this installation.

Part of understanding the possible problems would be to have some concept of how nagiosxi works with the various stages of generating the configuration changes. I have worked with NCONF and observed the end result for configuration changes in nagiosxi and NCONF is that the configuration files are created in the filesystem and read during startup. I would like to understand the interim steps.

My initial observation was that the configuration file available in CCM>Services View Text Config (under the service action column) did contain my changes. Apply Configuration did not result in the service being "attached" to the host and the changes did not appear in the services configuration file which is used during startup. There was disparate information in two different text configs, but I do not know the source of the information returned by selecting the View Text Config button.

Regardless, the changes are now appearing under the relevant host services.

Corrie

Re: Adding Services to a Host

Posted: Fri Nov 20, 2015 2:25 pm
by lmiltchev
For some reason the changes made in CCM were not being written to the configuration files even after applying the changes. Deleting and writing the config files from the Tools page followed by Apply Changes did complete successfully.
It is hard to say what was causing the issue - "ghost" hosts/services, database problems, permission issues, etc. In any case, this shouldn't be a "common occurrence".

In Nagios XI, you have to modify configuration files in the Core Config Manager (CCM). When you click on "View Text Config" you see what is currently in the database. When you apply configuration, all of your mods are written to flat files.

If you encounter the same issue again, please let us know asap. We will need to review your profile in order to troubleshoot the issue:

Admin->System Profile->Download Profile

Don't posted on the forum. PM it to someone on the Nagios Tech Support team.