Name

sn_cmdb_ci_class.SGOTAssetConstants

Description

No description available

Script

var SGOTAssetConstants = Class.create();

SGOTAssetConstants.PURDUE_LEVEL = {};
SGOTAssetConstants.PURDUE_LEVEL.ZERO = 0;
SGOTAssetConstants.PURDUE_LEVEL.ONE = 1;
SGOTAssetConstants.PURDUE_LEVEL.ONE_FIVE = 1.5;
SGOTAssetConstants.PURDUE_LEVEL.TWO = 2;
SGOTAssetConstants.PURDUE_LEVEL.TWO_FIVE = 2.5;
SGOTAssetConstants.PURDUE_LEVEL.THREE = 3;
SGOTAssetConstants.PURDUE_LEVEL.THREE_FIVE = 3.5;
SGOTAssetConstants.PURDUE_LEVEL.FOUR = 4;
SGOTAssetConstants.PURDUE_LEVEL.FIVE = 5;

// Business Criticality Constants
SGOTAssetConstants.ASSET_CRITICALITY = {};
SGOTAssetConstants.ASSET_CRITICALITY.NONE = 0;
SGOTAssetConstants.ASSET_CRITICALITY.MOST_CRITICAL = 1;
SGOTAssetConstants.ASSET_CRITICALITY.SOMEWHAT_CRITICAL = 2;
SGOTAssetConstants.ASSET_CRITICALITY.LESS_CRITICAL = 3;
SGOTAssetConstants.ASSET_CRITICALITY.NOT_CRITICAL = 4;

// CMDB OT Assets related Class Names
// These will contain any class name that an OT Asset can belong to.
// Add a new constant if particular asset class is missing.
// When adding a new class name from cmdb_ot_entity_type table
// make sure the value part is the "name" field of that table.
SGOTAssetConstants.OT_ENTITY_TYPE = {};
SGOTAssetConstants.OT_ENTITY_TYPE.OT_BASE = "ot_base";

SGOTAssetConstants.OT_ENTITY_TYPE.OT_CONTROL_SYSTEM = "ot_control_system";
SGOTAssetConstants.OT_ENTITY_TYPE.CNC = "cnc";
SGOTAssetConstants.OT_ENTITY_TYPE.DCS = "dcs";
SGOTAssetConstants.OT_ENTITY_TYPE.DPU = "dpu";
SGOTAssetConstants.OT_ENTITY_TYPE.IED = "ied";
SGOTAssetConstants.OT_ENTITY_TYPE.PLC = "plc";
SGOTAssetConstants.OT_ENTITY_TYPE.RTU = "rtu";
SGOTAssetConstants.OT_ENTITY_TYPE.SCADA_SERVER = "scada_server";
SGOTAssetConstants.OT_ENTITY_TYPE.OT_CONTROL_MODULE = "ot_control_module";
SGOTAssetConstants.OT_ENTITY_TYPE.INDUSTRIAL_3D_PRINTER = "industrial_3d_printer";
SGOTAssetConstants.OT_ENTITY_TYPE.OPC_SERVER = "opc_server";

SGOTAssetConstants.OT_ENTITY_TYPE.OT_SUPERVISORY_SYSTEM = "ot_supervisory_system";
SGOTAssetConstants.OT_ENTITY_TYPE.HMI = "hmi";
SGOTAssetConstants.OT_ENTITY_TYPE.EWS = "ews";
SGOTAssetConstants.OT_ENTITY_TYPE.HISTORIAN = "historian";
SGOTAssetConstants.OT_ENTITY_TYPE.SCADA_CLIENT = "scada_client";
SGOTAssetConstants.OT_ENTITY_TYPE.OPC_CLIENT = "opc_client";

SGOTAssetConstants.OT_ENTITY_TYPE.OT_FIELD_DEVICE = "ot_field_device";
SGOTAssetConstants.OT_ENTITY_TYPE.INDUSTRIAL_ROBOT = "industrial_robot";
SGOTAssetConstants.OT_ENTITY_TYPE.INDUSTRIAL_DRIVE = "industrial_drive";
SGOTAssetConstants.OT_ENTITY_TYPE.INDUSTRIAL_SENSOR = "industrial_sensor";
SGOTAssetConstants.OT_ENTITY_TYPE.INDUSTRIAL_ACTUATOR = "industrial_actuator";

// CMDB Sys class name constants.
// If any new CMDB Class need to be handled, then add a constant here 
// with proper name which reflects the class name and value should be 
// the cmdb sys class name.
// If the class added is one of the OT classes and has a valid ot entity type
// in the cmdb_ot_entity_type table, then add it in the above OT_ENTITY_TYPE constants.
SGOTAssetConstants.ASSET_SYS_CLASS = {};
SGOTAssetConstants.ASSET_SYS_CLASS.OT_BASE = "cmdb_ci_ot";

SGOTAssetConstants.ASSET_SYS_CLASS.OT_CONTROL_SYSTEM = "cmdb_ci_ot_control";
SGOTAssetConstants.ASSET_SYS_CLASS.CNC = "cmdb_ci_ot_cnc";
SGOTAssetConstants.ASSET_SYS_CLASS.DCS = "cmdb_ci_ot_dcs";
SGOTAssetConstants.ASSET_SYS_CLASS.DPU = "cmdb_ci_ot_dpu";
SGOTAssetConstants.ASSET_SYS_CLASS.IED = "cmdb_ci_ot_ied";
SGOTAssetConstants.ASSET_SYS_CLASS.INDUSTRIAL_3D_PRINTER = "cmdb_ci_ot_industrial_3d_printer";
SGOTAssetConstants.ASSET_SYS_CLASS.OT_CONTROL_MODULE = "cmdb_ci_ot_control_module";
SGOTAssetConstants.ASSET_SYS_CLASS.PLC = "cmdb_ci_ot_plc";
SGOTAssetConstants.ASSET_SYS_CLASS.RTU = "cmdb_ci_ot_rtu";
SGOTAssetConstants.ASSET_SYS_CLASS.SCADA_SERVER = "cmdb_ci_ot_scada_server";
SGOTAssetConstants.ASSET_SYS_CLASS.OPC_SERVER = "cmdb_ci_ot_opc_server";

SGOTAssetConstants.ASSET_SYS_CLASS.OT_FIELD_DEVICE = "cmdb_ci_ot_field_device";
SGOTAssetConstants.ASSET_SYS_CLASS.INDUSTRIAL_ACTUATOR = "cmdb_ci_ot_industrial_actuator";
SGOTAssetConstants.ASSET_SYS_CLASS.INDUSTRIAL_DRIVE = "cmdb_ci_ot_industrial_drive";
SGOTAssetConstants.ASSET_SYS_CLASS.INDUSTRIAL_ROBOT = "cmdb_ci_ot_industrial_robot";
SGOTAssetConstants.ASSET_SYS_CLASS.INDUSTRIAL_SENSOR = "cmdb_ci_ot_industrial_sensor";

SGOTAssetConstants.ASSET_SYS_CLASS.OT_SUPERVISORY_SYSTEM = "cmdb_ci_ot_supervisory";
SGOTAssetConstants.ASSET_SYS_CLASS.EWS = "cmdb_ci_ot_ews";
SGOTAssetConstants.ASSET_SYS_CLASS.HMI = "cmdb_ci_ot_hmi";
SGOTAssetConstants.ASSET_SYS_CLASS.HISTORIAN = "cmdb_ci_ot_historian";
SGOTAssetConstants.ASSET_SYS_CLASS.SCADA_CLIENT = "cmdb_ci_ot_scada_client";
SGOTAssetConstants.ASSET_SYS_CLASS.OPC_CLIENT = "cmdb_ci_ot_opc_client";

SGOTAssetConstants.ASSET_SYS_CLASS.COMPUTER = "cmdb_ci_computer";
SGOTAssetConstants.ASSET_SYS_CLASS.SERVER = "cmdb_ci_server";
SGOTAssetConstants.ASSET_SYS_CLASS.UNIX_SERVER = "cmdb_ci_unix_server";
SGOTAssetConstants.ASSET_SYS_CLASS.WINDOWS_SERVER = "cmdb_ci_win_server";
SGOTAssetConstants.ASSET_SYS_CLASS.LINUX_SERVER = "cmdb_ci_linux_server";
SGOTAssetConstants.ASSET_SYS_CLASS.AIX_SERVER = "cmdb_ci_aix_server";
SGOTAssetConstants.ASSET_SYS_CLASS.ESX_SERVER = "cmdb_ci_esx_server";
SGOTAssetConstants.ASSET_SYS_CLASS.HPUX_SERVER = "cmdb_ci_hpux_server";
SGOTAssetConstants.ASSET_SYS_CLASS.HYPERV_SERVER = "cmdb_ci_hyper_v_server";
SGOTAssetConstants.ASSET_SYS_CLASS.SOLARIS_SERVER = "cmdb_ci_solaris_server";
SGOTAssetConstants.ASSET_SYS_CLASS.OSX_SERVER = "cmdb_ci_osx_server";
SGOTAssetConstants.ASSET_SYS_CLASS.HANDHELD_COMPUTING_DEVICE = "cmdb_ci_handheld_computing";

SGOTAssetConstants.ASSET_SYS_CLASS.NETWORK_GEAR = "cmdb_ci_netgear";
SGOTAssetConstants.ASSET_SYS_CLASS.INTRUSION_DETECTION_SYSTEM = "cmdb_ci_ids_network";
SGOTAssetConstants.ASSET_SYS_CLASS.IP_SWITCH = "cmdb_ci_ip_switch";
SGOTAssetConstants.ASSET_SYS_CLASS.IP_ROUTER = "cmdb_ci_ip_router";
SGOTAssetConstants.ASSET_SYS_CLASS.IP_FIREWALL = "cmdb_ci_ip_firewall";
SGOTAssetConstants.ASSET_SYS_CLASS.WIRELESS_ACCESS_POINT = "cmdb_ci_wap_network";

SGOTAssetConstants.ASSET_SYS_CLASS.PRINTER = "cmdb_ci_printer";

SGOTAssetConstants.ASSET_SYS_CLASS.IOT_DEVICE = "cmdb_ci_iot";
SGOTAssetConstants.ASSET_SYS_CLASS.IP_CAMERA = "cmdb_ci_ip_camera";
SGOTAssetConstants.ASSET_SYS_CLASS.SMART_TELEVISION = "cmdb_ci_stv";
SGOTAssetConstants.ASSET_SYS_CLASS.GAME_CONSOLE = "cmdb_ci_game_console";

SGOTAssetConstants.ASSET_SYS_CLASS.UPS = "cmdb_ci_ups";


// A singleton instance entity map containing entity type vs sys id.
// This is created to reduce the no of DB calls while getting the
// sys id of the entity type.
SGOTAssetConstants.OT_ENTITY_TYPE_VS_SYS_ID_MAP = (function(){
  var sysIdMap;

  function getInstance(){
  	var object = new Object();
  	return object;
  }

  function loadMap(){
  	var otAssetTypeRecord = new GlideRecord("cmdb_ot_entity_type");
  	otAssetTypeRecord.query();

  	while(otAssetTypeRecord.next()){
  		sysIdMap[otAssetTypeRecord.getValue("name")] = otAssetTypeRecord.getUniqueValue();
  	}
  }

  return{
  	getSysId: function(entityType){
  		if(!sysIdMap){
  			sysIdMap = getInstance();
  			loadMap();
  		}

  		if(gs.nil(entityType)){
  			return "";
  		}

  		if(gs.nil(sysIdMap[entityType])){
  			return "";
  		}

  		return sysIdMap[entityType];
  	}
  };
})();

// OS Version Vs Computer type Map
// This is to map a particular OS Version to the Computer Type.
// Used to get the computer type based on the OS Version when
// a computer is being used as HMI or Historian or etc.
SGOTAssetConstants.OSVersionVsComputerTypeMap = {
  "windows 1.0": "cmdb_ci_computer",
  "windows 1.02": "cmdb_ci_computer",
  "windows 1.03": "cmdb_ci_computer",
  "windows 1.04": "cmdb_ci_computer",
  "windows 2.03": "cmdb_ci_computer",
  "windows 2.10": "cmdb_ci_computer",
  "windows 2.11": "cmdb_ci_computer",
  "windows 3.0": "cmdb_ci_computer",
  "windows 3.1": "cmdb_ci_computer",
  "windows 3.2": "cmdb_ci_computer",
  "windows 7": "cmdb_ci_computer",
  "windows 8": "cmdb_ci_computer",
  "windows 8.1": "cmdb_ci_computer",
  "windows 10": "cmdb_ci_computer",
  "windows 95": "cmdb_ci_computer",
  "windows 98": "cmdb_ci_computer",
  "windows 2000": "cmdb_ci_computer",
  "windows for workgroups 3.11": "cmdb_ci_computer",
  "windows me": "cmdb_ci_computer",
  "windows nt 3.1": "cmdb_ci_computer",
  "windows nt 3.5": "cmdb_ci_computer",
  "windows nt 3.51": "cmdb_ci_computer",
  "windows nt 4.0": "cmdb_ci_computer",
  "windows vista": "cmdb_ci_computer",
  "windows xp": "cmdb_ci_computer",
  "windows xp professional x64 edition": "cmdb_ci_computer",
  "windows server, version 2004[8]": "cmdb_ci_win_server",
  "windows server, version 1909[9]": "cmdb_ci_win_server",
  "windows server, version 1903[9]": "cmdb_ci_win_server",
  "windows server 2019": "cmdb_ci_win_server",
  "windows server 2016": "cmdb_ci_win_server",
  "windows server 2012 r2": "cmdb_ci_win_server",
  "windows server 2012": "cmdb_ci_win_server",
  "windows server 2008 r2": "cmdb_ci_win_server",
  "windows server 2008": "cmdb_ci_win_server",
  "windows server 2003 r2": "cmdb_ci_win_server",
  "windows server 2003": "cmdb_ci_win_server",
  "windows 2000 server": "cmdb_ci_win_server",
  "windows nt 4.0 server": "cmdb_ci_win_server",
  "windows nt 3.51 server": "cmdb_ci_win_server",
  "windows nt 3.5 server": "cmdb_ci_win_server",
  "windows nt 3.1 server": "cmdb_ci_win_server"
};
// Hardware install status
SGOTAssetConstants.INSTALL_STATUS = {};
SGOTAssetConstants.INSTALL_STATUS.NONE = 0;
SGOTAssetConstants.INSTALL_STATUS.INSTALLED = 1;
SGOTAssetConstants.INSTALL_STATUS.ON_ORDER = 2;
SGOTAssetConstants.INSTALL_STATUS.IN_MAINTENANCE = 3;
SGOTAssetConstants.INSTALL_STATUS.PENDING_INSTALL = 4;
SGOTAssetConstants.INSTALL_STATUS.PENDING_REPAIR = 5;
SGOTAssetConstants.INSTALL_STATUS.IN_STOCK = 6;
SGOTAssetConstants.INSTALL_STATUS.RETIRED = 7;
SGOTAssetConstants.INSTALL_STATUS.STOLEN = 8;
SGOTAssetConstants.INSTALL_STATUS.ABSENT = 100;

// Serial Number type
SGOTAssetConstants.SERIAL_NUMBER_TYPE = {};
SGOTAssetConstants.SERIAL_NUMBER_TYPE.DEFAULT = "system";

SGOTAssetConstants.prototype = {
  initialize: function() {
  },

  type: 'SGOTAssetConstants'
};

Sys ID

d261dc1553b320105570ddeeff7b1252

Offical Documentation

Official Docs: