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 #7187] Document how to use multiple assign/ignore statements with logical "and" & "or" #1972

Closed
icinga-migration opened this issue Sep 11, 2014 · 10 comments
Labels
area/documentation End-user or developer help enhancement New feature or request
Milestone

Comments

@icinga-migration
Copy link

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

Created by arcade on 2014-09-11 11:38:07 +00:00

Assignee: mfriedrich
Status: Resolved (closed on 2014-11-07 03:20:05 +00:00)
Target Version: 2.2.0
Last Update: 2014-11-07 03:20:05 +00:00 (in Redmine)


It would be nice if there"s a short description and example how to use multiple assign/ignore statements with different operators like "&&" or "||". Something like this:

apply Notification "default" to Host {

        import "host-notification"

        user_groups                     = [ "icingaadmins" ]

        assign where host.vars.sla == "24x7" && host.vars.os == "Linux"
        assign where service.vars.sla == "24x7" || service.vars.webserver == "Apache"
}

Attachments

Changesets

2014-11-07 03:13:45 +00:00 by (unknown) c1f4d22

Documentation: Better apply rule best practice in monitoring basics

fixes #7480
fixes #7543
fixes #7187
fixes #7573
@icinga-migration
Copy link
Author

Updated by mfriedrich on 2014-09-16 09:22:23 +00:00

  • Project changed from 42 to Icinga 2
  • Category set to Documentation

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2014-10-11 17:39:34 +00:00

Would be nice if you could edit the documentation yourself and send a git patch :)

@icinga-migration
Copy link
Author

Updated by arcade on 2014-10-13 06:42:18 +00:00

Yes ouf course, never did that before, but i"ll try.

@icinga-migration
Copy link
Author

Updated by arcade on 2014-10-13 09:05:02 +00:00

  • File added 0001-Document-how-to-use-multiple-assign-ignore-statement.patch

Would be nice if you could have a look. Any inputs how to improve are welcome.

@icinga-migration
Copy link
Author

Updated by kruisdraad on 2014-10-27 16:21:42 +00:00

e.g. : assign where host.vars.check_https_enabled == true && host.vars.check_https_certificate_enabled != false

explained: everywhere where https is checks ill be checking the certificate too, unless the host as explicit set that this shouldn"t be done

note: adding a ignore where does not work

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2014-11-04 16:54:59 +00:00

Similar how to check if variables are defined or not (boolean expression)

assign where host.vars.check_http && !host.vars.ssl

@icinga-migration
Copy link
Author

Updated by jeronimo on 2014-11-04 18:10:55 +00:00

Similarly document what happens with two or more assign clauses (they form a logical OR from what I have seen)

assign where exp1
assign where exp2

means

assign where exp1 || exp2

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2014-11-07 02:08:16 +00:00

  • Status changed from New to Assigned
  • Target Version set to 2.2.0

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2014-11-07 02:08:36 +00:00

  • Assigned to set to mfriedrich
  • Estimated Hours set to 2

@icinga-migration
Copy link
Author

Updated by Anonymous on 2014-11-07 03:20:05 +00:00

  • Status changed from Assigned to Resolved
  • Done % changed from 0 to 100

Applied in changeset c1f4d22.

@icinga-migration icinga-migration added enhancement New feature or request area/documentation End-user or developer help labels Jan 17, 2017
@icinga-migration icinga-migration added this to the 2.2.0 milestone Jan 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/documentation End-user or developer help enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant