DB2 instance name changes


Description

Symptoms


The name format for DB instance will different on cmdb_ci_db_db2_instance after migrating from probes to the pattern.

The name format if the database instance is created by discovery using probes.

The syntax for  name format : "DB"@"host"

 The database instance name created by discovery using patterns.




Release

All

Environment

All

Cause

The sensor was responsible for creating the db2 name with the "DB"@"host", Please find the list of code below 

_setName: function() { 
var nameMatch = this.getCmdbRecord().name.match(/^.*@(\S*)(\s*$|\s+.*$)/);
if (nameMatch) {
current.name = current.instance_name + "@" + nameMatch[1];
}


The sensor record with the URL :https://<instance name>.service-now.com/nav_to.do?uri=discovery_sensor.do?sys_id=d5e3bc304f269f001a10ecd18110c791 

2. Currently, we are running the discovery with the patterns, the pattern is "DB2 On Linux". 

https://<instance name>.service-now.com/$sn_pattern_designer.do?authoring_mode=modify&sys_id=28d607dbfead4be3887c843814455701&sysparm_view=&sysparm_record_target=sa_pattern&sysparm_record_row=3&sysparm_record_list=nameCONTAINSDB2%5EORDERBYname&sysparm_record_rows=4 

The code from the pattern 

step { 
name = "exit change user credentials"
unchange_user {}
}
step {
name = "Connection to file system"
create_connection {
connection_type = STORAGE_FLOW
entry_point_type = "cmdb_ci_endpoint_app_storage"
attributes {attribute {
name = "file_in_use"
value = get_attr {"files[*].name"}
}}


Resolution



This is expected behavior, If the customer would like to change the name format the pattern is "DB2 On Linux" should be customized.