Could not find any hostgroup matching 'general-servers'

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.
Wnt2bsleepin
Posts: 21
Joined: Wed Sep 18, 2013 3:22 pm

Re: Could not find any hostgroup matching 'general-servers'

Post by Wnt2bsleepin »

OK, I defined my hostgroups. The instructions never told me to do that saying they would be generated anyway. My mistake. Sanity check still fails with

Code: Select all

Processing object config file '/etc/nagios/conf.d/services_nagios2.cfg'...
Error: Could not expand hostgroups and/or hosts specified in service (config file '/etc/nagios/conf.d/services_nagios2.cfg', starting on line 42)
Error processing object config files!

Here are the contents of services_nagios2.cfg

Code: Select all

# NRPE Services
define service {
hostgroup_name local-servers
service_description SSH
check_command check_ssh
use generic-service
notification_interval 0
}

define service {
hostgroup_name generic-servers
service_description Current Users NRPE
check_command check_nrpe_1arg!check_users
use generic-service
notification_interval 0
}

define service {
hostgroup_name generic-servers
service_description Current Load NRPE
check_command check_nrpe_1arg!check_load
use generic-service
notification_interval 0
}

define service {
hostgroup_name generic-servers
service_description Disk Space NRPE
check_command check_nrpe_1arg!check_all_disks
use generic-service
notification_interval 0
}

define service {
hostgroup_name generic-servers
service_description Zombie Processes NRPE
check_command check_nrpe_1arg!check_zombie_procs
use generic-service
notification_interval 0
}

define service {
hostgroup_name generic-servers
service_description Total Processes NRPE
check_command check_nrpe_1arg!check_total_procs
use generic-service
notification_interval 0
}
These were taken from the guide.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Could not find any hostgroup matching 'general-servers'

Post by sreinhardt »

If this is still on your nagios server, nrpe configuration is not needed. That should only be done on the remote system running the nrpe agent. Additionally, they should not be included in the nagios core engine configs to load. What guide are you referring to?
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Wnt2bsleepin
Posts: 21
Joined: Wed Sep 18, 2013 3:22 pm

Re: Could not find any hostgroup matching 'general-servers'

Post by Wnt2bsleepin »

I am following this guide. Under a part that says Nagios Server, it mentions that the full list of services would be on the bottom. Should I remove my services_nagios2.cfg? Where do I define how the Nagios server connects to the nrpe servers?
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Could not find any hostgroup matching 'general-servers'

Post by sreinhardt »

Yes, I would definitely suggest removing that file, and any others referencing nrpe commands from the nagios core machine. The basic gist of nrpe is:

Configure nagios server to with remote host and service. Service check is check_nrpe with arguments defining what and how to have remote nrpe daemon execute.
On the remote machine, you have nrpe installed and listening for commands. It also has it's own Core like configurations that define commands available. When your nagios server connects, the agent executes a plugin local to it, and returns the results to the nagios core system.

You never should need nrpe and core on the same machine, and in the same sense, never need nrpe cofigs. Hope that helps clarify some!
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Wnt2bsleepin
Posts: 21
Joined: Wed Sep 18, 2013 3:22 pm

Re: Could not find any hostgroup matching 'general-servers'

Post by Wnt2bsleepin »

That makes things a lot clearer. I also seem to be getting somewhere with my configuration. I ran the sanity check after removing the service config, and it worked well except for one error.

Code: Select all

Processing object config file '/etc/nagios/conf.d/ftb.website.com.cfg'...
   Read object config files okay...

Running pre-flight check on configuration data...

Checking services...
Error: There are no services defined!
	Checked 0 services.
Checking hosts...
Warning: Host 'ftb' has no services associated with it!
Warning: Host 'ftb' has no default contacts or contactgroups defined!
	Checked 1 hosts.
Checking host groups...
	Checked 2 host groups.
Checking service groups...
	Checked 0 service groups.
Checking contacts...
	Checked 1 contacts.
Checking contact groups...
	Checked 1 contact groups.
Checking service escalations...
	Checked 0 service escalations.
Checking service dependencies...
	Checked 0 service dependencies.
Checking host escalations...
	Checked 0 host escalations.
Checking host dependencies...
	Checked 0 host dependencies.
Checking commands...
	Checked 24 commands.
Checking time periods...
	Checked 5 time periods.
Checking for circular paths between hosts...
Checking for circular host and service dependencies...
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...

Total Warnings: 2
Total Errors:   1
Now, I have to define the host information inside the ftb.website.cfg file? I also have to define a service to check the NRPE daemons running on the other machines. I do this using check_nrpe, which would be defined as a service? Do the NRPE daemons require a password to authenticate? Should I just put all this information inside the ftb.website.cfg file? So, it would have the host defined, as well as the services for that host inside one file.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Could not find any hostgroup matching 'general-servers'

Post by abrist »

You can define the services in any file you wish, as long as it is formatted correctly and is included in the nagios.cfg. The organizational structure of your core configs are yours to choose.
Core requires at least 1 host and at least 1 service. So you are really close. Just create at least 1 service check and re-verify.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Wnt2bsleepin
Posts: 21
Joined: Wed Sep 18, 2013 3:22 pm

Re: Could not find any hostgroup matching 'general-servers'

Post by Wnt2bsleepin »

I believe I got it to work for the most part. Thanks for all your help.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Could not find any hostgroup matching 'general-servers'

Post by slansing »

Excellent! Closing for now.
Locked