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

[dev.icinga.com #11332] Support dependencies #132

Closed
icinga-migration opened this issue Mar 8, 2016 · 35 comments
Closed

[dev.icinga.com #11332] Support dependencies #132

icinga-migration opened this issue Mar 8, 2016 · 35 comments
Assignees
Milestone

Comments

@icinga-migration
Copy link

This issue has been migrated from Redmine: https://dev.icinga.com/issues/11332

Created by tgelf on 2016-03-08 16:24:01 +00:00

Assignee: (none)
Status: New
Target Version: (none)
Last Update: 2016-11-30 09:00:58 +00:00 (in Redmine)


They have been forgotten...

Changesets

2016-12-29 22:07:12 +00:00 by mdetrano cb6f04c

Implement Icinga Dependency Configuration

refs #11332

Relations:

@icinga-migration
Copy link
Author

Updated by mdetrano on 2016-06-10 19:59:10 +00:00

Has work started or is it planned for implementing dependency configuration in Director? If not, would you like some help? Seems to me they would follow the same general pattern for Services or Notification objects. For us, this is an important feature (especially for implementing host-reachability logic).

@icinga-migration
Copy link
Author

Updated by tgelf on 2016-06-17 23:04:20 +00:00

Not scheduled yet, I'd of course love to see this implemented. Shouldn't be that complicated, and yes, it should basically follow the existing patterns. In case you want to give it a try, help is always appreciated. Otherwise, it will for sure arrive sooner or later - it's just a matter of priorities.

Best,
Thomas

@icinga-migration
Copy link
Author

Updated by mdetrano on 2016-06-21 22:50:08 +00:00

I have got much of the feature working in a local git branch (a good start,anyhow). If my github user (mdetrano or marc@gridshield.net) can get access to the remote I'd like to push the branch up for further review, testing, and merge if it looks ok.

Works a lot like "Services", except Dependencies can themselves be added to a service (works for service on host, service on host template, a service template, or a service apply rule). Dependency templates and apply rules can also be created independent of specific host or service objects (as is done with Services).

@icinga-migration
Copy link
Author

Updated by tgelf on 2016-06-23 08:26:17 +00:00

Just fork Director on Github (single click), that gives you a full clone with all permissions in your namespace. Then push your changes to a dedicated branch there and send me a pull request. That's the easiest way to review them together I guess.

Thanks,
Thomas

@icinga-migration
Copy link
Author

Updated by tgelf on 2016-08-24 14:41:44 +00:00

  • Duplicated set to 11788

@icinga-migration
Copy link
Author

Updated by dgoetz on 2016-09-05 09:04:39 +00:00

While it is easy to get them deployed in addtion to the Director provided config, adding them would be great. ;-)

@icinga-migration
Copy link
Author

Updated by tgelf on 2016-10-24 03:58:12 +00:00

  • Target Version set to 1.2.0

@icinga-migration
Copy link
Author

Updated by tgelf on 2016-11-03 12:43:21 +00:00

  • Target Version changed from 1.2.0 to 1.3.0

@icinga-migration
Copy link
Author

Updated by tgelf on 2016-11-30 09:00:58 +00:00

  • Target Version deleted 1.3.0

@Links2004
Copy link

any news on this?
its impossible to user nagvis automap without the parents / hostdependency.

@melaniebauer
Copy link

I would also appreciate news on this, we need this feature...

@Hipska
Copy link

Hipska commented May 10, 2017

Ping @Thomas-Gelf and @mdetrano

@dheule
Copy link

dheule commented May 10, 2017

For us, this is a necessary condition, please increase the priority

@mdetrano
Copy link
Contributor

The latest update to the pull request should allow that branch to merge cleanly with latest Director.

#39

..for anyone who'd like to test it out. As for the issue of it being slow...I've used this in a ~1500 host system and it seems ok for a system of that size. Ultimately, a new form component may be needed to more dynamically allow for host/service lookups so that things remain smooth on huge systems as well.

@ghost
Copy link

ghost commented Jun 1, 2017

@mdetrano Hi, if you don't mind, could you please tell me how to test the dependencies in Director? I actually downloaded this - https://github.com/Icinga/icingaweb2-module-director/tree/5e8361d55b4c0d1e7a049a7251d7c2c6eda23d04 and checked the icingaweb2 interface but looks the same. I thought maybe some menus would be added into director. I could see dependency option has been added in icingacli director command though.

I am actually a total novice with this GitHub so need a bit of help regarding test. If you could show me how to a bit more, I'd really appreciate it. Thanks again.

@mdetrano
Copy link
Contributor

mdetrano commented Jun 2, 2017 via email

@ghost
Copy link

ghost commented Jun 4, 2017

@mdetrano Thanks a lot, I'll have a try again. Cheers.

@ghost
Copy link

ghost commented Jun 4, 2017

@mdetrano Hi, I just made a change as you said and I can see the new menu in director. Really appreciate it. However, when I test the dependency it doesn't look working well. I expected the notification for child host should not arrive when parent host is down. But I am receiving notifications for both hosts. I made dependency configuration like below:

zones.d/director-global/dependency_apply.conf
apply Dependency "host-dependency" to Host {
disable_checks = true
disable_notifications = true
ignore_soft_states = false
assign where host.vars.parent != ""
}

And I created a test host with the following setting:

zones.d/master/hosts.conf
object Host "TESTHOST.TEST.LAB" {
display_name = "Dependency test host"
address = "10.10.10.1"
check_command = "hostalive"
max_check_attempts = "3"
check_period = "24x7-timeperiod"
check_interval = 1m
retry_interval = 30s
enable_notifications = true
zone = "master"
vars.notification_icingaweb2url = "http://ip_address/icingaweb2"
vars.notification_level = "1"
vars.notification_method = "email"
vars.notification_number = "$notification.notification_number$"
vars.parent = "parenthost"
}

If I am missing something, could you please advise regarding this? Sorry for bothering you.

@mdetrano
Copy link
Contributor

mdetrano commented Jun 6, 2017

@eoinkim , One way to verify the dependency was actually created is to use the commandline interface of icinga2:

Example:

icinga2 object list --type dependency --name "host-dependency"

should show your dependency (after you deploy it from Director).

If that dependency is in fact there, and has the fields as configured...then the problem you are having is an Icinga issue. If its not there, then something strange is happening and the object is not making it from Director to you configuration.

@ghost
Copy link

ghost commented Jun 6, 2017

@mdetrano Thanks. I was considering using director web interface only. But I found that using command is a bit necessary. Yes, I checked if the dependency shows up via the command line and it does. Thanks again. Cheers.

@odrino14
Copy link

odrino14 commented Jun 13, 2017

i am trying Dependencies but i am not getting how this is working.
i create a object Dependency
`
zones.d/master/dependencys.conf

object Dependency "host-dependency" {
parent_host = "webserver"
child_host_name = "test-dependency"
disable_checks = true
disable_notifications = false
ignore_soft_states = false
period = "24x7_director"
states = [ Up ]
}
`
i have not output on my host
how can i use this ?
thx
Edit: I don't have any Services for dependency

@ghost
Copy link

ghost commented Jun 13, 2017

@odrino14 Hi mate, I think you need apply rule to see the effect. Have you created any apply rules?

@odrino14
Copy link

Hi @eoinkim,
I found how to create an apply rules? and istworking but just for Host and it i can't see it in icingaweb2 just wenn i run the cli-Command.
I can't make Service Dependency. the field Parent Service is missing.

@ghost
Copy link

ghost commented Jun 14, 2017

@odrino14 Sorry mate, I am also in learning phase of this so can't help you much. Maybe you can ask @mdetrano about this. Cheers.

@mdetrano
Copy link
Contributor

@odrino14 , the field parent_service should appear on the form after selecting a parent_host (the list is populated after the system knows which host to list services for). Did this not happen?

@odrino14
Copy link

@mdetrano , no it is not working. i just have parent_host even if i choose one.
it is possible to see dependencies in icingaweb2 like classic ui not just with
the Iicnga2 cli ?

@mdetrano
Copy link
Contributor

@odrino14
As far as I know, web2 doesn't have anything for showing dependencies..but if you're familiar with Nagvis you can set something up with automaps and a host "shared navigation" item.

I am not sure why the services won't display..how do you define services for the hosts? directly, via a host template, or via Apply rules (apply rule generated services may not be presented in the list).

@scavara
Copy link

scavara commented Jun 22, 2017

@mdetrano ,
you wrote: "Support for the database changes is only present in the mysql version of the schema script: /usr/share/icingaweb2/modules/director/schema/mysql.sql. If you are having issues you may want to verify that the tables icinga_dependency , icinga_dependency_inheritance , and icinga_dependency_states_set have been created in your Director DB. The "upgrade_dependencies.sql" file under mysql-migrations may help get those added if they are not yet there."
I would like to try out the Feature_11332_Support_Dependencies_20161118 but I guess me using postgresql is a showstopper?

Btw, I hope that your #39 will be accepted soon.

@odrino14
Copy link

@mdetrano ,
Thanks! i will take a look at it...i define services via Apply rules

@cflinspach
Copy link

cd /usr/share/icingaweb2/modules
git clone https://github.com/Icinga/icingaweb2-module-director.git director
cd director/
git remote add mdetrano
https://github.com/mdetrano/icingaweb2-module-director.git
git fetch mdetrano
git merge Feature_11332_Support_Dependencies_20161118

@mdetrano I tried following these instructions but I don't see any new menu item, and actually lost the first row of icons on the Director dashboard. My director DB is missing the tables too. I switched to the latest from icinga/icingaweb2-module-director after seeing #28 and #39 but still no dependencies, even after trying the upgrades from mysql-migrations.

schema

director_module

startup_log

@mdetrano
Copy link
Contributor

It's possible there have been some updates upstream and that branch is no longer merge-able. I'll try to check on it soon.

Another issue I can see cropping up in the discussion here...linking services. Hosts are so much easier because you know you have a host-name to work with...services can be setup in so many different ways, and when it comes to apply rules, and especially apply-for rules, determining the service name may not be practical from the Director database. It may be better to lose the fixed-link back to a configured service and simply make the service an editable field. Or , I could allow some combination of bother.

@cflinspach
Copy link

@mdetrano Aren't the services already linked to their hosts?

@mdetrano
Copy link
Contributor

Since there had been quite a bit of updates upstream, I created a completely updated branch and submitted a new pull request for this feature.

I was able to handle some of the issues that have been brought up here...faster form loads, using services that are "applied" to a host for child or parent relations, and using the "same host" ability for Dependencies setup via Apply rules.

Again, for anyone who wants to test it out, here is an example of how to merge in the changes:

cd /usr/share/icingaweb2/modules
git clone https://github.com/Icinga/icingaweb2-module-director.git director
cd director/
git remote add mdetrano https://github.com/mdetrano/icingaweb2-module-director.git
git fetch mdetrano
git merge Feature_11332_Support_Dependencies

There are a couple of sql scripts to manually update the database (mysql only...if someone can port this to Postgresql, that would be great).

schema/mysql-migrations/upgrade_dependencies.sql
then
schema/mysql-migrations/upgrade_dependencies_2.sql

@Thomas-Gelf Thomas-Gelf self-assigned this Sep 28, 2017
@Thomas-Gelf Thomas-Gelf added this to the 1.4.0 milestone Sep 28, 2017
@Thomas-Gelf
Copy link
Contributor

This has been merged to master, still flagged "experimental". For those who already have been experimenting with this branch: please drop dependency-related tables before applying the new migrations. They slightly differ from the former feature branch.

@Thomas-Gelf
Copy link
Contributor

@mdetrano: thanks a lot for the hard work. It would be great if you could check whether everything still works as expected in the current master. I disabled "single dependency objects" for now, only templates and apply rules are allowed - but that should suffice for most users. Some constraints are now "hard", you are no longer allowed to remove parents being used by dependency rules. Deleting childs is fine and will also silently drop related dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants