Page 1 of 1

Error: Could not find any hostgroup matching

Posted: Sun Nov 18, 2018 12:53 pm
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

Re: Error: Could not find any hostgroup matching

Posted: Mon Nov 19, 2018 11:21 am
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.

Re: Error: Could not find any hostgroup matching

Posted: Mon Nov 19, 2018 12:21 pm
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

Re: Error: Could not find any hostgroup matching

Posted: Mon Nov 19, 2018 2:07 pm
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

Re: Error: Could not find any hostgroup matching

Posted: Mon Nov 19, 2018 2:16 pm
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 ~]#

Re: Error: Could not find any hostgroup matching

Posted: Mon Nov 19, 2018 2:27 pm
by scottwilkerson
Can you verify there are not any files in this directory

Code: Select all

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

Re: Error: Could not find any hostgroup matching

Posted: Mon Nov 19, 2018 2:41 pm
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

Re: Error: Could not find any hostgroup matching

Posted: Mon Nov 19, 2018 3:01 pm
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.

Re: Error: Could not find any hostgroup matching

Posted: Mon Nov 19, 2018 3:31 pm
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 :)

Re: Error: Could not find any hostgroup matching

Posted: Mon Nov 19, 2018 3:39 pm
by scottwilkerson
No problem..

Locking thread