cmdbAbstractObjectbizmodel,searchable,structurefalseautoincrementorganizationidnamefalsecodetrueactiveinactivestatusactivetrueparent_idtrueDEL_MANUALparent_idname10203040102030401020cmdbAbstractObjectbizmodel,searchable,structurefalseautoincrementlocationidimages/location.pngnamefalseactiveinactivestatusactivetrueorg_idOrganizationfalseDEL_MANUALorg_idnameaddresstruepostal_codetruecitytruecountrytrueparent_idtrueDEL_MANUALorg_id]]>parent_idnameContactlocation_id00InfrastructureCIlocation_id0010203040506070809010010203040506010203040cmdbAbstractObjectbizmodel,searchable,structuretrueautoincrementcontactidfinalclassimages/team.pngnamefalseactiveinactivestatusactivefalseorg_idOrganizationfalseDEL_MANUALorg_idnameemailfalsephonetrueorg_id]]>location_idLocationtrueDEL_MANUALlocation_idnamelnkContractToContactcontact_id00contract_idlnkServiceToContactcontact_id00service_idlnkTicketToContactcontact_id00ticket_idlnkCIToContactcontact_id00ci_idlnkTeamToContactcontact_id00team_id102030405060708090100110102030405060102030405060Contactbizmodel,searchable,structurefalseautoincrementpersonidimages/person.pngfirst_namefalseemployee_idtrue102030405060708090100110120130102030405060708010203040506070Contactbizmodel,searchable,structurefalseautoincrementteamidimages/team.pnglnkTeamToContactteam_id00contact_id1020304050607080901001101201020304050601020304050cmdbAbstractObject1bizmodel,searchable,structurefalseautoincrementlnkteamtocontactidteam_idTeamfalseDEL_AUTOteam_idnamecontact_idContactfalseDEL_AUTOcontact_idnamecontact_idlocation_idcontact_idlocation_namecontact_idemailcontact_idphoneroletrue102030102030102030405060cmdbAbstractObjectbizmodel,searchable,documentationtrueautoincrementdocumentidfinalclassimages/document.pngnamefalseorg_idOrganizationfalseDEL_MANUALorg_idnamedescriptiontruecontractnetworkmappresentationtrainingwhitePaperworkinginstructionstypepresentationtruedraftpublishedobsoletestatusdraftfalselnkContractToDocdocument_id00contract_idlnkServiceToDocdocument_id00service_idlnkTicketToDocdocument_id00ticket_idlnkCIToDocdocument_id00ci_id1020304050607080901020304050102030Documentbizmodel,searchable,documentationfalseautoincrementexternaldocidimages/document.pngurlfalse_blank10203040506070809010010203040506010203040Documentbizmodel,searchable,documentationfalseautoincrementnoteidimages/document.pngnotetrue10203040506070809010010203040506010203040Documentbizmodel,searchable,documentationfalseautoincrementfiledocidimages/document.png/**
* Overload the display of the properties to add a tab (the first one)
* with the preview of the document
*/falsepublicOverload-cmdbAbstractObjectadd('');
}
return $aFieldsMap;
}]]>102030405060708090100102030405010203040cmdbAbstractObjectbizmodel,searchable,configmgmtfalseautoincrementlicenceidimages/licence.pngproviderfalseorg_idOrganizationfalseDEL_MANUALorg_idnameproductfalsenamefalsestarttrueendtruelicence_keytruescopetrueusage_limittrueSoftwareInstancelicence_id0010203040506070809010010203040506070801020304050cmdbAbstractObjectbizmodel,searchable,configmgmtfalseautoincrementsubnetidimages/subnet.pngdescriptiontrueorg_idOrganizationfalseDEL_MANUALorg_idnameipfalseip_maskfalsefalsepublicOverload-cmdbAbstractObjectSetCurrentTab(Dict::S('Class:Subnet/Tab:IPUsage'));
$bit_ip = ip2long($this->Get('ip'));
$bit_mask = ip2long($this->Get('ip_mask'));
$iIPMin = sprintf('%u', ($bit_ip & $bit_mask) | 1); // exclude the first one: identifies the subnet itself
$iIPMax = sprintf('%u', (($bit_ip | (~$bit_mask))) & 0xfffffffe); // exclude the last one : broadcast address
$sIPMin = long2ip($iIPMin);
$sIPMax = long2ip($iIPMax);
$oPage->p(Dict::Format('Class:Subnet/Tab:IPUsage-explain', $sIPMin, $sIPMax));
$oIfFilter = DBObjectSearch::FromOQL("SELECT NetworkInterface AS if WHERE INET_ATON(if.ip_address) >= INET_ATON('$sIPMin') AND INET_ATON(if.ip_address) <= INET_ATON('$sIPMax')");
$oIfSet = new CMDBObjectSet($oIfFilter);
$oBlock = new DisplayBlock($oIfFilter, 'list', false);
$oBlock->Display($oPage, 'nwif', array('menu' => false));
$iCountUsed = $oIfSet->Count();
$iCountRange = $iIPMax - $iIPMin; // On 32-bit systems the substraction will be computed using floats for values greater than PHP_MAX_INT;
$iFreeCount = $iCountRange - $iCountUsed;
$oPage->SetCurrentTab(Dict::S('Class:Subnet/Tab:FreeIPs'));
$oPage->p(Dict::Format('Class:Subnet/Tab:FreeIPs-count', $iFreeCount));
$oPage->p(Dict::S('Class:Subnet/Tab:FreeIPs-explain'));
$aUsedIPs = $oIfSet->GetColumnAsArray('ip_address', false);
$iAnIP = $iIPMin;
$iFound = 0;
while (($iFound < min($iFreeCount, 10)) && ($iAnIP <= $iIPMax))
{
$sAnIP = long2ip($iAnIP);
if (!in_array($sAnIP, $aUsedIPs))
{
$iFound++;
$oPage->p($sAnIP);
}
else
{
}
$iAnIP++;
}
}
}]]>1020304010203040102030cmdbAbstractObjectbizmodel,searchable,configmgmtfalseautoincrementpatchidimages/patch.pngnamefalsedescriptiontruetarget_swtrueversiontrueapplicationossecurityservicepacktypesecurityfalselnkPatchToCIpatch_id00ci_id1020304050601020304050102030cmdbAbstractObjectbizmodel,searchable,configmgmttrueautoincrementsoftwareidfinalclassimages/software.pngnamefalsedescriptiontrue1020102010Softwarebizmodel,searchable,configmgmtfalseautoincrementsoftware_appidimages/software.pngApplicationInstancesoftware_id00102030102010Softwarebizmodel,searchable,configmgmtfalseautoincrementsoftware_dbidimages/software.pngDBServerInstancesoftware_id00102030102010cmdbAbstractObject1bizmodel,configmgmtfalseautoincrementlnkpatchtociidpatch_idPatchfalseDEL_AUTOpatch_idnameci_idDevicefalseDEL_AUTOci_idnameci_idstatus1020301020102030cmdbAbstractObjectbizmodel,searchable,configmgmttrueautoincrementfunctionalciidfinalclassimages/server.pngnamefalseimplementationproductionobsoletestatusimplementationfalseorg_idOrganizationfalseDEL_MANUALorg_idnamelowmediumhighimportancemediumfalselnkCIToContactci_id00contact_idlnkCIToDocci_id00document_idlnkSolutionToCIci_id00solution_idlnkContractToCIci_id00contract_idlnkTicketToCIci_id00ticket_idtruepublicOverload-DBObject array("sQuery"=>"SELECT Contact AS c JOIN lnkCIToContact AS l1 ON l1.contact_id = c.id WHERE l1.ci_id = :this->id", "bPropagate"=>true, "iDistance"=>3),
"solution" => array("sQuery"=>"SELECT ApplicationSolution AS s JOIN lnkSolutionToCI AS l1 ON l1.solution_id = s.id WHERE l1.ci_id = :this->id", "bPropagate"=>true, "iDistance"=>2),
);
return array_merge($aRels, parent::GetRelationQueries($sRelCode));
break;
default:
return parent::GetRelationQueries($sRelCode);
}
}]]>1020304050607080901020304010203040FunctionalCIbizmodel,searchable,configmgmttrueautoincrementsoftwareinstanceidimages/application.pngorg_id]]>device_idDevicefalseDEL_MANUALdevice_idnameorg_id]]>licence_idLicencetrueDEL_MANUALlicence_idnameversiontruedescriptiontruefalsepublicOverload-DBObject public function ComputeValues()
{
}truepublicOverload-DBObject array("sQuery"=>"SELECT DatabaseInstance AS db WHERE db.db_server_instance_id = :this->id", "bPropagate"=>true, "iDistance"=>5),
);
return array_merge($aRels, parent::GetRelationQueries($sRelCode));
break;
case 'depends on':
$aRels = array(
"applications" => array("sQuery"=>"SELECT Device JOIN SoftwareInstance AS app ON app.device_id = Device.id WHERE app.id = :this->id", "bPropagate"=>true, "iDistance"=>5),
);
return array_merge($aRels, parent::GetRelationQueries($sRelCode));
break;
default:
return parent::GetRelationQueries($sRelCode);
}
}]]>102030405060708090100110120130102030405060102030405060SoftwareInstancebizmodel,searchable,configmgmtfalseautoincrementsoftwareinstance_dbserveridimages/database.pngsoftware_idDBServerfalseDEL_MANUALsoftware_idnameDatabaseInstancedb_server_instance_id0010203040506070809010011012013014015010203040506070102030405060SoftwareInstancebizmodel,searchable,configmgmtfalseautoincrementsoftwareinstance_applicationidimages/application.pngsoftware_idApplicationfalseDEL_MANUALsoftware_idname10203040506070809010011012013014010203040506070102030405060FunctionalCIbizmodel,searchable,configmgmtfalseautoincrementdatabaseinstanceidimages/database-instance.pngorg_id]]>db_server_instance_idDBServerInstancefalseDEL_MANUALdb_server_instance_idnamedb_server_instance_idversiondescriptiontruetruepublicOverload-DBObject array("sQuery"=>"SELECT DBServerInstance AS db_server_inst JOIN DatabaseInstance AS db ON db.db_server_instance_id = db_server_inst.id WHERE db.id = :this->id", "bPropagate"=>true, "iDistance"=>5),
);
return array_merge($aRels, parent::GetRelationQueries($sRelCode));
break;
default:
return parent::GetRelationQueries($sRelCode);
}
}]]>1020304050607080901001101201020304050601020304050FunctionalCIbizmodel,searchable,configmgmtfalseautoincrementapplicationsolutionidimages/solution.pngdescriptiontruelnkSolutionToCIsolution_id00ci_idlnkProcessToSolutionsolution_id00process_idtruepublicOverload-DBObject array("sQuery"=>"SELECT BusinessProcess AS p JOIN lnkProcessToSolution AS l1 ON l1.process_id = p.id WHERE l1.solution_id = :this->id", "bPropagate"=>true, "iDistance"=>3),
);
return array_merge($aRels, parent::GetRelationQueries($sRelCode));
break;
case "depends on":
$aRels = array(
"solution" => array("sQuery"=>"SELECT FunctionalCI AS ci JOIN lnkSolutionToCI AS l1 ON l1.ci_id = ci.id WHERE l1.solution_id = :this->id", "bPropagate"=>true, "iDistance"=>2),
);
return array_merge($aRels, parent::GetRelationQueries($sRelCode));
break;
default:
return parent::GetRelationQueries($sRelCode);
}
}]]>10203040506070809010011012010203040102030FunctionalCIbizmodel,searchable,configmgmtfalseautoincrementbusinessprocessidimages/business-process.pngdescriptiontruelnkProcessToSolutionprocess_id00solution_idtruepublicOverload-DBObject array("sQuery"=>"SELECT ApplicationSolution AS app JOIN lnkProcessToSolution AS l1 ON l1.solution_id = app.id WHERE l1.process_id = :this->id", "bPropagate"=>true, "iDistance"=>3),
);
return array_merge($aRels, parent::GetRelationQueries($sRelCode));
break;
default:
return parent::GetRelationQueries($sRelCode);
}
}]]>1020304050607080901001020304050102030FunctionalCIbizmodel,searchable,configmgmttrueautoincrementconnectableciidimages/server.pngbrandtruemodeltrueserial_numbertrueasset_reftrue10203040506070809010011012013010203040506070801020304050607080ConnectableCIbizmodel,searchable,configmgmtfalseautoincrementnetworkinterfaceidimages/interface.pngorg_id]]>device_idDevicefalseDEL_AUTOdevice_idnamebackuplogicalportprimarysecondarylogical_typeprimaryfalseatmethernetframerelayvlanphysical_typeethernetfalseip_addresstrueip_masktruemac_addresstruespeedtruefullhalfautounknownduplexfulltrueorg_id]]>connected_ifNetworkInterfacetrueDEL_AUTOconnected_ifnameconnected_ifdevice_idconnected_ifdevice_nameuplinkdownlinklink_typeuplinkfalseconnected_ifdevice_id_friendlynametruepublicOverload-DBObject array("sQuery"=>"SELECT Device AS dev JOIN NetworkInterface AS if1 ON if1.device_id = dev.id JOIN NetworkInterface AS if2 ON if2.connected_if = if1.id WHERE if2.id = :this->id AND if2.link_type='downlink'", "bPropagate"=>true, "iDistance"=>5),
);
return array_merge($aRels, parent::GetRelationQueries($sRelCode));
break;
default:
return parent::GetRelationQueries($sRelCode);
}
}]]>falseprotectedOverload-DBObjectm_aOrigValues['connected_if']; // The interface this interface was connected to
if ($iPrevTargetIf == $this->Get('connected_if'))
{
return;
}
if ($iPrevTargetIf != 0)
{
// The interface was previosuly connected to another interface. Make sure that we reset this 'previously connected interface'
$oPrevConnectedIf = MetaModel::GetObject('NetworkInterface', $iPrevTargetIf, false);
if (!is_null($oPrevConnectedIf))
{
if ($oPrevConnectedIf->Get('connected_if') == $this->GetKey()) // protection against reentrance
{
$oPrevConnectedIf->Set('connected_if', 0);
$oPrevConnectedIf->DBUpdate();
}
}
}
$oConnIf = MetaModel::GetObject('NetworkInterface', $this->Get('connected_if'), false /* no exception if not found */);
if (!is_null($oConnIf))
{
$sLink = $this->Get('link_type');
$sConnLink = ($sLink == 'uplink') ? 'downlink' : 'uplink';
if (($oConnIf->Get('connected_if') != $this->GetKey()) || ($sConnLink != $oConnIf->Get('link_type')))
{
// Connect the remote interface to the current one
$oConnIf->Set('connected_if', $this->GetKey());
$oConnIf->Set('link_type', $sConnLink);
// Need to backup the current change, because it is reset when DBUpdateTracked is complete
$oConnIf->DBUpdate();
}
}
}]]>falseprotectedOverload-DBObjectUpdateConnectedInterface();
parent::AfterInsert();
}]]>falseprotectedOverload-DBObjectUpdateConnectedInterface();
parent::AfterUpdate();
}]]>1020304050607080901001101201301401501601701801902002102202302401020304050607080901001101020304050607080ConnectableCIbizmodel,searchable,configmgmttrueautoincrementdeviceidimages/server.pngNetworkInterfacedevice_id00truepublicOverload-DBObject array("sQuery"=>"SELECT SoftwareInstance AS app WHERE app.device_id = :this->id", "bPropagate"=>true, "iDistance"=>5),
"connected_devices" => array("sQuery"=>"SELECT Device AS dev JOIN NetworkInterface AS if1 ON if1.device_id = dev.id JOIN NetworkInterface AS if2 ON if2.connected_if = if1.id WHERE if2.device_id = :this->id AND if2.link_type='downlink'", "bPropagate"=>true, "iDistance"=>5),
);
return array_merge($aRels, parent::GetRelationQueries($sRelCode));
break;
case "depends on":
$aRels = array(
"connected_devices" => array("sQuery"=>"SELECT Device AS dev JOIN NetworkInterface AS if1 ON if1.device_id = dev.id JOIN NetworkInterface AS if2 ON if2.connected_if = if1.id WHERE if2.device_id = :this->id AND if2.link_type='uplink'", "bPropagate"=>true, "iDistance"=>5),
);
return array_merge($aRels, parent::GetRelationQueries($sRelCode));
break;
default:
return parent::GetRelationQueries($sRelCode);
}
}]]>10203040506070809010011012013014010203040506070801020304050607080Devicebizmodel,searchable,configmgmtfalseautoincrementpcidimages/laptop.pngcputrueramtruehddtrueos_familytrueos_versiontrueSoftwareInstancedevice_id00lnkPatchToCIci_id00patch_id102030405060708090100110120130140150160170180190200210102030405060708090100102030405060Devicebizmodel,searchable,configmgmttrueautoincrementmobileciidimages/mobile-phone.png10203040506070809010011012013014010203040506070801020304050MobileCIbizmodel,searchable,configmgmtfalseautoincrementmobilephoneidimages/mobile-phone.pngnumbertrueIMIEtruehw_pintrue1020304050607080901001101201301401501601701020304050607080901001020304050Devicebizmodel,searchable,configmgmttrueautoincrementinfrastructureciidimages/server.pngdescriptiontrueorg_id]]>location_idLocationtrueDEL_MANUALlocation_idnamelocation_detailstruemanagement_iptruedefault_gatewaytrue102030405060708090100110120130140150160170180190102030405060708090100110102030405060InfrastructureCIbizmodel,searchable,configmgmtfalseautoincrementnetworkdeviceidimages/switch.pngwanacceleratorfirewallhubloadbalancerrouterswitchtypeswitchtrueios_versiontrueramtruesnmp_readtruesnmp_writetrue10203040506070809010011012013014015016017018019020021022023024010203040506070809010011012013010203040506070InfrastructureCIbizmodel,searchable,configmgmtfalseautoincrementserveridimages/server.pngcputrueramtruehddtrueos_familytrueos_versiontrueSoftwareInstancedevice_id00lnkPatchToCIci_id00patch_id10203040506070809010011012013014015016017018019020021022023024025026010203040506070809010011012013010203040506070InfrastructureCIbizmodel,searchable,configmgmtfalseautoincrementprinteridimages/printer.pngmopierprintertypeprintertruelaserinkjettracertechnologylasertrue102030405060708090100110120130140150160170180190200210102030405060708090100110120130140150102030405060708090100110120cmdbAbstractObjectbizmodel,searchable,configmgmtfalseautoincrementgroupidimages/group.pngnamefalseproductionimplementationobsoletestatusimplementationfalseorg_idOrganizationfalseDEL_MANUALorg_idnamedescriptiontruetypetrueparent_idtrueDEL_MANUALparent_idnamelnkGroupToCIgroup_id00ci_id102030405060701020304010203040cmdbAbstractObject1bizmodel,configmgmtfalseautoincrementlnkgrouptociidgroup_idGroupfalseDEL_MANUALgroup_idnameci_idFunctionalCIfalseDEL_MANUALci_idnameci_idstatusreasontrue1020304010203010203040cmdbAbstractObject1bizmodel,configmgmtfalseautoincrementlnkcitodocidci_idFunctionalCIfalseDEL_AUTOci_idnameci_idstatusdocument_idDocumentfalseDEL_AUTOdocument_idnamedocument_idtypedocument_idstatus102030405010201020304050cmdbAbstractObject1bizmodel,configmgmtfalseautoincrementlnkcitocontactidimages/contact.pngci_idFunctionalCIfalseDEL_AUTOci_idnameci_idstatuscontact_idContactfalseDEL_AUTOcontact_idnamecontact_idemailroletrue10203040501020301020304050cmdbAbstractObject1bizmodel,configmgmtfalseautoincrementlnksolutiontociidsolution_idApplicationSolutionfalseDEL_AUTOsolution_idnameci_idFunctionalCIfalseDEL_AUTOci_idnameci_idstatusutilitytrue1020304010203010203040cmdbAbstractObject1bizmodel,configmgmtfalseautoincrementlnkprocesstosolutionidsolution_idApplicationSolutionfalseDEL_AUTOsolution_idnameprocess_idBusinessProcessfalseDEL_AUTOprocess_idnamereasontrue102030102030102030