unable to remove service check from Nagios

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.
Post Reply
Pratapa
Posts: 144
Joined: Tue Oct 01, 2019 1:33 am

unable to remove service check from Nagios

Post by Pratapa »

Hi,

We are using Nagios core 4.4.4

We need to remove a service check "SAN Device Backup" . Its hostname is dc2aldc08a.

Service definition is as follows :

define service{
service_description SAN Device Backup
use cisco-service
hostgroups CISCO SAN
check_command Backup-Cisco-SAN
max_check_attempts 3
retry_interval 10
check_interval 1440
}

I removed host dc2aldc08a from the hostgroup CISCO SAN and ran sanity check. But we are getting error.

Error: Could not find any host matching '#dc2aldc08a' (config file /usr/local/nagios/etc/objects/hostgroups.cfg starting on line 400
Error : Could not expand members specified in the hostgroup (config file '/usr/local/nagios/etc/objects/hostgroups.cfg' starting on line 400

What could be the reason.
kg2857
Posts: 237
Joined: Wed Apr 12, 2023 5:48 pm

Re: unable to remove service check from Nagios

Post by kg2857 »

What's that # character in the error message?
Maybe post the hostgroup here.
Pratapa
Posts: 144
Joined: Tue Oct 01, 2019 1:33 am

Re: unable to remove service check from Nagios

Post by Pratapa »

I commented the host in the hostgroup file using # at the beginning of the hostname.
#dc2ald08a
kg2857
Posts: 237
Joined: Wed Apr 12, 2023 5:48 pm

Re: unable to remove service check from Nagios

Post by kg2857 »

That's the problem.
Feativill
Posts: 6
Joined: Mon Jul 03, 2023 3:42 am

Re: unable to remove service check from Nagios

Post by Feativill »

Nagios provides several built-in tools to help with configuration debugging. For example, you can use the Nagios configuration verification tool (nagios -v /path/to/nagios.cfg) to check for any syntax errors or configuration problems. Additionally, the Nagios web interface may provide further details about the error if you navigate to the specific host or service definition.
[align=right]splatoon 3[/align]
User avatar
swolf
Developer
Posts: 302
Joined: Tue Jun 06, 2017 9:48 am

Re: unable to remove service check from Nagios

Post by swolf »

Hi @Pratapa, thanks for reaching out.

I agree with @kg2857. You will need to actually remove the hostname from the listing, not just use a pound sign. There are ways to use comments in Nagios Core, but for this change, I would leave the information on a separate line, instead of trying to leave a comment inside the hostgroup definition.

Please let me know if that helps or if you have any further questions or concerns.

-Sebastian Wolf
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy
Post Reply