Name

global.ProcessGroupsUtil

Description

This class is giving us the capability to perform manipulation and decisions that are related to Application Fingerprints in a JS class

Script

var ProcessGroupsUtil = Class.create();
ProcessGroupsUtil.prototype = {
  initialize: function() {
  	
  	// add here the processes that you want them not to be identified as servers
  	this.excludedStrings = ["bash","ps "];
  },
  checkIfProcessShouldCluster:function(processSysID){
  	var gr = new GlideRecord("cmdb_running_process");
  	gr.addQuery("sys_id",processSysID);
  	gr.query();
  	
  	if(gr.next()){
  		var processName = gr.getValue("name");
  		if(processName){
  			return this.validateProcessName(processName);
  		}
  	}
  	return true;
  },
  validateProcessName: function(processName){
  	for(var i=0;i<this.excludedStrings.length;i++){
  		if(processName.includes(this.excludedStrings[i])){
  			return false;
  		}
  	}
  	return true;
  },
  /***
  /* this method can replace the entire existing data massage done in java class ProcessPathUtil
  /* in order to do it set system property process.clustering.normalize.process.string.over to "true".
  ***/
  normalizeAllProcessString:function (processStr){
  	return processStr;
  },
  
  /***
  /* prepareProcessRegex is extending the java existing algo, in order for it to be used you need the set
  /* process.clustering.regex.extend to "true"
  ***/
  prepareProcessRegex: function(regex){
  	return regex;
  },
  
  /***
  /* normalizeProcessName is extending the java existing algo, in order for it to be used you need the set
  /* process.clustering.normalize.process.name.extend to "true"
  ***/
  normalizeProcessName : function(processName){
  	return processName;
  },
  
  /***
  /* this method can be use to add text manipulation to the existing data massage done in java class ProcessPathUtil , in order to use it set sys_properties flag  process.clustering.normalize.process.string.extend to "true"
  ***/
  normalizeProcessString:function (processStr){
  	return processStr;
  },
  
  type: 'ProcessGroupsUtil'
};

Sys ID

ad5a9b81731010105ad2db37aef6a70c

Offical Documentation

Official Docs: