Nagios Config Error after define service escalation

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
ttsvetanov
Posts: 13
Joined: Tue Jun 26, 2018 8:46 am

Nagios Config Error after define service escalation

Post 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.
Last edited by ttsvetanov on Tue Jun 26, 2018 9:42 am, edited 1 time in total.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios Config Error after define service escalation

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
ttsvetanov
Posts: 13
Joined: Tue Jun 26, 2018 8:46 am

Re: Nagios Config Error after define service escalation

Post 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).
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios Config Error after define service escalation

Post by scottwilkerson »

I'm pretty sure you can add the exclusion to the serviceescalation definition too
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
ttsvetanov
Posts: 13
Joined: Tue Jun 26, 2018 8:46 am

Re: Nagios Config Error after define service escalation

Post by ttsvetanov »

Yes, this is the solution :) Thank you so much!
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Nagios Config Error after define service escalation

Post by tmcdonald »

Glad to hear it! Did you have further (related) questions or are we good to lock this up?
Former Nagios employee
ttsvetanov
Posts: 13
Joined: Tue Jun 26, 2018 8:46 am

Re: Nagios Config Error after define service escalation

Post by ttsvetanov »

No, i don't have any related questions for now, it's ok to lock it up.
Locked