Page 1 of 1

Nagios Config Error after define service escalation

Posted: Tue Jun 26, 2018 9:07 am
by ttsvetanov
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.

Re: Nagios Config Error after define service escalation

Posted: Tue Jun 26, 2018 9:12 am
by scottwilkerson
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
ttsvetanov 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
}
but your service definition excluded that host
ttsvetanov 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
}
So you have an escalation for a host/service combination that doesn't exist

Re: Nagios Config Error after define service escalation

Posted: Wed Jul 04, 2018 6:50 am
by ttsvetanov
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).

Re: Nagios Config Error after define service escalation

Posted: Thu Jul 05, 2018 9:34 am
by scottwilkerson
I'm pretty sure you can add the exclusion to the serviceescalation definition too

Re: Nagios Config Error after define service escalation

Posted: Fri Jul 06, 2018 1:41 am
by ttsvetanov
Yes, this is the solution :) Thank you so much!

Re: Nagios Config Error after define service escalation

Posted: Fri Jul 06, 2018 9:17 am
by tmcdonald
Glad to hear it! Did you have further (related) questions or are we good to lock this up?

Re: Nagios Config Error after define service escalation

Posted: Mon Jul 09, 2018 1:22 am
by ttsvetanov
No, i don't have any related questions for now, it's ok to lock it up.