Nagios Host has 3 services even though .cfg specifies none

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
JBashir
Posts: 4
Joined: Thu Oct 17, 2019 11:51 am

Nagios Host has 3 services even though .cfg specifies none

Post by JBashir »

Hi im having a strange issue where my nagios is monitoring 3 services on a host with no services specified in the cfg file.
I have tried deleting and recreating the .cfg file from scratch yet this issue persists no matter what i change. Any ideas or help would be greatly appreciated.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios Host has 3 services even though .cfg specifies no

Post by scottwilkerson »

This can happen if you have the host assigned to a hostgroup AND you have that hostgroup attached to service definitions.

When you attach hostgroups to service definitions ALL of the hosts in the hostgroup get those services added
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
JBashir
Posts: 4
Joined: Thu Oct 17, 2019 11:51 am

Re: Nagios Host has 3 services even though .cfg specifies no

Post by JBashir »

scottwilkerson wrote:This can happen if you have the host assigned to a hostgroup AND you have that hostgroup attached to service definitions.

When you attach hostgroups to service definitions ALL of the hosts in the hostgroup get those services added
I looked and im not seeing where my hostgroups are defined im reading that there should be a hostgroups.cfg in nagios/etc but mine doesnt appear to have that
JBashir
Posts: 4
Joined: Thu Oct 17, 2019 11:51 am

Re: Nagios Host has 3 services even though .cfg specifies no

Post by JBashir »

JBashir wrote:
scottwilkerson wrote:This can happen if you have the host assigned to a hostgroup AND you have that hostgroup attached to service definitions.

When you attach hostgroups to service definitions ALL of the hosts in the hostgroup get those services added
I looked and im not seeing where my hostgroups are defined im reading that there should be a hostgroups.cfg in nagios/etc but mine doesnt appear to have that
I did some more digging and saw that other hosts are in the same hostgroup but do not have any services
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios Host has 3 services even though .cfg specifies no

Post by scottwilkerson »

Can you grep your config directory for the service name to find all the locations it is defined and look at those service definitions?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
JBashir
Posts: 4
Joined: Thu Oct 17, 2019 11:51 am

Re: Nagios Host has 3 services even though .cfg specifies no

Post by JBashir »

scottwilkerson wrote:Can you grep your config directory for the service name to find all the locations it is defined and look at those service definitions?
ah thank you i did that and found it sitting in another cfg file (for another random host) that defined it and when i took it out of there my error disappeared thank you very much!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios Host has 3 services even though .cfg specifies no

Post by scottwilkerson »

JBashir wrote:
scottwilkerson wrote:Can you grep your config directory for the service name to find all the locations it is defined and look at those service definitions?
ah thank you i did that and found it sitting in another cfg file (for another random host) that defined it and when i took it out of there my error disappeared thank you very much!
Great! Glad it is resolved

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