Error: Could not find a service matching ....

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
PhilG
Posts: 286
Joined: Thu Jan 16, 2014 10:24 am

Error: Could not find a service matching ....

Post by PhilG »

Hello:
I'm running into the following error messages when I did an "Apply Configuration" after attempting to delete a user from within Nagio XI (version 5.4.13):
1).
"
Error: Could not find a service matching host name '<servicename>.<doman>' and description 'Ping' (config file '/usr/local/nagios/etc/servicegroups.cfg', starting on line 53)
"

and

2).
"
Error: Contact '<first.last>' has no service notification commands defined!
"

Regarding 1)., I did find the '<servicename>.<doman>' and its associated 'Ping' Service in "/usr/local/nagios/etc/servicegroups.cfg" and did find '<servicename>.<doman>' in "/usr/local/nagios/etc/hostgroups.cfg". I did note that '<servicename>.<doman>' existed in the Nagios XI console BUT the Ping Service was not there and a different Service existed (Check_UPS...).

If I can't manually edit "/usr/local/nagios/etc/servicegroups.cfg" as per its warning comment, below, how may I fix this, please?

"
# --- 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.
"
Newbie '14
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Error: Could not find a service matching ....

Post by tgriep »

For number 1, try this

Login to the XI GUI and go to the Core Config Manager > Service Groups menu.
Click on the View Config icon (On the right side of the menu and on any group) to view the configs that are stored in the database, copy the config data for the service groups in to a text document and then you can look at the configurations at line 53 to see the Hosts and Services which then you can use to verify if they exist or not and then remove the one that is causing the error.

For number 2, Go to the Core Config Manager > Contacts menu and edit the contact in question.
Go to the Alert Settings Tab and click on the Manage Service Notifications Commands button and there you can add a Notification command to the contact.
Typically, the command used is the xi_service_notification_handler.

Add a command, save the settings and see if the Apply Config finishes without any errors.

Another option is to add a Contact Template to the contact which will add the Notification Commands to the contact through that.
On the Common Settings Tab, click on the Manage Contact Template button to add a template. The most common one used is the xi_contact_generic but you can view another contact to see if you are using another template.
Be sure to check out our Knowledgebase for helpful articles and solutions!
PhilG
Posts: 286
Joined: Thu Jan 16, 2014 10:24 am

Re: Error: Could not find a service matching ....

Post by PhilG »

Since you didn't provide the steps on how to "... remove the one that is causing the error.", I did find a way to resolve this issue.
I have also resolved the second issue by noting there was no associated dependent relationship Contacttemplate, Hosttemplate, or Servicetemplate, etc, so I added the Contact to a generic service and host template, saved, then deleted the Contact and Applied Configuration.

Looks like all is working now.
Thank you for the assistance.
You may lock this post.
Newbie '14
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Error: Could not find a service matching ....

Post by scottwilkerson »

PhilG wrote:Since you didn't provide the steps on how to "... remove the one that is causing the error.", I did find a way to resolve this issue.
I have also resolved the second issue by noting there was no associated dependent relationship Contacttemplate, Hosttemplate, or Servicetemplate, etc, so I added the Contact to a generic service and host template, saved, then deleted the Contact and Applied Configuration.

Looks like all is working now.
Thank you for the assistance.
You may lock this post.
Great!

Locking thread
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked