#!/usr/bin/php
createInstance($amo_id, $req_par, $id);
if($ret == GenericAdmin::EC_OK)
print "Instance of class $amo_id with id $id created.\n";
elseif ($ret == GenericAdmin::EC_DUPL_INST)
print "Instance of class $amo_id with id $id already existing.\n";
else
throw new Exception("Instance creation result: $ret");
return $id;
}
// main
try {
// check SysAl-Path
//$path = preg_replace("/.Test.*php/", "", __FILE__);
if(file_exists("link_to_sysal/AlarmManagement/AlarmManagement.php"))
// test environment
set_include_path("link_to_sysal" . PATH_SEPARATOR . get_include_path());
elseif (file_exists("/usr/share/php/SysAl/AlarmManagement/AlarmManagement.php"))
// production environment
set_include_path("/usr/share/php/SysAl" . PATH_SEPARATOR . get_include_path());
else
throw new Exception("Cannot find SystemAlarming environent");
// create Interface
require_once 'AlarmManagement/AlarmManagement.php';
$if = new AlarmManagement();
// create AMHs
$req_par = 'FW_AMH_Logginghost_name/LoggerHostfalseLoggingStub';
$amh_logging = createInstance($if, 1, $req_par);
$req_par = 'FW_AMH_SOAPhost_name/localhostfalseRemoteAlarmingAsync';
$amh_soap = createInstance($if, 1, $req_par);
$req_par = 'FW_AMH_DEADhost_name/google.comfalseRemoteAlarmingAsync';
$amh_dead = createInstance($if, 1, $req_par);
$req_par = 'FW_AMH_MAILhost_name/info@wagnertech.defalseEmailAlarming';
$amh_mail = createInstance($if, 1, $req_par);
// create AEDs
$req_par = 'FW_AED_Forwardfree_form/FW_Forward';
$aed_forward = createInstance($if, 2, $req_par);
$req_par = 'FW_AED_Dead_Forwardfree_form/FW_Dead_Forward';
$aed_dead = createInstance($if, 2, $req_par);
$req_par = 'FW_AED_Balancefree_form/FW_Balance';
$aed_balance = createInstance($if, 2, $req_par);
// create ABM
$req_par = "FW_ABM_Forwardinclude1$aed_balance2$amh_soap$amh_mail";
createInstance($if, 5, $req_par);
// create AFI
$req_par = "FW_AFI_Forwardunlockedinclude1$aed_forward1$amh_logging";
createInstance($if, 6, $req_par);
$req_par = "FW_AFI_Dead_Forwardunlockedinclude1$aed_dead1$amh_dead";
createInstance($if, 6, $req_par);
}
catch (Exception $e) {
echo ($e);
throw $e;
}