-
Notifications
You must be signed in to change notification settings - Fork 579
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 #13933] new function get_services(host_name) #4912
Comments
Updated by mfriedrich on 2017-01-11 16:57:02 00:00
|
Updated by mfriedrich on 2017-01-11 17:09:28 00:00 If you want to start on a patch, look into lib/base/scriptutils.cpp and how "get_objects" is implemented. You'll then need to figure out whether the given host_name string translates into an actual Host object. Calling host->GetServices() and then adding that as a result set. |
1 for this. I'm currently using something like this:
which looks hacky and getting all our 50k services and then filtering down to the 30 services for the host does not make much sense. We think it's basically exposing |
The main problem is that Host::GetServices() is located in libicinga, where libbase cannot link against. So there are specific script functions for libicinga required (correct me if I am wrong @gunnarbeutner :)). |
I don't see a problem with adding a script function in lib/icinga/host.cpp or lib/icinga/objectutils.cpp. |
Draft: edit: obsolete.
|
|
…t for get_service() This includes some debug console examples too which involve advanced map() and filter examples for better readability. refs #4912
works perfectly, thank you @dnsmichi |
This issue has been migrated from Redmine: https://dev.icinga.com/issues/13933
Created by KurdBahr on 2017-01-10 16:24:27 00:00
Assignee: (none)
Status: New
Target Version: Backlog
Last Update: 2017-01-11 17:09:28 00:00 (in Redmine)
To get all services that are currently assigned to a host a new function get_services(host_name) would be useful.
This should be more efficient than iterating over all services returned by get_objects(Service) and checking the host_name.
The text was updated successfully, but these errors were encountered: