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 #11982] Allow admins to define global Icinga 2 functions #291

Open
icinga-migration opened this issue Jun 17, 2016 · 4 comments

Comments

@icinga-migration
Copy link

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

Created by tgelf on 2016-06-17 19:02:19 +00:00

Assignee: (none)
Status: New
Target Version: (none)
Last Update: 2016-06-17 19:02:19 +00:00 (in Redmine)


I'd love to make Icinga 2 functions first class citizens in the Director. This would involve a new table storing them, with related information to required parameters and their data type. Would allow for vars.bla = voodoo(), while still completely hiding this complexity from the "end user".


Relations:

@icinga-migration
Copy link
Author

Updated by tgelf on 2016-10-13 12:26:06 +00:00

  • Relates set to 12770

@icinga-migration
Copy link
Author

Updated by tgelf on 2016-11-29 07:45:33 +00:00

  • Relates set to 13353

@Tontonitch
Copy link

Could be a solution for me, as explained there https://monitoring-portal.org/index.php?thread/39813-how-to-use-a-host-attribute-value-as-the-default-for-the-corresponding-service-a/

template Service "generic-service" {
  [...]
  if (host.check_period != "") {    check_period = host.check_period  }
  [...]
}

==> replaced by a function
check_period=hostdefined(check_period)

So it would return the value defined for the host, or return the value defined on the service side (provided by a template for example)

template Service "generic-service" {
  [...]
  check_period=hostdefined(check_period)
  [...]
}

@friesoft
Copy link
Contributor

friesoft commented Nov 2, 2017

Is this planned for the near future? :)

Our current usecase involves calling functions from the Icinga2 DSL (e.g. Array#join).
See: https://monitoring-portal.org/index.php?thread/40056-check-logfiles-configuration-by-commandline-using-icinga-director/

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

3 participants