Skip to content

Commit

Permalink
Closes-Bug: #1648137 - Removed the generator calls from the summary p…
Browse files Browse the repository at this point in the history
…ages as its not more required since we deduce the state from Analytics now.

Closes-Bug: #1551108 - Cleaned up code. After moving alarms to analytics there were some unused code. Getting rid of it.
Closes-Bug: #1649976 - Read build info from NodeStatus for all type of nodes.

Change-Id: I7e6c26a13e52e1c3ab89bccaf027b606416da8d6
  • Loading branch information
manojgn committed Jan 25, 2017
1 parent 1712368 commit eb7e9b4
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 332 deletions.
Expand Up @@ -11,18 +11,7 @@ define(['contrail-list-model'], function(ContrailListModel) {
dataParser : monitorInfraParsers.parseAnalyticsNodesDashboardData
},
vlRemoteConfig : {
vlRemoteList : [{
getAjaxConfig : function() {
return monitorInfraUtils
.getGeneratorsAjaxConfigForInfraNodes(
'analyticsNodeDS');
},
successCallback : function(response, contrailListModel) {
monitorInfraUtils
.parseAndMergeGeneratorWithPrimaryDataForInfraNodes(
response, contrailListModel);
}
},
vlRemoteList : [
{
getAjaxConfig : function() {
var postData =
Expand Down
Expand Up @@ -7,17 +7,6 @@ define([
], function (ContrailListModel) {

var vlRemoteList = [
{
getAjaxConfig: function() {
return monitorInfraUtils
.getGeneratorsAjaxConfigForInfraNodes('configNodeDS');
},
successCallback: function(response,contrailListModel) {
monitorInfraUtils
.parseAndMergeGeneratorWithPrimaryDataForInfraNodes(
response,contrailListModel);
}
},
{
getAjaxConfig: function(responseJSON) {
return monitorInfraUtils.getAjaxConfigForInfraNodesCpuStats(
Expand Down
Expand Up @@ -6,17 +6,6 @@ define([
'contrail-list-model'
], function (ContrailListModel) {
var vlRemoteConfig = [
{
getAjaxConfig: function() {
return monitorInfraUtils
.getGeneratorsAjaxConfigForInfraNodes('controlNodeDS');
},
successCallback: function(response,contrailListModel) {
monitorInfraUtils
.parseAndMergeGeneratorWithPrimaryDataForInfraNodes(
response,contrailListModel);
}
},
{
getAjaxConfig: function(responseJSON) {
return monitorInfraUtils.getAjaxConfigForInfraNodesCpuStats(
Expand Down
Expand Up @@ -5,16 +5,7 @@
define(['contrail-list-model'], function(ContrailListModel) {
var VRouterListModel = function() {
var vlRemoteConfig = {
vlRemoteList: [{
getAjaxConfig: function(responseJSON) {
return monitorInfraUtils.getGeneratorsAjaxConfigForInfraNodes(
'computeNodeDS',responseJSON);
},
successCallback: function(response, contrailListModel) {
monitorInfraUtils.parseAndMergeGeneratorWithPrimaryDataForInfraNodes(
response, contrailListModel);
}
},
vlRemoteList: [
{
getAjaxConfig: function(responseJSON) {
return monitorInfraUtils.getAjaxConfigForInfraNodesCpuStats(
Expand Down

Large diffs are not rendered by default.

136 changes: 19 additions & 117 deletions webroot/monitor/infrastructure/common/ui/js/utils/monitor.infra.utils.js
Expand Up @@ -219,55 +219,24 @@ define([
msg: infraAlertMsgs['NTP_UNSYNCED_ERROR']
}, infoObj));
}
if(obj['isUveMissing'] == true)
alertsList.push($.extend({}, {
//ifmap down alerts for control node
if(obj['isIfmapDown']) {
alertsList.push($.extend({
sevLevel: sevLevels['ERROR'],
msg: infraAlertMsgs['UVE_MISSING']
msg: infraAlertMsgs['IFMAP_DOWN'],
timeStamp: obj['ifmapDownAt']
}, infoObj));
if(obj['isConfigMissing'] == true)
}
if(obj['downXMPPPeerCnt'] > 0)
alertsList.push($.extend({}, {
sevLevel: sevLevels['ERROR'],
msg: infraAlertMsgs['CONFIG_MISSING']
sevLevel: sevLevels['WARNING'],
msg: infraAlertMsgs['XMPP_PEER_DOWN'].format(obj['downXMPPPeerCnt'])
}, infoObj));
if(obj['downBgpPeerCnt'] > 0)
alertsList.push($.extend({}, {
sevLevel: sevLevels['WARNING'],
msg: infraAlertMsgs['BGP_PEER_DOWN'].format(obj['downBgpPeerCnt'])
}, infoObj));
if(obj['isUveMissing'] == false) {
//ifmap down alerts for control node
if(obj['isIfmapDown']) {
alertsList.push($.extend({
sevLevel: sevLevels['ERROR'],
msg: infraAlertMsgs['IFMAP_DOWN'],
timeStamp: obj['ifmapDownAt']
}, infoObj));
}
if(obj['isPartialUveMissing'] == true)
alertsList.push($.extend({}, {
sevLevel: sevLevels['INFO'],
msg: infraAlertMsgs['PARTIAL_UVE_MISSING']
}, infoObj));
if(obj['downXMPPPeerCnt'] > 0)
alertsList.push($.extend({}, {
sevLevel: sevLevels['WARNING'],
msg: infraAlertMsgs['XMPP_PEER_DOWN'].format(obj['downXMPPPeerCnt'])
}, infoObj));
if(obj['downBgpPeerCnt'] > 0)
alertsList.push($.extend({}, {
sevLevel: sevLevels['WARNING'],
msg: infraAlertMsgs['BGP_PEER_DOWN'].format(obj['downBgpPeerCnt'])
}, infoObj));
}
//Alerts that are applicable only when both UVE and config data are present
if(obj['isUveMissing'] == false && obj['isConfigMissing'] == false) {
if(typeof(obj['totalBgpPeerCnt']) == "number" &&
obj['configuredBgpPeerCnt'] != obj['totalBgpPeerCnt'])
alertsList.push($.extend({}, {
sevLevel: sevLevels['WARNING'],
msg: infraAlertMsgs['BGP_CONFIG_MISMATCH']
}, infoObj));
if(obj['uveCfgIPMisMatch'])
alertsList.push($.extend({}, {
sevLevel: sevLevels['ERROR'],
msg: infraAlertMsgs['CONFIG_IP_MISMATCH']
}, infoObj));
}
return alertsList.sort(dashboardUtils.sortInfraAlerts);
},
processConfigNodeAlerts : function(obj) {
Expand All @@ -283,20 +252,6 @@ define([
sevLevel: sevLevels['ERROR'],
msg: infraAlertMsgs['NTP_UNSYNCED_ERROR']
}, infoObj));
if(obj['isUveMissing'] == true)
alertsList.push($.extend({}, {
sevLevel: sevLevels['ERROR'],
msg: infraAlertMsgs['UVE_MISSING']
}, infoObj));
// if(obj['isConfigMissing'] == true)
// alertsList.push($.extend({},{sevLevel:sevLevels['ERROR'],msg:infraAlertMsgs['CONFIG_MISSING']},infoObj));
if(obj['isUveMissing'] == false){
if(obj['isPartialUveMissing'] == true)
alertsList.push($.extend({}, {
sevLevel: sevLevels['INFO'],
msg: infraAlertMsgs['PARTIAL_UVE_MISSING']
}, infoObj));
}
return alertsList.sort(dashboardUtils.sortInfraAlerts);
},
processAnalyticsNodeAlerts : function(obj) {
Expand All @@ -313,20 +268,6 @@ define([
msg: infraAlertMsgs['NTP_UNSYNCED_ERROR']
}, infoObj));
}
if(obj['isUveMissing'] == true){
alertsList.push($.extend({}, {
sevLevel: sevLevels['ERROR'],
msg: infraAlertMsgs['UVE_MISSING']
}, infoObj));
}
if(obj['isUveMissing'] == false) {
if(obj['isPartialUveMissing'] == true){
alertsList.push($.extend({}, {
sevLevel: sevLevels['INFO'],
msg: infraAlertMsgs['PARTIAL_UVE_MISSING']
}, infoObj));
}
}
if(obj['errorStrings'] != null && obj['errorStrings'].length > 0){
$.each(obj['errorStrings'],function(idx,errorString){
alertsList.push($.extend({}, {
Expand All @@ -352,21 +293,6 @@ define([
msg: infraAlertMsgs['NTP_UNSYNCED_ERROR']
}, infoObj));
}
if(obj['isUveMissing'] == true){
alertsList.push($.extend({}, {
sevLevel: sevLevels['ERROR'],
msg: infraAlertMsgs['UVE_MISSING']
}, infoObj));
}
// if(obj['isConfigMissing'] == true){
// alertsList.push($.extend({},{sevLevel:sevLevels['ERROR'],msg:infraAlertMsgs['CONFIG_MISSING']},infoObj));
// }
if(obj['isUveMissing'] == false && obj['isPartialUveMissing'] == true){
alertsList.push($.extend({}, {
sevLevel: sevLevels['INFO'],
msg: infraAlertMsgs['PARTIAL_UVE_MISSING']
}, infoObj));
}
if(obj['usedPercentage'] >= 70 && obj['usedPercentage'] < 90){
alertsList.push($.extend({}, {
sevLevel: sevLevels['WARNING'],
Expand Down Expand Up @@ -519,25 +445,15 @@ define([

self.getConfigNodeColor = function (d,obj) {
obj= ifNull(obj,{});
var nodeColor;
if(cowu.getAlarmsFromAnalytics) {
nodeColor = coreAlarmUtils.getNodeColor(obj);
} else {
nodeColor = coreAlarmUtils.getNodeColor(obj);
}
var nodeColor = coreAlarmUtils.getNodeColor(obj);
if(nodeColor != false)
return nodeColor;
return cowc.COLOR_SEVERITY_MAP['blue'];
};

self.getControlNodeColor = function (d,obj) {
obj= ifNull(obj,{});
var nodeColor;
if(cowu.getAlarmsFromAnalytics) {
nodeColor = coreAlarmUtils.getNodeColor(obj);
} else {
nodeColor = coreAlarmUtils.getNodeColor(obj);
}
var nodeColor = coreAlarmUtils.getNodeColor(obj);
if(nodeColor != false)
return nodeColor;
//If connected to atleast one XMPP Peer
Expand All @@ -549,12 +465,7 @@ define([

self.getDatabaseNodeColor = function (d,obj) {
obj= ifNull(obj,{});
var nodeColor;
if(cowu.getAlarmsFromAnalytics) {
nodeColor = coreAlarmUtils.getNodeColor(obj);
} else {
nodeColor = coreAlarmUtils.getNodeColor(obj);
}
var nodeColor = coreAlarmUtils.getNodeColor(obj);
if(nodeColor != false)
return nodeColor;
return cowc.COLOR_SEVERITY_MAP['blue'];
Expand All @@ -563,23 +474,14 @@ define([
self.getAnalyticsNodeColor = function (d, obj) {
obj= ifNull(obj,{});
var nodeColor;
if(cowu.getAlarmsFromAnalytics) {
nodeColor = coreAlarmUtils.getNodeColor(obj);
} else {
nodeColor = coreAlarmUtils.getNodeColor(obj);
}
var nodeColor = coreAlarmUtils.getNodeColor(obj);
if(nodeColor != false)
return nodeColor;
return cowc.COLOR_SEVERITY_MAP['blue'];
};

self.getvRouterColor = function(d,obj) {
var nodeColor;
if(cowu.getAlarmsFromAnalytics) {
nodeColor = coreAlarmUtils.getNodeColor(obj);
} else {
nodeColor = coreAlarmUtils.getNodeColor(obj);
}
var nodeColor = coreAlarmUtils.getNodeColor(obj);
if(nodeColor != false)
return nodeColor;
obj = ifNull(obj,{});
Expand Down
Expand Up @@ -269,7 +269,7 @@ function getvRouterDetails (req, res, appData)
'VrouterAgent:build_info',
'VrouterAgent:platform',
'VrouterStatsAgent', 'NodeStatus',
'UVEAlarms'];
'UVEAlarms','ContrailConfig'];
}

opApiServer.apiPost(url, postData, appData,
Expand Down

0 comments on commit eb7e9b4

Please sign in to comment.