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.
unable to remove service check from Nagios
Re: unable to remove service check from Nagios
What's that # character in the error message?
Maybe post the hostgroup here.
Maybe post the hostgroup here.
Re: unable to remove service check from Nagios
I commented the host in the hostgroup file using # at the beginning of the hostname.
#dc2ald08a
#dc2ald08a
Re: unable to remove service check from Nagios
That's the problem.
Re: unable to remove service check from Nagios
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]
[align=right]splatoon 3[/align]
Re: unable to remove service check from Nagios
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
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
Developer @ Nagios 2017-05-15 thru 2024-08-06