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.