Apply Config-->"Service has no hosts and/or service_"

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
wyoder
Posts: 50
Joined: Mon Dec 29, 2014 3:21 pm
Location: Raleigh, NC
Contact:

Apply Config-->"Service has no hosts and/or service_"

Post by wyoder »

Using the Core Config Manager, we are trying to set up a simple alert for a Host Group named "linux-servers" so that our "nagios_linux_admin" Contact Group will be notified if any of the Host Group services go down.

In the process:
- We have added individual Contacts to the Contact Group.
- We have added individual Hosts to the Host Group.
- We have updated "Host Escalations" to include the "nagios_linux_admin" Contact Group.
- We have NOT added any "Service Escalations".
- We have created a "linux-servers" Service Group and added a single service to it for a single host.

At this point, we've saved all these changes but can't apply the configuration changes. The error is:

Error: Service has no hosts and/or service_description (config file '/usr/local/nagios/etc/services/ping.cfg', starting on line 16)

Is this the right way to do things? Attached is a system profile to help.

If we understood groups better, maybe we could proceed more intelligently. We found some core documentation (written by Ethan?) here:

https://assets.nagios.com/downloads/nag ... bject.html
https://assets.nagios.com/downloads/nag ... tance.html
https://assets.nagios.com/downloads/nag ... tions.html
https://assets.nagios.com/downloads/nag ... ricks.html

Do these include the relevant explanations? We'd like to understand the whole object model with groups and inheritance, but things get complicated quickly in these docs.

Thanks,
--Bill
You do not have the required permissions to view the files attached to this post.
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: Apply Config-->"Service has no hosts and/or service_"

Post by gormank »

This isn't a direct answer, but I suspect it will resolve the issue...
It would be a better idea to make the ping check a host check rather than a service. This way the services would depend on the host being reachable.
You might also create host and service templates so that much of the repetitive stuff is not attached to the host/service, such as this check, check intervals, retries, etc.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Apply Config-->"Service has no hosts and/or service_"

Post by ssax »

You still would need to select the hosts/hostgroups on the service (you could also define them on a template that is assigned to the service) but you must attach a service to hosts/hostgroups through on of those methods.
wyoder
Posts: 50
Joined: Mon Dec 29, 2014 3:21 pm
Location: Raleigh, NC
Contact:

Re: Apply Config-->"Service has no hosts and/or service_"

Post by wyoder »

Thanks to you both.

Using the CCM, we removed all references to ping. We were finally able to get a single service ("Users") assigned to a single host ("exportrh-01") on the Service Group Management page and successfully Apply Configuration. We also enabled Service Notifications using the Contact Management-->Alert Settings page. For the "Manage Host Notification Commands" and "Manage Service Notification Commands" we assigned "notify-host(-service)-by-email" and "xi_host(_service)_notification_handler."

Finally, we tripped the switch by exceeding the Users critical threshold. Although the Users icon flipped to red, there was no notification love. That is, no email was generated to the Contact. We'll keep trying.

--Bill
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Apply Config-->"Service has no hosts and/or service_"

Post by ssax »

If you post (or PM me) an udpated profile we can take a look through it and see exactly the way it's configured.

When it went into the critical state, did it stay in that critical SOFT state for the calculation (max_check_attempts X retry_interval) so that it entered into a hard critical state? It wouldn't send on the first critical detection unless you have it set to.
wyoder
Posts: 50
Joined: Mon Dec 29, 2014 3:21 pm
Location: Raleigh, NC
Contact:

Re: Apply Config-->"Service has no hosts and/or service_"

Post by wyoder »

Thanks for your response. I'll follow-up early next week.

Have a good week-end!
--Bill
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Apply Config-->"Service has no hosts and/or service_"

Post by ssax »

Thanks, you too! I'll keep an eye out.
wyoder
Posts: 50
Joined: Mon Dec 29, 2014 3:21 pm
Location: Raleigh, NC
Contact:

Re: Apply Config-->"Service has no hosts and/or service_"

Post by wyoder »

Dear Ssax:

My understanding of service groups is growing. Accordingly, you can close this topic. I plan to open another topic with a more intelligent line of questioning--it will concern our goal of creating various service groups--e.g., one group for Ubuntu services, another group for Windows server 2008 services, etc., and then apply or assign these service groups to the relevant host groups. Or maybe it's the other way around--assign various host groups to their corresponding service groups. Or maybe I just don't get it.

Thanks,
--Bill
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Apply Config-->"Service has no hosts and/or service_"

Post by Box293 »

As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
wyoder
Posts: 50
Joined: Mon Dec 29, 2014 3:21 pm
Location: Raleigh, NC
Contact:

Re: Apply Config-->"Service has no hosts and/or service_"

Post by wyoder »

Earlier you wrote, "...but you must attach a service to hosts/hostgroups....", which helped me grok the idea of services attached to hostgroups.

Also the referenced link really helped: https://support.nagios.com/kb/article.php?id=507. Right from the get-go it states: "Using hostgroups in your service definitions is one of the most powerful features of Nagios."

Quite honestly, it was the "Configuration Wizard: Linux Server" that threw me off. By setting up a separate service for each individual host I added, the wizard implemented a configuration very unlike a host group configuration.

So we've recovered by grouping our dozens of Linux hosts into appropriate hostgroups and then assigning individual services to one group at a time. Much better. So feel free to close this post when convenient. Just out of curiousity, is there also a KB article on setting up service groups?

Thanks for your help.
--Bill
Locked