Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inherit more service attributes from its host #83

Closed
julianbrost opened this issue Aug 4, 2014 · 7 comments
Closed

Inherit more service attributes from its host #83

julianbrost opened this issue Aug 4, 2014 · 7 comments

Comments

@julianbrost
Copy link
Contributor

Currently only the attributes contact_groups, notification_interval and notification_period of a service are inherited from the corresponding host, see http://www.naemon.org/documentation/usersguide/objectinheritance.html#implied_inheritance

I'd like to see the same behavior for some other attributes too, in my case I need this for check_period as I monitor some services on many hosts where only some are turned off at night and currently I have to duplicate the service definitions for them which seems unnecessary.

Implementing this shouldn't break any existing setups as having no check_period specified in a service is not allowed at the moment. If you give me some hints on where to look at the source code, I'd be willing to work on a patch.

@sni
Copy link
Contributor

sni commented Aug 4, 2014

notification_period inheritance happens in naemon/xodtemplate.c:3497

@julianbrost
Copy link
Contributor Author

This actually seems to be pretty simple. I'm about to test it with my installation and if everything works fine, I'll submit a pull request.

I would add the same inheritance for check_interval, check_period and retry_interval. Are there any other attributes where this might be useful?

@sni
Copy link
Contributor

sni commented Aug 5, 2014

i guess thats it. According to http://www.naemon.org/documentation/usersguide/objectdefinitions.html#host_definition i'd say the others don't make sense.

@ageric
Copy link
Contributor

ageric commented Aug 7, 2014

On 2014-08-05 16:01, Julian wrote:

This actually seems to be pretty simple. I'm about to test it with my
installation and if everything works fine, I'll submit a pull
request.

I would add the same inheritance for check_interval, check_period
and retry_interval. Are there any other attributes where this might
be useful?

Please don't do it for check_interval and retry_interval. check_period
makes a lot of sense, but having different intervals on hosts and
services also does, and currently check_interval defaults to 5 and
retry_interval to 1. Changing it so these parameters are inherited by
the hosts may break people's existing setups.

/Andreas

@julianbrost
Copy link
Contributor Author

My patched version works fine so far (and my configuration got a lot simpler).

I'm not quite sure about check_interval and retry_interval. I can't think of a situation where one might need this, but on the other hand maybe someone thought the same when implementing this for the other three attributes. But if this would break backwards compatibility, I don't want to spend too much time on this.

So you'll probably see a pull request for check_period and the according documentation changes in the next few days.

@julianbrost
Copy link
Contributor Author

ageric added a commit that referenced this issue Sep 15, 2014
[#83] Inherit service check period from host
@sni sni closed this as completed Sep 15, 2014
@sni
Copy link
Contributor

sni commented Sep 15, 2014

thanks

op5-ci-user pushed a commit that referenced this issue Mar 15, 2018
…d-host_notification_commands to master

* commit '0f72e209ad2b33687d012aa68355248967d5a1ee':
  Fix flake8 errors and simplify assert
  Fix segfault on invalid host_notification_commands
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants