5 Replies Latest reply on Mar 20, 2019 2:47 AM by Andrew Waters

    Apache Web Site Context




      We are trying to identify the contexts of Apache web sites but we are not managing to know the patterns that are used by ADDM.


      For example


      <VirtualHost *:80>

           ServerName url.intranet -- The server name is identified and related to the apache server process

           ServerAlias url                 -- The server alias is identified and related to the apache server process


          <IfModule mod_weblogic.c>

              WebLogicCluster server1:xxx,server2:xxx  --the contexts below are being identified (memcached) but are not being related to the apache process


      MatchExpression /Context1/link1Soap

      MatchExpression /Context1/link2Soap

      MatchExpression /Context1/link3Soap

      MatchExpression /Context2/link1Soap

      MatchExpression /Context2/link2Soap

      MatchExpression /Context2/link3Soap





      Does addm identify these contexts? How are they related?

        • 1. Re: Apache Web Site Context
          Andrew Waters

          Apache web based servers are complicated. There are a couple of base patterns but various technologies have plugins which are then handled by specific patterns for those technologies.


          If your question is does Discovery handle MatchExpression for WebLogic then no it is not currently supported.

          2 of 2 people found this helpful
          • 2. Re: Apache Web Site Context

            Hi Andrew, Thanks for the answer!


            We found a possible solution by changing the TPL code "ApacheExtendedDiscovery". I include a variable to work with the result and put the code below in the TPL:



            // the code below reads the "website" variable, searching for the information after the string "MatchExpression" and saving on the created variable "website_context"


            website_context_raw := regex.extractAll(website, regex '(?m)^\s*MatchExpression\s*(\/.*)');

            if website_context_raw then

                  for website_context_tmp in website_context_raw do

                        website_context  := website_context + text.split(website_context_tmp, ' ');

                  end for;

            end if;




            // below we scan the entire "website_context" variable and fill in the variable that it displays on the ADDM screen (below):

            for website_cont in website_context do

                  f not website_cont in website_table[website_name][ 'website_context'] then

                        list.append(website_table[website_name][ 'website_context'], website_cont);

                  end if;

            end for;


            Print Apache.png

            • Is it the best solution we can find?
            • Were we able to take these items (1 to 1) to the CMDB as a IC?
            • When submitting the data in ADDM is it possible to insert line break?
            • 3. Re: Apache Web Site Context
              Andrew Waters

              Specifically modifying standard TKU patterns is not a great idea. It makes updating them very hard.


              MatchExpression is not general Apache facility so it would be a very strange place to put it.


              Storing a list of results as a string with spaces is not something you would normally do.

              1 of 1 people found this helpful
              • 4. Re: Apache Web Site Context
                GABRIEL FERREIRA

                We made a change to the original apachewebserver TPL (in test environment) and we were able to collect the apache website contexts. These contexts were created as SoftwareComponent in ADDM and sent to the BMC_ApplicationService class in the CMDB.


                When creating a TPL from CMDBSYNC to send the field weblogic_cluster (field created in standard TPL to receive values from the cluster) to the existing field in CMDB in class BMC_ApplicationService and we are making an error we can not identify the cause.


                Error: Change to module CMDB.ApplicationService.Extended failed because Syntax error at or near 'syncmapping' at line 10.




                1 tpl 1.0 module CMDB.ApplicationService.Extended;


                3 metadata

                4     origin := "Customizada OI";

                5     tree_path := "Custom","CMDB Sync", "Host", "ApplicationService Extended";

                6 end metadata;


                8 from CMDB.SoftwareComponent_ApplicationService import SoftwareComponent_ApplicationService 3.4;


                10 syncmapping ApplicationService_Extended 1.0

                11     """

                12     Extend class ApplicationService, added URL attributes

                13     """

                14     overview

                15         tags CMDB, Oi, custom, extended, website;

                16     end overview;


                18     mapping from SoftwareComponent_ApplicationService.component as component


                20     end mapping;


                22     body

                23         appservice := SoftwareComponent_ApplicationService.appservice;


                25           if appservice = void then

                26                log.info("AppService extend: Instance not found...");

                27                stop;

                28           end if;


                30           if component.type <> "Apache Webserver Website Context" then

                31                stop;

                32           end if;


                34           if component.weblogic_cluster then

                35                appservice.Description := component.weblogic_cluster;

                36           end if;


                38     end body;


                40 end syncmapping;


                • 5. Re: Apache Web Site Context
                  Andrew Waters

                  syncmapping does not exist in tpl 1.5 where you are, for some reason, asking for tpl 1.0. Using old version of tpl removes features. Given that the earliest support Discovery version in 11.0 which is tpl 1.11 there is not really a good reason for using anything earlier than that.

                  3 of 3 people found this helpful