- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-05-2020 08:12 AM
Hello,
I have a problem in creating a relationship between two middleware components identified on a Linux server
Basically it is a discovery on a Linux server with an LXC layer and on which a Jboss server application is running.
A custom "LXC" pattern has been created to support the LXC part.
A specific "LXC" Class has been created via the class Manager, derived from the Application_server class.
(table u_cmdb_ci_app_server_lxc derived from table cmdb_ci_app_server)
The Linux server discovery is running correctly, both Jboss and LXC patterns are used and give correct results.
At the level of "Related Items", the corresponding CIs are created in the :
Jbosss: cmdb_ci_app_server_jboss
Lxc: u_cmdb_ci_app_server_lxc
The items appear well on the Linux server form with the "Runs on ::Runs" relations
( See the screen copies in the attached document. it should be more clear.)
Now we want to create a relationship between the LXC and Jboss CIs indicating that the LXC container hosts the JBoss server application.
(Several LXC containers, each hosting a Jboss server application).
The relationship type would logically be "Contains ::Contained by" ... but we don't know for sure yet.
Between the two tables there is an attribute to link the LXC record and the JBoss record.
So we have added a « create relation » step in the LXC Pattern which use this attribute.
Setting :
Parent Table: $u_cmdb_ci_app_server_lxc
Child Table: $cmdb_ci_app_server_jboss
Result Table: $p_cmdb_rel_ci
Relationship type: Contains ::Contained by (to be defined, not sure of the relation type..)
Creation Criteria: Field Matching
Parent Table field : u_cible_installdir
Child Table field: install_directory
Unmatched Values: remove
Obviously this is not working... 🙂
In the context of the LXC pattern (which contains the "create relation" step), we need to access the contents of the cmdb_ci_app_server_jboss table ...
But the table $cmdb_ci_app_server_jboss is fed (and accessible) at the JBoss pattern level.
So in the "runtime" context of the LXC Pattern I can't access it. It's at least ma conclusion.
(In debug mode, on the right part (CI attribute), the JBoss tab is empty .. 😞 )
I also tried with a "Creation Criteria" of type Condition :
$u_cmdb_ci_app_server_lxc[].u_target_installdir " contains " $cmdb_ci_app_server_jboss[].install_directory.
It still doesn't work.
Questions :
- How do I make the contents of the cmdb_ci_app_server_jboss table accessible?
I think this is already the first point to solve ...
- Is there in parallel a Dependant relation to be created also via the Class manager at the level of the Class LXC and/or Jboss ? type "containment" or "host" ... ?
Any help is welcome.
Solved! Go to Solution.
- Labels:
-
Discovery
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-08-2020 12:26 AM
Hi
In patterns context, you can only access any CIs that are populated within the same pattern and can make relations with them. Pattern's will not get you the CI data from CMDB.
In your case as Lxc and Jboss being 2 different pattern execution, there is no capability to access persisted JBoss CIs from CMDB in Lxc pattern.
Here in context of patterns, we do have some pre and post sensor scripts feature, you can make use of a post sensor script in your case to make relations with the persisted Jboss CIs.
So for every execution of your lxc pattern the post sensor script that you created will run and will make the relations to the Jboss CI as per your criteria. I see the condition which is common field is some installation directory that you are matching, hope the 2 attributes are part of the CI because you can't access temporary variables in post sensor script.
Only caveat here is the Jboss pattern should run before your lxc pattern so that you will be able to make the relations, but from your discovery log it seems to be fine. Just ensure this lxc always runs after jboss.
Reg the rules, there is no need to have a containment rule in class manager, without that even you can make this contains relation b/w the 2 CIs in post sensor script.
You can see many other scripts already available OOB under Pattern Designer -> Pre Post Processing, which can help you in writing a new script.
Please mark Correct if it resolves your issue and also mark Helpful if it helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-12-2020 03:16 AM
Hi SiD,
1. I ran some tests by changing the order priority on the LXC classifier:
- LXC classifier order value: 900 (also tested with 10001, 11000,..)
- Jboss (OOTB) order value : 200 (default value..) .
This doesn't work 😞 ... LXC and JBoss explorations are not synchronized (interleaving...).
The tests were performed in several ways: quick discovery and via a schedule.
The documentation "Discovery Process Classification" specifies that this criterion is used in cases where several classifiers are present on the same table (it is my interpretation..) :
"Enter the order in which Discovery should run this process classification when there are multiple classifications available for a table. Discovery runs process classifications from the lowest to highest order."
The documentation should be clearer, but what I understand is that the "order" parameter only allows for Classifiers targeting different tables...
did you manage to do pattern syncs this way?
2. Indeed the script you mentionned ("LB Create Relation Between VIPs and Apps") is quite readable, i'll study it in details.
thanks again for your help.
regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-13-2020 11:32 PM
Hi
This is strange, I followed this approach recently where in my new classifier i had a higher priority and I see my new pattern got executed. My case was also with different tables.
So in your case, what is the behavior you see with this approach? Is Lxc pattern running before Jboss? or both patterns are triggered in parallel?
Reg pattern sync, I didn't get you exact, please elaborate.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2020 06:15 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2020 10:10 PM
Hi
Not sure about why synchronizing not happening though.
Could you try on top of the classifier logic, now can you try the run order option in pattern basic view to mention that run after jboss.
Just a trial if this combination might work.