Hi to all!
I have the following defined service escalation:
define hostescalation{
# host_name host_name
hostgroup_name my_group
# contacts contacts
contact_groups test_escalation
first_notification 3
last_notification 6
notification_interval 30
# escalation_period timeperiod_name
# escalation_options [d,u,r]
}
define serviceescalation{
# hostgroup_name my_service_group
hostgroup_name my_group
service_description PI Video , PING
contact_groups test_escalation
first_notification 3
last_notification 6
notification_interval 30
}
define servicegroup{
servicegroup_name my_service_group
alias alias
# members services
# servicegroup_members servicegroups
# notes note_string
# notes_url url
# action_url url
}
And the following service define:
define service{
use test_pi_service
hostgroup_name my_group_group
host_name !random_host
service_description PI Video
check_command check_raspi_v1.01
max_check_attempts 5
normal_check_interval 5
retry_check_interval 5
notifications_enabled 1
servicegroups my_service_group
}
The problem is when i define the service escallation, it returns me the following error:
Reading configuration data...
Read main config file okay...
Error: Could not find a service matching host name 'pb-153-1_10.22.66.10' and description 'PI Video' (config file '/usr/local/nagios/etc/under_support/myconfig.cfg', starting on line 78)
Error processing object config files!
This happened when i decided to exclude some hosts from service check with "!" in host_name of service definition. When i comment the service escalation is working fine.
Any advice? Thank you.
Nagios Config Error after define service escalation
-
- Posts: 13
- Joined: Tue Jun 26, 2018 8:46 am
Nagios Config Error after define service escalation
Last edited by ttsvetanov on Tue Jun 26, 2018 9:42 am, edited 1 time in total.
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Nagios Config Error after define service escalation
EDIT: The below was copied before the post above was edited
My guess is that the hostgroup in this definition contains the host pb-153-1_10.22.66.10
My guess is that the hostgroup in this definition contains the host pb-153-1_10.22.66.10
but your service definition excluded that hostttsvetanov wrote:Code: Select all
define serviceescalation{ # hostgroup_name my_service_group hostgroup_name my_group service_description PI Video , PING contact_groups parallel_escalation first_notification 3 last_notification 6 notification_interval 30 }
So you have an escalation for a host/service combination that doesn't existttsvetanov wrote:Code: Select all
define service{ use postbank_pi_service hostgroup_name 5_postbank_group host_name !pb-153-1_10.22.66.10 service_description PI Video check_command check_raspi_v1.01 max_check_attempts 5 normal_check_interval 5 retry_check_interval 5 notifications_enabled 1 servicegroups postbank_service_group }
-
- Posts: 13
- Joined: Tue Jun 26, 2018 8:46 am
Re: Nagios Config Error after define service escalation
Yes, maybe this is the problem, so is there an solution for this? I just dont want for all devices this service check. They are 200+, so the easiest way is to define service for hostgroup instead defining hosts one by one. That's why i want to use excluding(because they are 10-15 devices).
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Nagios Config Error after define service escalation
I'm pretty sure you can add the exclusion to the serviceescalation definition too
-
- Posts: 13
- Joined: Tue Jun 26, 2018 8:46 am
Re: Nagios Config Error after define service escalation
Yes, this is the solution Thank you so much!
Re: Nagios Config Error after define service escalation
Glad to hear it! Did you have further (related) questions or are we good to lock this up?
Former Nagios employee
-
- Posts: 13
- Joined: Tue Jun 26, 2018 8:46 am
Re: Nagios Config Error after define service escalation
No, i don't have any related questions for now, it's ok to lock it up.