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

Allow to add nodes based on filter #300

Merged
merged 1 commit into from
Aug 6, 2021

Conversation

ValeDaRold
Copy link
Contributor

This pull request represents a first iteration for solving issue #295 .

Use Case

As a Business Process user, I want to easily add new child hosts/services to an existing business process covering two different scenarios:

  1. when the services check the same thing (have usually the same names) and are on multiple hosts. There can be a great number of hosts with the same check: e.g. Host1;Ping, Host2;Ping, ... Host<N>;Ping
  2. when there are multiple identical services (e.g. Memory, CPU, Network) on multiple host instances of the same type e.g.
esx1;Memory, esx1;CPU, esx1;Network,
esx2;Memory, esx2;CPU, esx2;Network,
esx3;Memory, esx3;CPU, esx3;Network,

Proposed Solution

As agreed with @lippserd, we added two new node types in the AddNodeForm.php:

  1. Host from filter that allows the user to filter hosts with the help of a monitoring filter
  2. Service from filter that allows the user to filter services with the help of a monitoring filter
    Step0

Once the user selects one of these two new node-type entries an input field called Filter and the Next button will appear.
Step1

The user will then insert the monitoring filter and press the button: the list of filtered host/services will populate the children multi-select. The Next button will then change into a Refresh button that allows the user to change the monitoring filter and reload the list of the monitored objects, visible in the multi-select.
Step2

@ValeDaRold ValeDaRold force-pushed the feature/Nodes-based-on-filter branch from 60fd999 to 9b5626c Compare July 29, 2021 15:23
Copy link
Member

@nilmerg nilmerg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Please rebase, the change in module.info shouldn't be necessary
  • The changes in the gettext catalogs have no effect here since Icinga Web 2 v2.8.0

library/Businessprocess/MonitoringRestrictions.php Outdated Show resolved Hide resolved
@nilmerg nilmerg added the enhancement New feature or improvement label Aug 2, 2021
@nilmerg nilmerg added this to the 2.4.0 milestone Aug 2, 2021
@ValeDaRold ValeDaRold force-pushed the feature/Nodes-based-on-filter branch from 9b5626c to 0a01aae Compare August 3, 2021 08:00
ValeDaRold pushed a commit to WuerthPhoenix/icingaweb2-module-businessprocess that referenced this pull request Aug 3, 2021
@ValeDaRold ValeDaRold force-pushed the feature/Nodes-based-on-filter branch from 0a01aae to c7a4c41 Compare August 3, 2021 08:18
ValeDaRold pushed a commit to WuerthPhoenix/icingaweb2-module-businessprocess that referenced this pull request Aug 3, 2021
@ValeDaRold ValeDaRold force-pushed the feature/Nodes-based-on-filter branch from c7a4c41 to d00cf96 Compare August 3, 2021 08:21
@ValeDaRold ValeDaRold requested a review from nilmerg August 3, 2021 08:23
ValeDaRold pushed a commit to WuerthPhoenix/icingaweb2-module-businessprocess that referenced this pull request Aug 3, 2021
@ValeDaRold ValeDaRold force-pushed the feature/Nodes-based-on-filter branch from d00cf96 to 9d07548 Compare August 3, 2021 09:15
@ValeDaRold ValeDaRold force-pushed the feature/Nodes-based-on-filter branch from 9d07548 to 2eb86b0 Compare August 6, 2021 07:46
@cla-bot cla-bot bot added the cla/signed label Aug 6, 2021
@ValeDaRold ValeDaRold requested a review from nilmerg August 6, 2021 07:52
@nilmerg nilmerg changed the title Feature/nodes based on filter Allow to add nodes based on filter Aug 6, 2021
@nilmerg nilmerg merged commit 3154e33 into Icinga:master Aug 6, 2021
@TomasBejcek
Copy link

Hello, I used "Host from filter" option with filter hostgroup="Cloud-production" and received ALL hosts in "Hosts*" list, not only these having hostgroup = Cloud-production. (This filter works well in Overview). Can you please advise how / if this function works? Thanks, Tomas

@nilmerg
Copy link
Member

nilmerg commented Jun 29, 2022

Doesn't work anymore for me as well. Please create a new issue.

@Mustafamado
Copy link

Thanks for the nice feature!
An improvement would be, implementing a synchronization job/feature, that updates all objects automatically based on set filters.

This feature would could improve the flexibility and the dynamic of the tool.

Thanks in advance, Mustafa

@TomasBejcek
Copy link

TomasBejcek commented Aug 5, 2022 via email

@Mustafamado
Copy link

The feature would be nice if working. If the objects are not automatically updated based on set filters, then what are these filters for? Tomas From: Mustafa Mado @.> Date: Friday, 5 August 2022 10:39 To: Icinga/icingaweb2-module-businessprocess @.> Cc: Tomáš Bejček @.>, Comment @.> Subject: Re: [Icinga/icingaweb2-module-businessprocess] Allow to add nodes based on filter (#300) Thanks for the nice feature! An improvement would be, implementing a synchronization job/feature, that updates all objects automatically based on set filters. This feature would could improve the flexibility and the dynamic of the tool. Thanks in advance, Mustafa — Reply to this email directly, view it on GitHub<#300 (comment)>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AV226ZQJXWLNAFW34PWZOYDVXTHL3ANCNFSM5BGUK4DQ. You are receiving this because you commented.Message ID: @.***>

My state of knowledge is, that filters are currently just being used (one time) for the first init of the objects and need an interaction from the user, who would have to select all objects to be imported into the view. No usage afterwards for updating new/deleted objects (hosts/services).
Best regards
Mustafa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla/signed enhancement New feature or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants