3 Replies Latest reply on Sep 6, 2017 7:13 AM by Bernard Stern

    Pattern failure preventing tideway service from starting properly

    Bernard Stern

      We have uploaded a pattern module using the web GUI, it was uploaded sucessfully. The test scan we did was doing nothing for 20 min or so, so I stopped and restarted the tideway service. The services start up to the reasoning service.

       

      ADDM application services are starting

          Security service:                        2089          [  OK  ]

          Model service:                           2140          [  OK  ]

          Vault service:                           2244          [  OK  ]

          Discovery service:                       2292          [  OK  ]

          Mainframe Provider service:              2362          [  OK  ]

          SQL Provider service:                    2429          [  OK  ]

          CMDB Sync (Exporter) service:            2514          [  OK  ]

          CMDB Sync (Transformer) service:         2579          [  OK  ]

          Reasoning service:                       2741          [  OK  ]

          Tomcat service:                                        [ STOP ]

          Reports service:                                       [ STOP ]

          External API service:                                  [ STOP ]

          Application Server service:                            [ STOP ]

       

      The reasoning log repeatedly logs the following line

       

      ECAEngineError: ReasoningCORBA.ECAEngineError(reason='Error loading rule module "generated_code.ZKB.ARENA"')

      140028211533568: 2017-09-05 10:15:58,282: reasoning.ami: ERROR: eeReloadRules failed

      Traceback (most recent call last):

        File "./ami.py", line 162, in _callMethodException

        File "/usr/tideway/lib/python2.7/site-packages/omniORB/ami.py", line 80, in raise_exception

          self._poller.raise_exception()

       

      Next I tried to deactivate/remove the ZKB.ARENA module, causing the above error.

       

      [tideway@sfa3102 log]$ tw_pattern_management --deactivate-module ZKB.ARENA

      Password:

      Traceback (most recent call last):

        File "./pattern_management.py", line 203, in <module>

        File "./pattern_management.py", line 101, in main

        File "./naming.py", line 150, in resolveName

        File "/usr/tideway/lib/python2.7/site-packages/CosNaming_idl.py", line 415, in resolve_str

          return self._obj.invoke("resolve_str", _0_CosNaming.NamingContextExt._d_resolve_str, args)

      CosNaming.NotFound: CosNaming.NamingContext.NotFound(why=missing_node, rest_of_name=[CosNaming.NameComponent(id='Reasoning', kind='')])

       

      I am wondering if there is an easy way out of this issue. I do have backups from before uploading the ZKB.ARENA module.

        • 1. Re: Pattern failure preventing tideway service from starting properly
          Andrew Waters

          I would be interested to see the pattern module.

           

          See previous post on how to get around this.

          2 of 2 people found this helpful
          • 2. Re: Pattern failure preventing tideway service from starting properly
            Bernard Stern

            Hi Andrew, thanks for the pointer to the how-to.

            Is there any way to insert a pattern as a text file rather than inline?

             

            Pattern Module 1: ARENA_ApplName_Table.tpl

             

            // SoftwareInstance model ARENA Data Server builder.
            // Code generated on discovery.prod.zkb.ch at Mon Dec  7 14:00:20 2015 by thomas schuhn.
            
            tpl 1.13 module ZKB.ARENA.Appl_Name;
            
            metadata
                origin := 'SoftwareInstance Model';
                tree_path := 'BMC Discovery Application Modeling', 'ARENA Application Servers', 'Application Name';
            end metadata;
            
            table ApplicationName 2.0
            
                "ADM" -> "ARENA Data Model";
                "ADS" -> "ARENA Data Server";
                "AEF" -> "ARENA Extension Framework";
                "AFG" -> "ARENA Financial Information Exchange Gateway";
                "AIMS" -> "ARENA Internal Market Server";
                "AMB" -> "ARENA Message Broker";
                "AMBA" -> "ARENA Message Broker Adapter";
                "AMAS" -> "ARENA Market Access Server";    
                "AMPH" -> "ARENA Market Price Handler";
                "AMS" -> "ARENA Market Server";
                "AMSC" -> "ARENA Market Server Concentrator";
                "APG" -> "ARENA Post Trade Gateway";
                "APH" -> "ARENA Price Feed Handler";
                "APS" -> "ARENA PACE Server";
                "ASBS" -> "ARENA Soft Broker Server";
                "ASQL" -> "ARENA Stuctured Query Language";
                "ATCI" -> "ARENA Trade Capture Interface";
                "ATS" -> "ARENA Task Server";
                "AWT" -> "ARENA Web Template";
                "RAMSA" -> "Real-time ARENA Market Server Archive";
                "XMBA" -> "Exchange Message Broker Adapter";
                "AMI" -> "ARENA Monitoring Interface";
                "SMART" -> "ARENA SMART";
                "ALGOSERVER" -> "ARENA AlgoServer";
                "AUTOMATCH" -> "ARENA Automatch";
                default -> "NOMATCH";
            
            end table;
            

             

            Pattern Module 2: ARENA_Applikationen.tpl

             

            // SoftwareInstance model ARENA Data Server builder.
            // Code generated on discovery.prod.zkb.ch at Mon Dec  7 14:00:20 2015 by thomas schuhn.
            
            tpl 1.13 module ZKB.ARENA;
            
            metadata
                origin := 'SoftwareInstance Model';
                tree_path := 'BMC Discovery Application Modeling', 'ARENA Application Servers', 'Application Instances';
            end metadata;
            
            from ZKB.ARENA.Appl_Name import ApplicationName 2.0;
            
            definitions LocalFunctions 1.0
                    """
                    User functions
            
                    2017-09-04 - Initialerstellung
                    """
            
                type := function;
            
                define get_instance(process) -> si_instance
                    """
                       Die Funktion ermittelt die Software Instanz
                       aus den Processinformationen
            
                       Change History:
                       2017-09-04 - Initialerstellung
                    """
            
                    si_instance := "";
            
                    //SoftwareInstanz Instance 
                    if process.args has subword "instance_name" then
                        si_instance := text.upper(regex.extract(process.args, regex "(?i)^\-instance\_name\s(\S+)\s", raw '\1'));
                    elif process.args has subword "server_name" or process.args has subword "amba_name" then
                        si_instance := text.upper (regex.extract(process.args, regex "(?i)(?:server|amba)_name\s(\S+)\s", raw '\1'));
                    elif process.args has subword "ini_file" or process.args has subword "inifile" then
                        si_instance := text.upper (regex.extract(process.args, regex "(?i)\/ini\/(\S+)\.ini", raw '\1'));
                    end if;
            
                    return si_instance;
                end define;    
            
            
            
                define get_version(host,process,short_si_type,package_regexes,si_instance) -> si_version, si_product_version
                    """
                       Die Funktion ermittelt die Softwareversion
                       aus der WMI- oder Packetabrage
            
                       Change History:
                       2017-09-04 - Initialerstellung
                    """
            
                    si_version := "";
                    si_product_version := "";
            
                    if host.os_class = "Windows" and short_si_type <> "AMS" then
            
                        //SoftwareInstanz Version aus der Fileversion mit WMI
                        filename := process.cmd;
                        log.debug("Filename: %filename%");
            
                        escaped_filename := text.replace(filename, "\\", "\\\\");
                        query_cmd := "SELECT Version FROM cim_datafile where Name = '%escaped_filename%'";
                        wmi_results := discovery.wmiQuery(host, query_cmd, "root\cimv2");
                        if wmi_results then
                             log.debug("WMI Abfrage der Version erfolgreich. IF durchlauf fuer " + host.name);
                             si_version := wmi_results[0].Version;
                             si_product_version := regex.extract(si_version, regex "^(\d+\.\d+)", raw '\1');
                             log.debug("Version ist %si_version% und die Produktversion ist %si_product_version%"); 
                        else
                             log.debug("WMI Abfrage der Version war nicht erfolgreich. Abfrage der Packetversion"); 
            
                             // Find any packages that match the regular expressions defined in the constants.
                             packages := model.findPackages(host, package_regexes);
            
                             // If any packages were found, use the first one that has a version set
                             for package in packages do
            
                                log.debug("Packetname: %package.name%, Instanz: %si_instance%, Host: %host.name%");
                                if package.name has subword "%si_instance%" then
                                // if package.version then
                                  
                                  // Versionierung der Applikation
                                  si_version := package.version;
                                  si_product_version := regex.extract(si_version, regex "^(\d+\.\d+)", raw '\1');
                                  
                                  log.debug("Version ist %si_version% und das Produkt heisst %short_si_type%"); 
                                  
                                end if;
                             end for;
                        end if;                
                    elif host.os_class = "Windows" and short_si_type = "AMS" then
                              log.debug("System ist als AMS identifiziert"); 
            
                              // Find any packages that match the regular expressions defined in the constants.
                              packages := model.findPackages(host, package_regexes);
                          
                              // If any packages were found, use the first one that has a version set
                              for package in packages do
                              
                                if package.name has subword "%si_instance%" then
            
                                  // Versionierung der Applikation
                                  si_version := package.version;
                                  si_product_version := regex.extract(si_version, regex "^(\d+\.\d+)", raw '\1');
                                  
                                  // Ergaenzt den Applikationstyp aus der Liste ApplicationName
            //                      short_si_type := text.upper (regex.extract(package.name, regex "(?i)^front\sarena\s(\w+)\W", raw '\1'));
            //                      si_type := ApplicationName[short_si_type];         
            
            //                      log.debug("Version ist %si_version% und das Produkt heisst %short_si_type%"); 
                                  
                                end if;
                              end for;
                    else         
                        // Softwarepacket
                        packages := model.findPackages(host, package_regexes);
                    
                        // If any packages were found, use the first one that has a version set
                        if packages then
                            log.debug("Running through IF statement for the package query. " + host.name);
                            si_version := packages[0].version;
                            si_product_version := regex.extract(si_version, regex "^(\d+\.\d+)", raw '\1');
                            log.debug("Version ist %si_version% und die Produktversion ist %si_product_version%"); 
                        end if;
            
                    end if;        
            
                    return si_version, si_product_version;
                end define;
            
            end definitions;
            
            
            
            
            //---------------------------------------------------
            
            pattern ARENA_Message_Broker_Adapter 2.0
            '''
                      Build "ARENA Message Broker Adapter" software instances
                      
                      AMBA -> ARENA Message Broker Adapter
            
                      Supported Platforms:
                      Windows
                      UNIX
            
                      Change History:
                      2017-06-01  Initialerstellung des Pattern
                      2017-09-05  v2.0 Clusterfaehig, Modulaufteilung
            
            '''
            
                metadata
                    publishers := 'SunGuard';
                end metadata;
            
                overview
                    tags Software_Instance_Model;
                end overview;
                
                constants
                    namespace := 'root\cimv2';
                end constants;
            
                triggers
                    on process := DiscoveredProcess where cmd matches windows_cmd "amba" or cmd matches unix_cmd "amba";
                end triggers;
            
                body
            
                    // Hostinformationen
                    host := related.hostingNode(fallback_kind := "Cluster");
            //        host := model.host(process);
                    log.debug("Hostname: " + host.name);
            
                    // Initialisiere die Variablen
                    short_si_type := "";
                    package_regexes := "";
            
                    // ARENA Message Broker Adapter 
                    short_si_type   := "AMBA";
                    package_regexes := [regex "^amba$"];
                    si_type := ApplicationName[short_si_type];        
                    log.debug("Der SoftwareInstanz Type lautet: %short_si_type% %si_type%"); 
            
                    // Ermitteln der Applikationsinstanz
                    si_instance := LocalFunctions.get_instance(process);
            
                    // Ermitteln der Applikationsversion
                    si_version, si_product_version := LocalFunctions.get_version(host,process,short_si_type,package_regexes,si_instance);
            
                    if si_type and si_instance and si_version then 
                         model.SoftwareInstance(
                                host,
                                key := '%si_type%' + '%si_version%' + '%si_instance%' + '/%host.key%',
                                short_name := short_si_type,
                                name := "%si_type% %si_product_version% identified as %si_instance% on %host.name%",
                                type := si_type,
                                version := si_version,
                                product_version := si_product_version,
                                instance := si_instance
                         );        
            
                            
                    elif si_type then
                        
                            model.SoftwareInstance(
                                host,
                                key := '%si_type%' + '/%host.key%',
                                short_name := short_si_type,
                                name := "%si_type% on %host.name%",
                                type := si_type
                            );                                 
                             
                    end if;                 
                    
                end body;
            
            end pattern;
            
            //---------------------------------------------------
            
            pattern ARENA_Message_Broker 2.0
            '''
                      Build "ARENA Message Broker" software instances
                      
                      AMB -> ARENA Message Broker
            
                      Supported Platforms:
                      Windows
            
                      Change History:
                      2017-06-01  Initialerstellung des Pattern
                      2017-09-05  v2.0 Clusterfaehig, Modulaufteilung
            
            '''
            
                metadata
                    publishers := 'SunGuard';
                end metadata;
            
                overview
                    tags Software_Instance_Model;
                end overview;
                
                constants
                    namespace := 'root\cimv2';
                end constants;
            
                triggers
                    on process := DiscoveredProcess where cmd matches windows_cmd "dssrv_mssql";
                end triggers;
            
                body
            
                    // Hostinformationen
                    host := related.hostingNode(fallback_kind := "Cluster");
            //        host := model.host(process);
                    log.debug("Hostname: " + host.name);
            
                    // Initialisiere die Variablen
                    short_si_type := "";
                    package_regexes := "";
            
                    // ARENA Message Broker
                    short_si_type := "AMB";
                    package_regexes := [regex "^amb$"];
                    si_type := ApplicationName[short_si_type];
                    log.debug("Der SoftwareInstanz Type lautet: %short_si_type% %si_type%"); 
            
                    // Ermitteln der Applikationsinstanz
                    si_instance := LocalFunctions.get_instance(process);
            
                    // Ermitteln der Applikationsversion
                    si_version, si_product_version := LocalFunctions.get_version(host,process,short_si_type,package_regexes,si_instance);
            
                    if si_type and si_instance and si_version then 
                         model.SoftwareInstance(
                                host,
                                key := '%si_type%' + '%si_version%' + '%si_instance%' + '/%host.key%',
                                short_name := short_si_type,
                                name := "%si_type% %si_product_version% identified as %si_instance% on %host.name%",
                                type := si_type,
                                version := si_version,
                                product_version := si_product_version,
                                instance := si_instance
                         );
            
                    elif si_type then
                         model.SoftwareInstance(
                                host,
                                key := '%si_type%' + '/%host.key%',
                                short_name := short_si_type,
                                name := "%si_type% on %host.name%",
                                type := si_type
                         );
            
                    end if;
            
                end body;
            
            end pattern;
            
            • 3. Re: Pattern failure preventing tideway service from starting properly
              Bernard Stern

              Hi Andrew, I may have an explanation for the error. According to TPL syntax definition, the module name must be of the form

               

              tpl 1.n module module.name;

               

              in our module causing the mentiionned problem, we have module names of the form

               

              tpl 1.n module module.name1.name2;

               

              We changed that back to module.name, and it works. That somehow supports my assumption.

               

              The strange thing is, the GUI did not say anything about the wrong module name. This should have been caught by the syntax checker, provided of course my assumption is correct.

              1 of 1 people found this helpful