Page 2 of 2

Re: Cannot add hosts to services in NagiosXI 5.8.5

Posted: Tue Aug 17, 2021 2:34 pm
by pbroste
Hello @TreviPay

Thanks for following up with the details.

We loaded your System Profile on test VM and we were able to duplicate the errors.

On my test system it would fail on line 25 on '/usr/local/nagios/etc/services/TOMCAT.cfg' after Applying Config.

I then headed to CCM > Services > TOMCAT-phonestats > [Managed Hosts] > selected; 'admin-dr.multiservice.com > [Add Selected] > [Close].

Applied Configuration which resulted in
Nagios Core was restarted with an updated configuration
Both TOMCAT services would then apply.

Please try this on your environment and let me know the results,
Perry

Re: Cannot add hosts to services in NagiosXI 5.8.5

Posted: Wed Aug 18, 2021 7:46 am
by TreviPay
You were able to successfully duplicate the issue where hosts cannot be added to services?

When I try to add a host (any host, admin-dr or otherwise) to any service (not limited to the Tomcat example services I've been using to demonstrate) or even If I try to remove 1 host from a service that has multiple hosts already assigned; once saved, the service shows that it has 0 hosts assigned when I try to apply the configuration change.

When I try to add any host to the TOMCAT-phonestats service, nagios complains about line 16 of /usr/local/nagios/etc/services/TOMCAT.cfg:

Code: Select all

###############################################################################
#
# Services configuration file
#
# Created by: Nagios CCM 3.1.3
# Date:       2021-08-18 07:09:09
# Version:    Nagios Core 4.x
#
# --- 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.
#
###############################################################################

 [b]This line[/b] -> define service {
    service_description    TOMCAT-phonestats
    use                    generic-service
    check_command          check-http-phonestats!:8080/queuemetrics!!!!!!!
    register               1
}

###############################################################################
#
# Services configuration file
#
# END OF FILE
#
###############################################################################
If you are seeing an error on line 25 (rather than 16) then your /usr/local/nagios/etc/services/TOMCAT.cfg must have a second entry (while mine only has the 1 above).

I tried adding admin-dr as a host to that service anyway but I am met with the same problem that I face when adding any other host(s) to any service file. I can also take a service file that has multiple hosts, and when I try to remove a single host from that service, all hosts are removed instead. For example, /usr/local/nagios/etc/services/Ping.cfg:

Code: Select all

define service {
    host_name              augwce.tpg.multiservice.com,augwf.multiservice.com,augwr.multiservice.com,dcgwf.multiservice.com,dcgwr.multiservice.com,nlgwf.multiservice.com,nlgwr.multiservice.com,opbgwf.multiservice.com,opbgwr.multiservice.com,opbvpngw.multiservice.com,opbvpngw10.multiservice.com,opbvpngw5.multiservice.com,opbvpngw6.multiservice.com,opbvpngw7.multiservice.com,opbvpngw8.multiservice.com,usopgw1.tierpoint.gateway.multiservice.net,usopgw2.tierpoint.gateway.multiservice.net
    service_description    Ping
    use                    generic-service
    check_command          check-ping!3000,80%!5000,100%!5!30!!!!
    register               1
}
If I remove 1 host, nlgwr for example, then it becomes the following instead of just removing the 1 host.

Code: Select all

define service {
    service_description    Ping
    use                    generic-service
    check_command          check-ping!3000,80%!5000,100%!5!30!!!!
    register               1
}
This issue still persists.

Re: Cannot add hosts to services in NagiosXI 5.8.5

Posted: Wed Aug 18, 2021 1:09 pm
by pbroste
Hello @TreviPay

Hmmm, interesting that we are seeing differences with the same database environment. Next steps we will go through the same steps that we have done prior and also log the results.

Please go to Configure > Core Config Manager > Tools > Config File Management:
- Click the Delete Files button (don't worry, it's safe, they will be rewritten)
- Then click the Write Configs button
- Once they are done being written, please run this tail command (and leave it running):

Code: Select all

tail -F /usr/local/nagiosxi/var/cmdsubsys.log /var/log/httpd/error_log /var/log/httpd/ssl_error_log
or to write to file:

Code: Select all

tail -F /usr/local/nagiosxi/var/cmdsubsys.log /var/log/httpd/error_log /var/log/httpd/ssl_error_log >> results.txt
ctl-c to break out.

Then make a change and try to replicate the issue, try to apply configuration through the web interface and once it completes/errors send me the full output from the tail command above.

PM a FRESH copy of your profile.zip immediately after so I can review the other logs/settings as well (results.txt).

Thanks,
Perry

Re: Cannot add hosts to services in NagiosXI 5.8.5

Posted: Wed Aug 18, 2021 1:40 pm
by TreviPay
I sent 2 PMs because it said I could only attach 1 file at a time. The first is the log results and the second is the profile.

Re: Cannot add hosts to services in NagiosXI 5.8.5

Posted: Wed Aug 18, 2021 2:37 pm
by pbroste
I see that I overlooked the config in a previous post to remove Strict Trans, by making the edit to this line:
[mysqld]
sql_mode=""
If the sql_mode= line already exists you will need to replace it with the following. If the line does not exist you will need to add the following line.

Run this command to confirm:

Code: Select all

mysql -u root -p'nagiosxi' -e "SELECT @@GLOBAL.sql_mode;"
Should look like this:
+-------------------+
| @@GLOBAL.sql_mode |
+-------------------+
| |
+-------------------+
Then go ahead and bounce the service listed here:

https://support.nagios.com/kb/article/nagios-xi-strict_trans_tables-780.html

Let us know the results,
Perry

Re: Cannot add hosts to services in NagiosXI 5.8.5

Posted: Wed Aug 18, 2021 2:48 pm
by pbroste
Following up, you may also want to run a database repair once you have updated the strict trans.

Thanks,
Perry

Re: Cannot add hosts to services in NagiosXI 5.8.5

Posted: Wed Aug 18, 2021 4:00 pm
by TreviPay
That fixed it. Thanks for your help

Re: Cannot add hosts to services in NagiosXI 5.8.5

Posted: Thu Aug 19, 2021 1:26 pm
by pbroste
Hello @TreviPay

That is great news, and thanks for letting us know.

I will go ahead and lock this.

Thanks,
Perry