var createAlarm = function(alarmid,rid,soid,poid,st){
var rack = findFromClient(
'R_ID'
,rid);
var alarm;
var s;
if
(rack) {
s = findOidfromChildren(rack, soid);
}
else
{
//当Router没有放到机柜中时,单独再找一下
s = findFromClient(
'H_ID'
,soid);
if
(!s){
s = findFromClient(
'oid'
,soid);
}
}
if
(s) {
var p = findOidfromChildren(s, poid);
if
(p) {
alarm =
new
mono.Alarm(alarmid, p.getId(), st);
}
else
{
alarm =
new
mono.Alarm(alarmid, s.getId(), st);
}
}
else
if
(rack){
alarm =
new
mono.Alarm(alarmid, rack.getId(), st);
}
if
(alarm){
network.getDataBox().getAlarmBox().add(alarm);
}
}
var addAlarm = function(rack_id,host_id,port_id,severity_id){
var severities = mono.AlarmSeverity.severities;
var severity = severities.get(severity_id);
createAlarm(
'c'
,rack_id,host_id,port_id,severity);
}