Error: Could not find a service matching host name

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
kaushalshriyan
Posts: 124
Joined: Fri May 22, 2015 7:12 am

Error: Could not find a service matching host name

Post by kaushalshriyan »

Hi,

I am facing a issue whose details are as below :-

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Nagios Core 4.2.0
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-01-2016
License: GPL

Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Error: Could not find a service matching host name 'nodejs01.example.in' and description 'check_rabbitmq_example_smsqueue' (config file '/usr/local/nagios/etc/objects/servicegroups.cfg', starting on line 1)
Error: Could not expand members specified in servicegroup 'rabbitmqqueues' (config file '/usr/local/nagios/etc/objects/servicegroups.cfg', starting at line 1)
Error processing object config files!


***> One or more problems was encountered while processing the config files...

Check your configuration file(s) to ensure that they contain valid
directives and data defintions. If you are upgrading from a previous
version of Nagios, you should be aware that some variables/definitions
may have been removed or modified in this version. Make sure to read
the HTML documentation regarding the config files, as well as the
'Whats New' section to find out what has changed.

cat nodejs01.example.in.cfg
define service {
use generic-service
host_name nodejs01.example.in
service_description Check Rabbit MQ SMS Queue
check_command check_nrpe!check_rabbitmq_example_smsqueue
servicegroups rabbitmqqueues
}

define service {
use generic-service
host_name nodejs01.example.in
service_description Check Rabbit MQ Email Queue
check_command check_nrpe!check_rabbitmq_example_emailqueue
servicegroups rabbitmqqueues

define servicegroup{
servicegroup_name rabbitmqqueues
alias RabbitMQ Helpcchat queues
members nodejs01.example.in,check_rabbitmq_example_smsqueue,nodejs01.example.in,check_rabbitmq_example_emailqueue
}

hostname :- nodejs01.example.in
service :- check_rabbitmq_example_smsqueue

hostname :- nodejs01.example.in
service :- check_rabbitmq_example_emailqueue

Any help will be highly appreciable.

Thanks and Regards,

Kaushal
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Error: Could not find a service matching host name

Post by rkennedy »

Can you show us your host definition for nodejs01.example.in as well?
Former Nagios Employee
kaushalshriyan
Posts: 124
Joined: Fri May 22, 2015 7:12 am

Re: Error: Could not find a service matching host name

Post by kaushalshriyan »

Hi Robert,

Please find the below details :-

host definition :- http://sprunge.us/hGSg located inside /usr/local/nagios/etc/servers
cat nagios.cfg -> http://sprunge.us/KYEY in /usr/local/nagios/etc

Regards,

Kaushal
kaushalshriyan
Posts: 124
Joined: Fri May 22, 2015 7:12 am

Re: Error: Could not find a service matching host name

Post by kaushalshriyan »

Hi Robert,

cfg_dir=/usr/local/nagios/etc/servers as mentioned in nagios.cfg file located inside /usr/local/nagios/etc directory

Regards,

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

Re: Error: Could not find a service matching host name

Post by Box293 »

kaushalshriyan wrote:Error: Could not find a service matching host name 'nodejs01.example.in' and description 'check_rabbitmq_example_smsqueue' (config file '/usr/local/nagios/etc/objects/servicegroups.cfg', starting on line 1)
You do not have a service called check_rabbitmq_example_smsqueue, your service is called Check Rabbit MQ SMS Queue.

Your servicegroup definition should be:

Code: Select all

define servicegroup{
servicegroup_name rabbitmqqueues
alias RabbitMQ Helpcchat queues
members nodejs01.example.in,Check Rabbit MQ SMS Queue,nodejs01.example.in,Check Rabbit MQ Email Queue
}
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked