Error: Could not find any hostgroup matching

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
askewdread
Posts: 69
Joined: Wed Nov 16, 2016 4:54 pm

Error: Could not find any hostgroup matching

Post by askewdread »

Hi,

we have started getting the following error for some reason, and im struggling to find why...

Code: Select all

Error: Could not find any hostgroup matching 'sccm-exec-service-2008r2' (config file '/usr/local/nagios/etc/services/SCCM_PXE_Config.cfg', starting on line 36)
ive checked and that config file doesnt even exist anymore so im a bit confused....

ls: cannot access /usr/local/nagios/etc/services/SCCM_PXE_Config.cfg: No such file or directory

ive done the delete config files, write config files, verify and restart nagios

also ran the database repair

i can verify without error of nagios itself, but xi is still breaking
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Error: Could not find any hostgroup matching

Post by benjaminsmith »

HI @askewdread

I think there's a chance you may have multiple Nagios processes running, so let's stop and restart nagios, and the run pre-flight check on your configuarion files.

Stop Nagios, kill all process and a restart:

Code: Select all

service nagios stop
service ndo2db stop
killall -9 nagios
Check your configurations files for errors:

Code: Select all

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
If there are no errors, restart Nagios:

Code: Select all

service ndo2db start
service nagios start
If you're getting any errors, please try to correct those files and restart or post the errors to the forum for us to review.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
askewdread
Posts: 69
Joined: Wed Nov 16, 2016 4:54 pm

Re: Error: Could not find any hostgroup matching

Post by askewdread »

benjaminsmith wrote:HI @askewdread

I think there's a chance you may have multiple Nagios processes running, so let's stop and restart nagios, and the run pre-flight check on your configuarion files.

Stop Nagios, kill all process and a restart:

Code: Select all

service nagios stop
service ndo2db stop
killall -9 nagios
Check your configurations files for errors:

Code: Select all

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
If there are no errors, restart Nagios:

Code: Select all

service ndo2db start
service nagios start
If you're getting any errors, please try to correct those files and restart or post the errors to the forum for us to review.
sadly still getting the same error as before:

Code: Select all

Error: Could not find any hostgroup matching 'sccm-exec-service-2008r2' (config file '/usr/local/nagios/etc/services/SCCM_PXE_Config.cfg', starting on line 36)
and that file still doesn't exist (its not supposed to exist either)

[root@dnzbsglnx10 ~]# ls -lah /usr/local/nagios/etc/services/SCCM_PXE_Config.cfg
ls: cannot access /usr/local/nagios/etc/services/SCCM_PXE_Config.cfg: No such file or directory
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Error: Could not find any hostgroup matching

Post by lmiltchev »

Do you have a hostgroup, named 'sccm-exec-service-2008r2'? What is the output of the following commands?

Code: Select all

grep -R -i 'sccm-exec-service-2008r2' /usr/local/nagios/etc/hosts /usr/local/nagios/etc/services
grep -i 'sccm-exec-service-2008r2' /usr/local/nagios/etc/hostgroups.cfg
Be sure to check out our Knowledgebase for helpful articles and solutions!
askewdread
Posts: 69
Joined: Wed Nov 16, 2016 4:54 pm

Re: Error: Could not find any hostgroup matching

Post by askewdread »

lmiltchev wrote:Do you have a hostgroup, named 'sccm-exec-service-2008r2'? What is the output of the following commands?

Code: Select all

grep -R -i 'sccm-exec-service-2008r2' /usr/local/nagios/etc/hosts /usr/local/nagios/etc/services
grep -i 'sccm-exec-service-2008r2' /usr/local/nagios/etc/hostgroups.cfg
we used to... havent had for a while though

i did try recreating it when we got this error to try fix it, but didnt change it

Code: Select all

[root@dnzbsglnx10 ~]# grep -R -i 'sccm-exec-service-2008r2' /usr/local/nagios/etc/hosts /usr/local/nagios/etc/services
[root@dnzbsglnx10 ~]# grep -i 'sccm-exec-service-2008r2' /usr/local/nagios/etc/hostgroups.cfg
[root@dnzbsglnx10 ~]#
[root@dnzbsglnx10 ~]#
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Error: Could not find any hostgroup matching

Post by scottwilkerson »

Can you verify there are not any files in this directory

Code: Select all

ll /usr/local/nagios/etc/import/
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
askewdread
Posts: 69
Joined: Wed Nov 16, 2016 4:54 pm

Re: Error: Could not find any hostgroup matching

Post by askewdread »

scottwilkerson wrote:Can you verify there are not any files in this directory

Code: Select all

ll /usr/local/nagios/etc/import/

interesting....

for some reason there was 2 files in there, neither of which had anything about that file or hostgroup, but after removing those i am now able to apply the config.... how odd
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Error: Could not find any hostgroup matching

Post by scottwilkerson »

I think the error that was being displayed was from a previous problem and was stuck in a log. I have seen this in the past, were erroneous import files cause the config to not apply, and then it displays an error from a previous attempt before rolling back the configuration.

I'm glad you were able to successfully apply the configuration now.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
askewdread
Posts: 69
Joined: Wed Nov 16, 2016 4:54 pm

Re: Error: Could not find any hostgroup matching

Post by askewdread »

scottwilkerson wrote:I think the error that was being displayed was from a previous problem and was stuck in a log. I have seen this in the past, were erroneous import files cause the config to not apply, and then it displays an error from a previous attempt before rolling back the configuration.

I'm glad you were able to successfully apply the configuration now.
ah yup, those import files defiantly weren't very well done, not sure where they came from

thanks for the help :)
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Error: Could not find any hostgroup matching

Post by scottwilkerson »

No problem..

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