Crystal Reports Designer lets you customize the attribute Transform for system_name of Component CI by modifying formulas in the CompCI and parentcomp.rpt subreports.
<ftps>
The report appears.
The following displays the formula definition of fA_sysname:
local stringVar sysName;
local stringVar bpName;
local stringVar srvrName;
local stringVar compVer;
local stringVar compQual;
local stringVar appName;
local stringVar instDir;
local stringVar portNo;
local numberVar type; // typ will be 1, 2 or 3 depending upon bp name
local stringVar temp;
local stringVar tempQual;
local numberVar diff;
if (isnull(maximum({query_compci.Bp Name}, {query_compci.Comp Uuid})))
then bpName := "" else bpName := maximum({query_compci.Bp Name}, {query_compci.Comp Uuid});
if (isnull(maximum({query_compci.Srvr Name}, {query_compci.Comp Uuid})))
then srvrName := "" else srvrName := maximum({query_compci.Srvr Name}, {query_compci.Comp Uuid});
if (isnull(maximum({query_compci.Comp Qual}, {query_compci.Comp Uuid})))
then compQual := "" else compQual := maximum({query_compci.Comp Qual}, {query_compci.Comp Uuid});
if (isnull(maximum({query_compci.Comp Ver}, {query_compci.Comp Uuid})))
then compVer := "" else compVer := maximum({query_compci.Comp Ver}, {query_compci.Comp Uuid});
if (isnull(maximum({query_compci.Application Name}, {query_compci.Comp Uuid})))
then appName := "" else appName := maximum({query_compci.Application Name}, {query_compci.Comp Uuid});
if (isnull(maximum({query_compci.Install Dir}, {query_compci.Comp Uuid})))
then instDir := "" else instDir := maximum({query_compci.Install Dir}, {query_compci.Comp Uuid});
if (isnull(maximum({query_compci.Listen Port}, {query_compci.Comp Uuid})))
then portNo := "" else portNo := maximum({query_compci.Listen Port}, {query_compci.Comp Uuid});
if (bpName in ["J2EE Enterprise Application", "Java Web Application"]) then
type := 1
else if (bpName in ["BEA WebLogic Domains (Windows)", "BEA WebLogic Domains (UNIX)", "BEA WebLogic Domain (Windows)", "BEA WebLogic Domain (UNIX)"]) then
type := 2
else if (bpName in ["IBM WebSphere 6 Server Instance (UNIX)", "IBM WebSphere 6 Server Instance (Windows)", "IBM WebSphere 5 Server Instance (UNIX)", "IBM WebSphere 5 Server Instance (Windows)"]) then
type := 2
else
type := 3;
if(type=3) then
(
if(not(isnumeric(left(srvrName,(instr(srvrName,'.'))-1)))) then
srvrName := left(srvrName,(instr(srvrName,'.'))-1)
else
srvrName := srvrName;
)
else
srvrName := srvrName;
if (type = 1) then
(
sysName := "j2ee|" & srvrName & "|" & appName & "|" & instDir ;
if (len(sysName) > 255) then
sysName := left(sysName, 255);
)
else if (type = 2) then
(
sysName := "port|" & srvrName & "|" & portNo;
if (len(sysName) > 255) then
sysName := left(sysName, 255);
)
else (
temp := srvrName & "|" & bpName & "|" & compVer & "|" ;
if (len(temp) + len(compQual) <= 255) then
(sysName := temp & compQual)
else
(
diff:= (length(temp) + length(compQual))+ 3 -252;
if ( length(compQual) > diff ) then
compQual:= mid(compQual,1,(length(compQual) - diff)\2+1)+"..."+ mid(compQual,(length(compQual) + diff)\2)
else
compQual := "";
sysName := temp & compQual;
)
);
sysName;
The following displays the formula definition of fA_sysname:
local stringVar sysName;
local stringVar bpName;
local stringVar srvrName;
local stringVar compVer;
local stringVar compQual;
local stringVar appName;
local stringVar instDir;
local stringVar portNo;
local numberVar type; // typ will be 1, 2 or 3 depending upon bp name
local stringVar temp;
local stringVar tempQual;
local numberVar diff;
if (isnull(maximum({query_compci.Bp Name}, {query_compci.Comp Uuid})))
then bpName := "" else bpName := maximum({query_compci.Bp Name}, {query_compci.Comp Uuid});
if (isnull(maximum({query_compci.Srvr Name}, {query_compci.Comp Uuid})))
then srvrName := "" else srvrName := maximum({query_compci.Srvr Name}, {query_compci.Comp Uuid});
if (isnull(maximum({query_compci.Comp Qual}, {query_compci.Comp Uuid})))
then compQual := "" else compQual := maximum({query_compci.Comp Qual}, {query_compci.Comp Uuid});
if (isnull(maximum({query_compci.Comp Ver}, {query_compci.Comp Uuid})))
then compVer := "" else compVer := maximum({query_compci.Comp Ver}, {query_compci.Comp Uuid});
if (isnull(maximum({query_compci.Application Name}, {query_compci.Comp Uuid})))
then appName := "" else appName := maximum({query_compci.Application Name}, {query_compci.Comp Uuid});
if (isnull(maximum({query_compci.Install Dir}, {query_compci.Comp Uuid})))
then instDir := "" else instDir := maximum({query_compci.Install Dir}, {query_compci.Comp Uuid});
if (isnull(maximum({query_compci.Listen Port}, {query_compci.Comp Uuid})))
then portNo := "" else portNo := maximum({query_compci.Listen Port}, {query_compci.Comp Uuid});
if (bpName in ["J2EE Enterprise Application", "Java Web Application"]) then
type := 1
else if (bpName in ["BEA WebLogic Domains (Windows)", "BEA WebLogic Domains (UNIX)", "BEA WebLogic Domain (Windows)", "BEA WebLogic Domain (UNIX)"]) then
type := 2
else if (bpName in ["IBM WebSphere 6 Server Instance (UNIX)", "IBM WebSphere 6 Server Instance (Windows)", "IBM WebSphere 5 Server Instance (UNIX)", "IBM WebSphere 5 Server Instance (Windows)"]) then
type := 2
else
type := 3;
if(type=3) then
(
if(not(isnumeric(left(srvrName,(instr(srvrName,'.'))-1)))) then
srvrName := left(srvrName,(instr(srvrName,'.'))-1)
else
srvrName := srvrName;
)
else
srvrName := srvrName;
if (type = 1) then
(
sysName := "j2ee|" & srvrName & "|" & appName & "|" & instDir ;
if (len(sysName) > 255) then
sysName := left(sysName, 255);
)
else if (type = 2) then
(
sysName := "port|" & srvrName & "|" & portNo;
if (len(sysName) > 255) then
sysName := left(sysName, 255);
)
else (
temp := srvrName & "|" & bpName & "|" & compVer & "|" ;
if (len(temp) + len(compQual) <= 255) then
(sysName := temp & compQual)
else
(
diff:= (length(temp) + length(compQual))+ 3 -252;
if ( length(compQual) > diff ) then
compQual:= mid(compQual,1,(length(compQual) - diff)\2+1)+"..."+ mid(compQual,(length(compQual) + diff)\2)
else
compQual := "";
sysName := temp & compQual;
)
);
sysName;
The following displays the formula definition of fA_sysname 2:
local stringVar sysName;
local stringVar bpName;
local stringVar srvrName;
local stringVar compVer;
local stringVar compQual;
local stringVar appName;
local stringVar instDir;
local stringVar portNo;
local numberVar type; // typ will be 1, 2 or 3 depending upon bp name
local stringVar temp;
local stringVar tempQual;
local numberVar diff;
if (isnull(maximum({query_parentCompDetails.Bp Name}, {query_compci.Comp Uuid})))
then bpName := "" else bpName := maximum({query_parentCompDetails.Bp Name}, {query_compci.Comp Uuid});
if (isnull(maximum({query_parentCompDetails.Srvr Name}, {query_compci.Comp Uuid})))
then srvrName := "" else srvrName := maximum({query_parentCompDetails.Srvr Name}, {query_compci.Comp Uuid});
if (isnull(maximum({query_parentCompDetails.Comp Qual}, {query_compci.Comp Uuid})))
then compQual := "" else compQual := maximum({query_parentCompDetails.Comp Qual}, {query_compci.Comp Uuid});
if (isnull(maximum({query_parentCompDetails.Comp Ver}, {query_compci.Comp Uuid})))
then compVer := "" else compVer := maximum({query_parentCompDetails.Comp Ver}, {query_compci.Comp Uuid});
if (isnull(maximum({query_parentCompDetails.Application Name}, {query_compci.Comp Uuid})))
then appName := "" else appName := maximum({query_parentCompDetails.Application Name}, {query_compci.Comp Uuid});
if (isnull(maximum({query_parentCompDetails.Install Dir}, {query_compci.Comp Uuid})))
then instDir := "" else instDir := maximum({query_parentCompDetails.Install Dir}, {query_compci.Comp Uuid});
if (isnull(maximum({query_parentCompDetails.Listen Port}, {query_compci.Comp Uuid})))
then portNo := "" else portNo := maximum({query_parentCompDetails.Listen Port}, {query_compci.Comp Uuid});
if (bpName in ["J2EE Enterprise Application", "Java Web Application"]) then
type := 1
else if (bpName in ["BEA WebLogic Domains (Windows)", "BEA WebLogic Domains (UNIX)", "BEA WebLogic Domain (Windows)", "BEA WebLogic Domain (UNIX)"]) then
type := 2
else if (bpName in ["IBM WebSphere 6 Server Instance (UNIX)", "IBM WebSphere 6 Server Instance (Windows)", "IBM WebSphere 5 Server Instance (UNIX)", "IBM WebSphere 5 Server Instance (Windows)"]) then
type := 2
else
type := 3;
if(type=3) then
(
if(not(isnumeric(left(srvrName,(instr(srvrName,'.'))-1)))) then
srvrName := left(srvrName,(instr(srvrName,'.'))-1)
else
srvrName := srvrName;
)
else
srvrName := srvrName;
if (type = 1) then
(
sysName := "j2ee|" & srvrName & "|" & appName & "|" & instDir ;
if (len(sysName) > 256) then
sysName := left(sysName, 256);
)
else if (type = 2) then
(
sysName := "port|" & srvrName & "|" & portNo;
if (len(sysName) > 256) then
sysName := left(sysName, 256);
)
else (
temp := srvrName & "|" & bpName & "|" & compVer & "|" ;
if (len(temp) + len(compQual) <= 256) then
(sysName := temp & compQual)
else
(
diff:= (length(temp) + length(compQual))+ 3 -252;
if ( length(compQual) > diff ) then
compQual:= mid(compQual,1,(length(compQual) - diff)\2+1)+"..."+ mid(compQual,(length(compQual) + diff)\2)
else
compQual := "";
sysName := temp & compQual;
)
);
sysName;
The Transform attributes are customized.
When you integrate CA Configuration Automation and CMDB, a new CI named Database Name is created in the cmdbexport.xml file, and in CA SDM. The Database Name CI exports the database name values obtained for the Component Parameters and Variables, and the File Structure class parameters.
When you create a custom blueprint set the Component Parameter, or File Structure class Parameter to Interpret As Database Name in the Value Details attribute panel. Set the Interpret As Database Name to a specific parameter depending on your requirements. We recommend you to set the Database Name for the blueprint parameters that belongs to the Relational Databases category.
For example, follow these steps to set a Database Name for Oracle Database 11g (Windows) component blueprint:
INSERT INTO acmbo_classmapping VALUES('component','Copy of Oracle Database 11g (Windows)','Software.Database','Oracle')
4. Discover the copy of Oracle Database 11g (Windows) component blueprint for any Windows computer where Oracle 11g is installed.
After the discovery is complete, the relationships are displayed in the Configuration Relationships view of the respective server.
5. Run the CMDB Export Report to verify the database name in the cmdbexport.xml file. A code sample follows:
<ci> <name>orcl</name> <dns_name /> <serial_number /> <system_name>orcl</system_name> <family>Software.Database</family> <class>Oracle</class> <mdr_name>lodivmlcvs2026.ca.com</mdr_name> <mdr_class>CCA r12.8</mdr_class> <federated_asset_id>&objtype=database&name=orcl</federated_asset_id> </ci> <relation> <type>communicates with</type> <provider> <name>Copy of Oracle Database 11g (Windows) 11.2.0.1.0 (C:\app\Administrator\product\11.2.0\dbhome_1)</name> <system_name> bgunn03-i44401.ca.com|Copy of Oracle Database 11g (Windows)|11.2.0.1.0|C:\oracle\product\11.2.0\dbhome_1) </system_name> </provider> <dependent> <name>orcl</name> <dns_name></dns_name> <serial_number></serial_number> <system_name>orcl</system_name> </dependent> </relation> The name and system_name (shown in bold in this example) are the discovered values. The family and class are derived based on the provider component. After the export, the CA Service Desk UI displays the relationship, and the CMDB Visualizer displays the component relationships.
|
Copyright © 2013 CA.
All rights reserved.
|
|