From a6ba6a564ed9bc1f9535a19f2a198a750b156b00 Mon Sep 17 00:00:00 2001 From: Naga Kiran Date: Fri, 18 Jul 2014 17:17:30 +0530 Subject: [PATCH 1/9] Updated menu.xml to make it compatible with the format to support multple resources for each feature --- webroot/menu.xml | 862 ++++++++++++++++++++++++++++------------------- 1 file changed, 507 insertions(+), 355 deletions(-) diff --git a/webroot/menu.xml b/webroot/menu.xml index 6e6e6be3c..88544fffd 100644 --- a/webroot/menu.xml +++ b/webroot/menu.xml @@ -9,19 +9,23 @@ If any role/orchModel tag is with negation(!) value then every one has access to and need to add the iconClass tag wherever we need to show some icons --> - + + + + monitor + icon-bar-chart + - - monitor - icon-bar-chart - - + + /monitor/infra/common/ui monitor_infra_constants.js monitor_infra_utils.js monitor_infra_common.view monitor_infra_common.css + + icon-desktop @@ -36,10 +40,14 @@ and need to add the iconClass tag wherever we need to show some icons mon_infra_dashboard + + /monitor/infra/dashboard/ui monitor_infra_dashboard.view monitor_infra_dashboard.js infraMonitorDashboardView + + vRouters @@ -48,6 +56,8 @@ and need to add the iconClass tag wherever we need to show some icons mon_infra_control + + /monitor/infra/controlnode/ui monitor_infra_controlnode.view monitor_infra_controlnode.js @@ -56,11 +66,15 @@ and need to add the iconClass tag wherever we need to show some icons monitor_infra_controlnode_peers.js monitor_infra_controlnode_routes.js ctrlNodesView + + Monitor Control Nodes mon_infra_vrouter + + /monitor/infra/vrouter/ui monitor_infra_vrouter.view monitor_infra_vrouter.js @@ -72,11 +86,15 @@ and need to add the iconClass tag wherever we need to show some icons monitor_infra_vrouter_flows.js monitor_infra_vrouter_routes.js cmpNodesView + + Monitor Compute Nodes mon_infra_analytics + + /monitor/infra/analyticsnode/ui monitor_infra_analyticnode.view monitor_infra_analyticnode.js @@ -85,17 +103,23 @@ and need to add the iconClass tag wherever we need to show some icons monitor_infra_analyticsnode_generators.js monitor_infra_analyticsnode_qequeries.js aNodesView + + Monitor Analytics Nodes mon_infra_config + + /monitor/infra/confignode/ui monitor_infra_confignode.view monitor_infra_confignode.js monitor_infra_confignode_summary.js monitor_infra_confignode_details.js confNodesView + + Monitor Config Nodes - - - - networking - - /monitor/tenant-network/common/ui - tenant_monitor_topology.js - tenant_monitor_utils.js - tenant_monitor_common.view - icon-sitemap - - - - mon_net_dashboard - /monitor/tenant-network/dashboard/ui - tenant_monitor_dashboard.view - tenant_monitor_dashboard.js - tenantNetworkMonitorView - - default-domain - - Networking Dashboard - - - - mon_net_projects - /monitor/tenant-network/project/ui - tenant_monitor_project.js - tenant_monitor_project.view - tenantNetworkMonitorView - - list - project - uve - - Monitor Projects - - - - mon_net_networks - /monitor/tenant-network/network/ui - tenant_monitor_network.view - tenant_monitor_network.js - tenantNetworkMonitorView - - list - network - uve - - Monitor Networks - - - - - mon_net_instances - /monitor/tenant-network/instance/ui - tenant_monitor_instance.view - tenant_monitor_instance.js - tenantNetworkMonitorView - - list - instance - uve - - Monitor instances - - - - - debug - - icon-puzzle-piece - - - - mon_debug_pcapture - /monitor/debug/packet_capture - packet_capture.js - packet_capture.view - PacketCaptureObj - Packet Capture, Analyzer - - - - - + + + + + configure + + icon-wrench + - configure - - icon-wrench - - - - - - admin - - - openstack - cloudstack - - - icon-desktop - - - - - config_infra_bgp - /config/bgp/ui - bgp_config.view - bgp_config.js - bgpConfigObj - Configure BGP Peers - - - - config_infra_fwdoptions - /config/forwardingoptions/ui - fwd_options_config.view - fwd_options_config.js - fwdOptionsConfigObj - Configure Fowarding Options - - - - config_infra_lls - /config/linklocalservices/ui - lls_config.view - lls_config.js - llsConfigObj - Configure Link Local Services - - - - + + + + + setting + icon-cog + + + admin + + + openstack + cloudstack + + + + + + icon-table + + + setting_configdb_fqname + + + + /setting/config_db + cdb_query.view + cdb_query.js + fqNameTableObj + + + + + setting_configdb_uuid + + + + /setting/config_db + cdb_query.view + cdb_query.js + uuidTableObj + + + + + + + + + query + icon-search + + + admin + + + openstack + cloudstack + + + - - setting - icon-cog - - - admin - - - openstack - cloudstack - - - - - - icon-table - - - setting_configdb_fqname - - /setting/config_db - cdb_query.view - cdb_query.js - fqNameTableObj - - - setting_configdb_uuid - - /setting/config_db - cdb_query.view - cdb_query.js - uuidTableObj - - - - + + icon-exchange + + + query_flow_series + + + + /reports + flow_queries.view + queries.view + flow_queries.js + flowSeriesObj + + + Query Flow Series + + + query_flow_records + + + + /reports + flow_queries.view + queries.view + flow_queries.js + flowRecordsObj + + + Query Flow Records + + + query_flow_queue + + + + /reports + flow_queries.view + queries.view + flow_queries.js + flowQueryQueueObj + + + Flow Query Queue + + - - query - icon-search - - - admin - - - openstack - cloudstack - - - - - - icon-exchange - - - query_flow_series - - /reports - flow_queries.view - queries.view - flow_queries.js - flowSeriesObj - Query Flow Series - - - query_flow_records - - /reports - flow_queries.view - queries.view - flow_queries.js - flowRecordsObj - Query Flow Records - - - query_flow_queue - - /reports - flow_queries.view - queries.view - flow_queries.js - flowQueryQueueObj - Flow Query Queue - - - - - - icon-hdd - - - query_log_system - - /reports - log_queries.view - queries.view - log_queries.js - systemLogsObj - Query System Logs - - - query_log_object - - /reports - log_queries.view - queries.view - log_queries.js - objectLogsObj - Query Object Logs - - - query_log_queue - - /reports - log_queries.view - queries.view - log_queries.js - logQueryQueueObj - Logs Query Queue - - - - - + + icon-hdd + + + query_log_system + + + + /reports + log_queries.view + queries.view + log_queries.js + systemLogsObj + + + Query System Logs + + + query_log_object + + + + /reports + log_queries.view + queries.view + log_queries.js + objectLogsObj + + + Query Object Logs + + + query_log_queue + + + + /reports + log_queries.view + queries.view + log_queries.js + logQueryQueueObj + + + Logs Query Queue + + - + + + + + From 7a16c39aeee1c29576541b28d77b50c5d7f57b2b Mon Sep 17 00:00:00 2001 From: Naga Kiran Date: Mon, 28 Jul 2014 15:28:24 +0530 Subject: [PATCH 2/9] Made the updateView as a local function such that it doesn't get added to global scope --- .../monitor/infra/dashboard/ui/js/monitor_infra_dashboard.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webroot/monitor/infra/dashboard/ui/js/monitor_infra_dashboard.js b/webroot/monitor/infra/dashboard/ui/js/monitor_infra_dashboard.js index 0a33c23dd..d8b25f448 100644 --- a/webroot/monitor/infra/dashboard/ui/js/monitor_infra_dashboard.js +++ b/webroot/monitor/infra/dashboard/ui/js/monitor_infra_dashboard.js @@ -188,7 +188,7 @@ function addTabs() { viewModel.data.subscribe(function(newValue) { updateView(newValue); }) - this.updateView = function(data) { + var updateView = function(data) { if(!isScatterChartInitialized('#analyticNode-bubble')) { $('#analyticNodeStats-header').initWidgetHeader({title:'Analytics Nodes',link:{hashParams:{p:'mon_infra_analytics',q:{node:'Analytics Nodes'}}}}); var chartsData = { From 87f7708304a200bdab2683cc3177779520e7d0e3 Mon Sep 17 00:00:00 2001 From: Manoj Naik Date: Wed, 23 Jul 2014 18:14:29 +0530 Subject: [PATCH 3/9] Fix for Bug : 1328085 Following changes are implemented. 1. Sort based on node color in "Host Name" column in node summary pages 2. Move "version","CPU","Memory" columns to the end 3. "Host name" column contents should be visible clearly with out wrapping. - Increased the column width to accomodate bigger hostnames. 4. For "Interfaces", have total and down count in seperate lines 12 Total 5 Down 5. Display color for all nodes in "Host Name" column. Change-Id: I258308cc2946366d26219d514e4b6d3fe1ae4252 --- .../js/monitor_infra_analyticsnode_details.js | 2 +- .../js/monitor_infra_analyticsnode_summary.js | 43 +++++++------ .../infra/common/ui/js/monitor_infra_utils.js | 6 +- .../ui/js/monitor_infra_confignode_details.js | 2 +- .../ui/js/monitor_infra_confignode_summary.js | 15 +++-- .../js/monitor_infra_controlnode_details.js | 2 +- .../js/monitor_infra_controlnode_summary.js | 57 +++++++++-------- .../ui/js/monitor_infra_dashboard.js | 6 +- .../ui/js/monitor_infra_vrouter_details.js | 2 +- .../ui/js/monitor_infra_vrouter_summary.js | 63 ++++++++++--------- 10 files changed, 107 insertions(+), 91 deletions(-) diff --git a/webroot/monitor/infra/analyticsnode/ui/js/monitor_infra_analyticsnode_details.js b/webroot/monitor/infra/analyticsnode/ui/js/monitor_infra_analyticsnode_details.js index a8d2c4874..e910dfbc2 100644 --- a/webroot/monitor/infra/analyticsnode/ui/js/monitor_infra_analyticsnode_details.js +++ b/webroot/monitor/infra/analyticsnode/ui/js/monitor_infra_analyticsnode_details.js @@ -85,7 +85,6 @@ monitorInfraAnalyticsDetailsClass = (function() { } return ips; })()}, - {lbl:'Version', value:parsedData['version'] != '-' ? parsedData['version'] : noDataStr}, {lbl:'Overall Node Status', value:overallStatus}, {lbl:'Processes', value:" "}, /*{lbl:INDENT_RIGHT+'Analytics Node Manager', value:(function(){ @@ -122,6 +121,7 @@ monitorInfraAnalyticsDetailsClass = (function() { }catch(e){ return noDataStr;} return ret; })()}, + {lbl:'Version', value:parsedData['version'] != '-' ? parsedData['version'] : noDataStr}, {lbl:'Last Log', value: (function(){ var lmsg; lmsg = getLastLogTimestamp(aNodeData,"analytics"); diff --git a/webroot/monitor/infra/analyticsnode/ui/js/monitor_infra_analyticsnode_summary.js b/webroot/monitor/infra/analyticsnode/ui/js/monitor_infra_analyticsnode_summary.js index 19c89e76c..c6de8d284 100644 --- a/webroot/monitor/infra/analyticsnode/ui/js/monitor_infra_analyticsnode_summary.js +++ b/webroot/monitor/infra/analyticsnode/ui/js/monitor_infra_analyticsnode_summary.js @@ -54,6 +54,9 @@ monitorInfraAnalyticsSummaryClass = (function() { field:"name", id:"name", name:"Host name", + sortable : { + sortBy: 'formattedValue' + }, formatter:function(r,c,v,cd,dc) { return cellTemplateLinks({cellText:'name',name:'name',statusBubble:true,rowData:dc}); }, @@ -69,7 +72,7 @@ monitorInfraAnalyticsSummaryClass = (function() { } }, cssClass: 'cell-hyperlink-blue', - minWidth:110, + minWidth:175, sortable:true }, { @@ -88,13 +91,6 @@ monitorInfraAnalyticsSummaryClass = (function() { } } }, - { - field:"version", - id:"version", - name:"Version", - sortable:true, - minWidth:110 - }, { field:"status", id:"status", @@ -114,6 +110,20 @@ monitorInfraAnalyticsSummaryClass = (function() { } } }, + { + field:"genCount", + id:"genCount", + sortable:true, + name:"Generators", + minWidth:85 + }, + { + field:"version", + id:"version", + name:"Version", + sortable:true, + minWidth:110 + }, { field:"cpu", id:"analyticsCpu", @@ -127,11 +137,11 @@ monitorInfraAnalyticsSummaryClass = (function() { }, minWidth:120, exportConfig: { - allow: true, - advFormatter: function(dc) { - return dc.cpu - } - } + allow: true, + advFormatter: function(dc) { + return dc.cpu + } + } }, { field:"memory", @@ -140,13 +150,6 @@ monitorInfraAnalyticsSummaryClass = (function() { name:"Memory", minWidth:150 }, - { - field:"genCount", - id:"genCount", - sortable:true, - name:"Generators", - minWidth:85 - } ], } }); diff --git a/webroot/monitor/infra/common/ui/js/monitor_infra_utils.js b/webroot/monitor/infra/common/ui/js/monitor_infra_utils.js index 4bc6d0009..1e18d8254 100644 --- a/webroot/monitor/infra/common/ui/js/monitor_infra_utils.js +++ b/webroot/monitor/infra/common/ui/js/monitor_infra_utils.js @@ -286,7 +286,7 @@ var infraMonitorUtils = { obj['errorIntfCnt'] = getValueByJsonPath(dValue,'VrouterAgent;down_interface_count',0); } if(obj['errorIntfCnt'] > 0){ - obj['errorIntfCntText'] = ", " + obj['errorIntfCnt'] + " Down"; + obj['errorIntfCntText'] = "
" + obj['errorIntfCnt'] + " Down"; } else { obj['errorIntfCntText'] = ""; } @@ -351,7 +351,7 @@ var infraMonitorUtils = { obj['downBgpPeerCnt'] = obj['totalBgpPeerCnt'] - obj['upBgpPeerCnt']; } if(obj['downXMPPPeerCnt'] > 0){ - obj['downXMPPPeerCntText'] = ", " + obj['downXMPPPeerCnt'] + " Down"; + obj['downXMPPPeerCntText'] = "
" + obj['downXMPPPeerCnt'] + " Down"; } else { obj['downXMPPPeerCntText'] = ""; } @@ -368,7 +368,7 @@ var infraMonitorUtils = { } } if(obj['downBgpPeerCnt'] > 0){ - obj['downBgpPeerCntText'] = ", " + obj['downBgpPeerCnt'] + " Down"; + obj['downBgpPeerCntText'] = "
" + obj['downBgpPeerCnt'] + " Down"; } else { obj['downBgpPeerCntText'] = ""; } diff --git a/webroot/monitor/infra/confignode/ui/js/monitor_infra_confignode_details.js b/webroot/monitor/infra/confignode/ui/js/monitor_infra_confignode_details.js index a62cc3a10..000aa79d7 100644 --- a/webroot/monitor/infra/confignode/ui/js/monitor_infra_confignode_details.js +++ b/webroot/monitor/infra/confignode/ui/js/monitor_infra_confignode_details.js @@ -95,7 +95,6 @@ monitorInfraConfigDetailsClass = (function() { } return ips; })()}, - {lbl:'Version', value:parsedData['version'] != '-' ? parsedData['version'] : noDataStr}, {lbl:'Overall Node Status', value:overallStatus}, {lbl:'Processes', value:" "}, {lbl:INDENT_RIGHT+'API Server', value:(function(){ @@ -147,6 +146,7 @@ monitorInfraConfigDetailsClass = (function() { // > parseInt(confNodeData.ModuleServerState["generator_info"]["reset_time"]))?"Up":"Down"})()}, {lbl:'CPU', value:$.isNumeric(parsedData['cpu']) ? parsedData['cpu'] + ' %' : noDataStr}, {lbl:'Memory', value:parsedData['memory'] != '-' ? parsedData['memory'] : noDataStr}, + {lbl:'Version', value:parsedData['version'] != '-' ? parsedData['version'] : noDataStr}, {lbl:'Last Log', value: (function(){ var lmsg; lmsg = getLastLogTimestamp(confNodeData,"config"); diff --git a/webroot/monitor/infra/confignode/ui/js/monitor_infra_confignode_summary.js b/webroot/monitor/infra/confignode/ui/js/monitor_infra_confignode_summary.js index cf85d55fa..84dc7897a 100644 --- a/webroot/monitor/infra/confignode/ui/js/monitor_infra_confignode_summary.js +++ b/webroot/monitor/infra/confignode/ui/js/monitor_infra_confignode_summary.js @@ -53,6 +53,9 @@ monitorInfraConfigSummaryClass = (function() { { field:"hostName", name:"Host name", + sortable : { + sortBy: 'formattedValue' + }, formatter:function(r,c,v,cd,dc) { return cellTemplateLinks({cellText:'name',name:'name',statusBubble:true,rowData:dc}); }, @@ -65,7 +68,7 @@ monitorInfraConfigSummaryClass = (function() { searchFn:function(d) { return d['name']; }, - minWidth:90, + minWidth:175, exportConfig: { allow: true, advFormatter: function(dc) { @@ -87,11 +90,6 @@ monitorInfraConfigSummaryClass = (function() { } } }, - { - field:"version", - name:"Version", - minWidth:90 - }, { field:"status", name:"Status", @@ -109,6 +107,11 @@ monitorInfraConfigSummaryClass = (function() { } } }, + { + field:"version", + name:"Version", + minWidth:90 + }, { field:"cpu", name:"CPU (%)", diff --git a/webroot/monitor/infra/controlnode/ui/js/monitor_infra_controlnode_details.js b/webroot/monitor/infra/controlnode/ui/js/monitor_infra_controlnode_details.js index 6b0f11a99..5fac3892b 100644 --- a/webroot/monitor/infra/controlnode/ui/js/monitor_infra_controlnode_details.js +++ b/webroot/monitor/infra/controlnode/ui/js/monitor_infra_controlnode_details.js @@ -60,7 +60,6 @@ monitorInfraControlDetailsClass = (function() { var ip = ifNullOrEmpty(getControlIpAddresses(ctrlNodeData,"details"),noDataStr); return ip; })()}, - {lbl:'Version', value:parsedData['version'] != '-' ? parsedData['version'] : noDataStr}, {lbl:'Overall Node Status', value:overallStatus}, {lbl:'Processes', value:" "}, {lbl:INDENT_RIGHT+'Control Node', value:(function(){ @@ -175,6 +174,7 @@ monitorInfraControlDetailsClass = (function() { })()}, {lbl:'CPU', value:$.isNumeric(parsedData['cpu']) ? parsedData['cpu'] + ' %' : noDataStr}, {lbl:'Memory', value:parsedData['memory'] != '-' ? parsedData['memory'] : noDataStr}, + {lbl:'Version', value:parsedData['version'] != '-' ? parsedData['version'] : noDataStr}, {lbl:'Last Log', value: (function(){ var lmsg; lmsg = getLastLogTimestamp(ctrlNodeData,"control"); diff --git a/webroot/monitor/infra/controlnode/ui/js/monitor_infra_controlnode_summary.js b/webroot/monitor/infra/controlnode/ui/js/monitor_infra_controlnode_summary.js index 03dba1423..5deeb7a11 100644 --- a/webroot/monitor/infra/controlnode/ui/js/monitor_infra_controlnode_summary.js +++ b/webroot/monitor/infra/controlnode/ui/js/monitor_infra_controlnode_summary.js @@ -57,6 +57,9 @@ monitorInfraControlSummaryClass = (function() { { field:"name", name:"Host name", + sortable : { + sortBy: 'formattedValue' + }, formatter:function(r,c,v,cd,dc) { return cellTemplateLinks({cellText:'name',name:'name',statusBubble:true,rowData:dc}); }, @@ -66,7 +69,7 @@ monitorInfraControlSummaryClass = (function() { } }, cssClass: 'cell-hyperlink-blue', - minWidth:110, + minWidth:175, exportConfig: { allow: true, advFormatter: function(dc) { @@ -88,11 +91,6 @@ monitorInfraControlSummaryClass = (function() { } } }, - { - field:"version", - name:"Version", - minWidth:150 - }, { field:"status", name:"Status", @@ -105,6 +103,27 @@ monitorInfraControlSummaryClass = (function() { }, minWidth:150 }, + { + field:"establishedPeerCount", + name:"BGP Peers", + minWidth:100, + formatter:function(r,c,v,cd,dc){ + return contrail.format("{0} Total {1}",ifNull(dc['totalBgpPeerCnt'],0),dc['downBgpPeerCntText']); + } + }, + { + field:"activevRouterCount", + name:"vRouters", + formatter:function(r,c,v,cd,dc){ + return contrail.format("{0} Total {1}",dc['totalXMPPPeerCnt'],dc['downXMPPPeerCntText']); + }, + minWidth:100 + }, + { + field:"version", + name:"Version", + minWidth:110 + }, { field:"cpu", name:"CPU (%)", @@ -117,33 +136,17 @@ monitorInfraControlSummaryClass = (function() { }, minWidth:150, exportConfig: { - allow: true, - advFormatter: function(dc) { - return dc['cpu']; - } - } + allow: true, + advFormatter: function(dc) { + return dc['cpu']; + } + } }, { field:"memory", name:"Memory", minWidth:110 }, - { - field:"establishedPeerCount", - name:"BGP Peers", - minWidth:140, - formatter:function(r,c,v,cd,dc){ - return contrail.format("{0} Total {1}",ifNull(dc['totalBgpPeerCnt'],0),dc['downBgpPeerCntText']); - } - }, - { - field:"activevRouterCount", - name:"vRouters", - formatter:function(r,c,v,cd,dc){ - return contrail.format("{0} Total {1}",dc['totalXMPPPeerCnt'],dc['downXMPPPeerCntText']); - }, - minWidth:140 - } ], } }); diff --git a/webroot/monitor/infra/dashboard/ui/js/monitor_infra_dashboard.js b/webroot/monitor/infra/dashboard/ui/js/monitor_infra_dashboard.js index d8b25f448..08f48e348 100644 --- a/webroot/monitor/infra/dashboard/ui/js/monitor_infra_dashboard.js +++ b/webroot/monitor/infra/dashboard/ui/js/monitor_infra_dashboard.js @@ -36,6 +36,7 @@ function addTabs() { * Takes vRouters data(array) as input and creates/updates chart */ var updateView = function(data) { + data = data.reverse();//reversing to get the reds on top var chartObj = {}; var chartsData = { title: 'vRouters', @@ -141,6 +142,7 @@ function addTabs() { }) var updateView = function(data) { + data = data.reverse();//reversing to get the reds on top if(!isScatterChartInitialized('#ctrlNode-bubble')) { $('#ctrlNodeStats-header').initWidgetHeader({title:'Control Nodes',link:{hashParams:{p:'mon_infra_control',q:{node:'Control Nodes'}}}}); var chartsData = { @@ -188,7 +190,8 @@ function addTabs() { viewModel.data.subscribe(function(newValue) { updateView(newValue); }) - var updateView = function(data) { + this.updateView = function(data) { + data = data.reverse();//reversing to get the reds on top if(!isScatterChartInitialized('#analyticNode-bubble')) { $('#analyticNodeStats-header').initWidgetHeader({title:'Analytics Nodes',link:{hashParams:{p:'mon_infra_analytics',q:{node:'Analytics Nodes'}}}}); var chartsData = { @@ -237,6 +240,7 @@ function addTabs() { }) var updateView = function(data) { + data = data.reverse();//reversing to get the reds on top if(!isScatterChartInitialized('#configNode-bubble')) { $('#configNodeStats-header').initWidgetHeader({title:'Config Nodes',link:{hashParams:{p:'mon_infra_config',q:{node:'Config Nodes'}}}}); var chartsData = { diff --git a/webroot/monitor/infra/vrouter/ui/js/monitor_infra_vrouter_details.js b/webroot/monitor/infra/vrouter/ui/js/monitor_infra_vrouter_details.js index 722fcd91d..d1e794379 100644 --- a/webroot/monitor/infra/vrouter/ui/js/monitor_infra_vrouter_details.js +++ b/webroot/monitor/infra/vrouter/ui/js/monitor_infra_vrouter_details.js @@ -64,7 +64,6 @@ monitorInfraComputeDetailsClass = (function() { {lbl:'IP Address', value:(function(){ return ifNullOrEmpty(getVrouterIpAddresses(computeNodeData,"details"),noDataStr); })()}, - {lbl:'Version', value:parsedData['version'] != '-' ? parsedData['version'] : noDataStr}, {lbl:'Overall Node Status', value:overallStatus}, {lbl:'Processes', value:" "}, {lbl:INDENT_RIGHT+'vRouter Agent', value:(function(){ @@ -183,6 +182,7 @@ monitorInfraComputeDetailsClass = (function() { {lbl:'Instances', value:parsedData['instCnt']}, {lbl:'CPU', value:$.isNumeric(parsedData['cpu']) ? parsedData['cpu'] + ' %' : noDataStr}, {lbl:'Memory', value:parsedData['memory'] != '-' ? parsedData['memory'] : noDataStr}, + {lbl:'Version', value:parsedData['version'] != '-' ? parsedData['version'] : noDataStr}, {lbl:'Last Log', value: (function(){ var lmsg; lmsg = getLastLogTimestamp(computeNodeData,"compute"); diff --git a/webroot/monitor/infra/vrouter/ui/js/monitor_infra_vrouter_summary.js b/webroot/monitor/infra/vrouter/ui/js/monitor_infra_vrouter_summary.js index 3933b1998..c03209c4c 100644 --- a/webroot/monitor/infra/vrouter/ui/js/monitor_infra_vrouter_summary.js +++ b/webroot/monitor/infra/vrouter/ui/js/monitor_infra_vrouter_summary.js @@ -223,7 +223,10 @@ monitorInfraComputeSummaryClass = (function() { { field:"name", name:"Host name", - minWidth:110, + minWidth:175, + sortable : { + sortBy: 'formattedValue' + }, formatter:function(r,c,v,cd,dc) { return cellTemplateLinks({cellText:'name',name:'name',statusBubble:true,rowData:dc}); }, @@ -254,11 +257,6 @@ monitorInfraComputeSummaryClass = (function() { } }, }, - { - field:"version", - name:"Version", - minWidth:110 - }, { field:"status", name:"Status", @@ -276,6 +274,29 @@ monitorInfraComputeSummaryClass = (function() { } }, }, + { + field:"vnCnt", + name:"Networks", + minWidth:70 + }, + { + field:"instCnt", + name:"Instances", + minWidth:70 + }, + { + field:"intfCnt", + name:"Interfaces", + formatter:function(r,c,v,cd,dc){ + return contrail.format("{0} Total{1}",dc['intfCnt'],dc['errorIntfCntText']); + }, + minWidth:70 + }, + { + field:"version", + name:"Version", + minWidth:110 + }, { field:"cpu", name:"CPU (%)", @@ -288,35 +309,17 @@ monitorInfraComputeSummaryClass = (function() { return d['cpu']; }, exportConfig: { - allow: true, - advFormatter: function(dc) { - return dc.cpu; - } - }, + allow: true, + advFormatter: function(dc) { + return dc.cpu; + } + }, }, { field:"memory", name:"Memory", minWidth:110 - }, - { - field:"vnCnt", - name:"Networks", - minWidth:100 - }, - { - field:"instCnt", - name:"Instances", - minWidth:100 - }, - { - field:"intfCnt", - name:"Interfaces", - formatter:function(r,c,v,cd,dc){ - return contrail.format("{0} Total{1}",dc['intfCnt'],dc['errorIntfCntText']); - }, - minWidth:150 - }, + } ], } }); From 4a0e6ab14bfd7bc00a412514daaf12a4f431e997 Mon Sep 17 00:00:00 2001 From: Vishnu Vardhan V Date: Mon, 4 Aug 2014 13:02:36 +0530 Subject: [PATCH 4/9] Stats changes in Instance UVE,bug is #1352227 - Changed the UI instance parse function as per the latest stats changes Change-Id: Idc934a0e4ff4bcef50ff4264052a1836abd4f0ac --- .../instance/ui/js/tenant_monitor_instance.js | 32 ++++++------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/webroot/monitor/tenant-network/instance/ui/js/tenant_monitor_instance.js b/webroot/monitor/tenant-network/instance/ui/js/tenant_monitor_instance.js index 6ee08d026..10c520e5f 100644 --- a/webroot/monitor/tenant-network/instance/ui/js/tenant_monitor_instance.js +++ b/webroot/monitor/tenant-network/instance/ui/js/tenant_monitor_instance.js @@ -72,34 +72,22 @@ function instSummaryRenderer() { objectType:'flow' }]; $.ajax({ - url:'/api/tenant/networking/virtual-machine/summary?fqNameRegExp=' + obj['fqName'] + '*' + url:'/api/tenant/networking/virtual-machine/summary?fqNameRegExp=' + obj['fqName'] + '?flat' }).done(function(result) { $("#uve-information").html(syntaxHighlight(result)) instDeferredObj.done(function(response) { var statData = [{ lbl : 'Network',field:'network'}, { lbl : 'vRouter',field:'vRouter'}]; - var instanceData = {}; - if(result != null) - result['value'] = ifNull(result['value'],[]); - if(result['value'].length > 0) - instanceData = result['value'][0]['value']; - var vRouter = getValueByJsonPath(instanceData,'UveVirtualMachineAgent;vrouter','-'); - intfList = getValueByJsonPath(instanceData,'UveVirtualMachineAgent;interface_list',[]); - intfStatList = getValueByJsonPath(instanceData,'UveVirtualMachineAgent;if_stats_list',[]); - instViewModel.vRouter(vRouter); - instViewModel.network(obj['srcVN']) - var inBytes = 0 ,outBytes = 0 ,totalInBytes = 0 ,totalOutBytes = 0; - $.each(getValueByJsonPath(instanceData,'UveVirtualMachineAgent;if_stats_list',[]), function (idx, value) { - if($.isNumeric(value['in_bytes'])) - totalInBytes += value['in_bytes']; - if($.isNumeric(value['out_bytes'])) - totalOutBytes += value['out_bytes']; - }); + var data = ifNull(tenantNetworkMonitorUtils.instanceParseFn([{name:"",value:result}])[0],{}); + instViewModel.vRouter(data['vRouter']); + instViewModel.network(obj['srcVN']); + intfList = getValueByJsonPath(result,'UveVirtualMachineAgent;interface_list',[]); + intfStatList = getValueByJsonPath(result,'VirtualMachineStats;if_stats;0;StatTable.VirtualMachineStats.if_stats',[]); var selItem = getSelInstanceFromDropDown(); - var selIntfName = ''; + var selIntfName = '',inBytes = 0,outBytes = 0; var stats = instSummaryView.getStatsOfInterface(selItem['ip']); inBytes = ifNull(stats['inBytes'],'-'),outBytes = ifNull(stats['outBytes'],'-'); - instViewModel.totalTrafficBytes(formatBytes(totalInBytes)+"/"+formatBytes(totalOutBytes)); + instViewModel.totalTrafficBytes(formatBytes(data['inBytes'])+"/"+formatBytes(data['outBytes'])); instViewModel.interfaceTrafficBytes(formatBytes(inBytes)+"/"+formatBytes(outBytes)); var dataSource = $('.summary-stats').data('dataSource'); var dashboardTemplate = contrail.getTemplate4Id('dashboard-template'); @@ -200,8 +188,8 @@ function instSummaryRenderer() { selIntfName = intfList[i]['name']; } $.each(intfStatList,function (idx, value) { - if(value['name'] == selIntfName) - result['inBytes'] = ifNull(value['in_bytes'],'-'),result['outBytes'] = ifNull(value['out_bytes'],'-'); + if(value['if_stats.name'] == selIntfName) + result['inBytes'] = ifNull(value['SUM(if_stats.in_bytes)'],'-'),result['outBytes'] = ifNull(value['SUM(if_stats.out_bytes)'],'-'); }); return result; } From 50dc5bdf42b54009b6a39ddfb8d782f5de6ff158 Mon Sep 17 00:00:00 2001 From: Manoj Naik Date: Mon, 4 Aug 2014 17:02:37 +0530 Subject: [PATCH 5/9] Fix for Bug 1351211: Update process_state_list to process_info Replaced the use of process_state_list to NodeStatus:process_info Change-Id: Ia6fdeaf059952dee6aa8b55a7c588c211da69951 --- webroot/common/api/infra.common.api.js | 4 +- .../analyticsnode/api/analyticsnode.api.js | 2 +- .../js/monitor_infra_analyticsnode_details.js | 2 +- .../infra/common/ui/js/monitor_infra_utils.js | 12 +- .../infra/confignode/api/confignode.api.js | 2 +- .../ui/js/monitor_infra_confignode_details.js | 2 +- .../infra/controlnode/api/controlnode.api.js | 2 +- .../js/monitor_infra_controlnode_details.js | 2 +- .../test/monitor_infra_dashboard_mock.js | 650 +++++++++--------- .../infra/vrouter/api/vrouternode.api.js | 2 +- .../ui/js/monitor_infra_vrouter_details.js | 2 +- 11 files changed, 349 insertions(+), 333 deletions(-) diff --git a/webroot/common/api/infra.common.api.js b/webroot/common/api/infra.common.api.js index 7bb6471a7..9352ab6e9 100644 --- a/webroot/common/api/infra.common.api.js +++ b/webroot/common/api/infra.common.api.js @@ -136,7 +136,7 @@ function getProcStateMappedModule(moduleName) function getNodeStatusByUVE (moduleName, uveData) { - var procStateList = jsonPath(uveData, "$..process_state_list"); + var procStateList = jsonPath(uveData, "$..NodeStatus.process_info"); if (procStateList.length == 0) { /* Why? */ return 'Down'; @@ -308,7 +308,7 @@ function getvRouterSummaryConfigUVEData (configData, uuidList, nodeList, addGen, 'VrouterAgent:total_interface_count', 'VrouterAgent:down_interface_count', 'VrouterAgent:connected_networks', 'VrouterAgent:control_ip', 'VrouterAgent:build_info', - 'VrouterStatsAgent:cpu_share', 'VrouterStatsAgent:process_state_list']; + 'VrouterStatsAgent:cpu_share', 'NodeStatus']; var postData = {}; if (null != nodeList) { var nodeCnt = nodeList.length; diff --git a/webroot/monitor/infra/analyticsnode/api/analyticsnode.api.js b/webroot/monitor/infra/analyticsnode/api/analyticsnode.api.js index b2ff4c2e5..fe7902382 100644 --- a/webroot/monitor/infra/analyticsnode/api/analyticsnode.api.js +++ b/webroot/monitor/infra/analyticsnode/api/analyticsnode.api.js @@ -32,7 +32,7 @@ function getAnalyticsNodeSummary (req, res, appData) var collPostData = {}; collPostData['cfilt'] = ['ModuleCpuState', 'CollectorState:self_ip_list', 'CollectorState:build_info', 'CollectorState:tx_socket_stats', - 'CollectorState:rx_socket_stats']; + 'CollectorState:rx_socket_stats','NodeStatus']; commonUtils.createReqObj(dataObjArr, reqUrl, global.HTTP_REQUEST_POST, collPostData, opApiServer, null, appData); diff --git a/webroot/monitor/infra/analyticsnode/ui/js/monitor_infra_analyticsnode_details.js b/webroot/monitor/infra/analyticsnode/ui/js/monitor_infra_analyticsnode_details.js index a8d2c4874..a3a6aadaf 100644 --- a/webroot/monitor/infra/analyticsnode/ui/js/monitor_infra_analyticsnode_details.js +++ b/webroot/monitor/infra/analyticsnode/ui/js/monitor_infra_analyticsnode_details.js @@ -65,7 +65,7 @@ monitorInfraAnalyticsDetailsClass = (function() { var statusTemplate = contrail.getTemplate4Id("statusTemplate"); overallStatus = getOverallNodeStatusForDetails(parsedData); - procStateList = getValueByJsonPath(aNodeData,"ModuleCpuState;process_state_list",[]); + procStateList = getValueByJsonPath(aNodeData,"NodeStatus;process_info",[]); analyticsProcessStatusList = getStatusesForAllAnalyticsProcesses(procStateList); aNodeDashboardInfo = [ {lbl:'Hostname', value:obj['name']}, diff --git a/webroot/monitor/infra/common/ui/js/monitor_infra_utils.js b/webroot/monitor/infra/common/ui/js/monitor_infra_utils.js index 4bc6d0009..4bfe15ad5 100644 --- a/webroot/monitor/infra/common/ui/js/monitor_infra_utils.js +++ b/webroot/monitor/infra/common/ui/js/monitor_infra_utils.js @@ -11,7 +11,7 @@ var infraMonitorAlertUtils = { if(processPath != null) res = getValueByJsonPath(data['value'],processPath,[]); else - res = ifNull(jsonPath(data,'$..process_state_list')[0],[]); + res = ifNull(jsonPath(data,'$..NodeStatus.process_info')[0],[]); var alerts=[]; var infoObj = {type:obj['display_type'],link:obj['link']}; if(obj['isUveMissing'] == true) @@ -294,7 +294,7 @@ var infraMonitorUtils = { if(obj['isUveMissing'] == false && obj['isConfigMissing'] == false && obj['isPartialUveMissing'] == false) { obj['uveCfgIPMisMatch'] = (obj['uveIP'].indexOf(obj['configIP']) == -1 && obj['configIP'] != '-') ? true : false; } - obj['processAlerts']= infraMonitorAlertUtils.getProcessAlerts(d,obj,'VrouterStatsAgent;process_state_list'); + obj['processAlerts']= infraMonitorAlertUtils.getProcessAlerts(d,obj,'NodeStatus;process_info'); obj['isGeneratorRetrieved'] = false; obj['nodeAlerts'] = infraMonitorAlertUtils.processvRouterAlerts(obj); obj['alerts'] = obj['nodeAlerts'].concat(obj['processAlerts']).sort(dashboardUtils.sortInfraAlerts); @@ -893,7 +893,7 @@ var infraMonitorUtils = { function getCores(data) { var fileList=[],result=[]; - var fileArrList=ifNull(jsonPath(data,'$..process_state_list[*].core_file_list'),[]); + var fileArrList=ifNull(jsonPath(data,'$..NodeStatus.process_info[*].core_file_list'),[]); for(var i=0;i";} try{ - procStateList = jsonPath(ctrlNodeData,"$..process_state_list")[0]; + procStateList = jsonPath(ctrlNodeData,"$..NodeStatus.process_info")[0]; controlProcessStatusList = getStatusesForAllControlProcesses(procStateList); }catch(e){} ctrlNodeDashboardInfo = [ diff --git a/webroot/monitor/infra/test/monitor_infra_dashboard_mock.js b/webroot/monitor/infra/test/monitor_infra_dashboard_mock.js index 6197b0a35..b77b77c2e 100644 --- a/webroot/monitor/infra/test/monitor_infra_dashboard_mock.js +++ b/webroot/monitor/infra/test/monitor_infra_dashboard_mock.js @@ -83,37 +83,40 @@ function InfraMockData() { "sum" : "0.1014029" } } ], - "process_state_list" : [ { "core_file_list" : [ ], - "exit_count" : 0, - "last_exit_time" : null, - "last_start_time" : "1391061692459593", - "last_stop_time" : null, - "process_name" : "contrail-vrouter", - "process_state" : "PROCESS_STATE_RUNNING", - "start_count" : 1, - "stop_count" : 0 - }, - { "core_file_list" : [ ], - "exit_count" : 0, - "last_exit_time" : null, - "last_start_time" : "1391061690455524", - "last_stop_time" : null, - "process_name" : "contrail-vrouter-nodemgr", - "process_state" : "PROCESS_STATE_RUNNING", - "start_count" : 1, - "stop_count" : 0 - }, - { "core_file_list" : [ ], - "exit_count" : 0, - "last_exit_time" : null, - "last_start_time" : "1391061733842477", - "last_stop_time" : null, - "process_name" : "openstack-nova-compute", - "process_state" : "PROCESS_STATE_RUNNING", - "start_count" : 1, - "stop_count" : 0 - } - ] + "NodeStatus":{ + "process_info" : [ + { "core_file_list" : [ ], + "exit_count" : 0, + "last_exit_time" : null, + "last_start_time" : "1391061692459593", + "last_stop_time" : null, + "process_name" : "contrail-vrouter", + "process_state" : "PROCESS_STATE_RUNNING", + "start_count" : 1, + "stop_count" : 0 + }, + { "core_file_list" : [ ], + "exit_count" : 0, + "last_exit_time" : null, + "last_start_time" : "1391061690455524", + "last_stop_time" : null, + "process_name" : "contrail-vrouter-nodemgr", + "process_state" : "PROCESS_STATE_RUNNING", + "start_count" : 1, + "stop_count" : 0 + }, + { "core_file_list" : [ ], + "exit_count" : 0, + "last_exit_time" : null, + "last_start_time" : "1391061733842477", + "last_stop_time" : null, + "process_name" : "openstack-nova-compute", + "process_state" : "PROCESS_STATE_RUNNING", + "start_count" : 1, + "stop_count" : 0 + } + ] + } } } } ], @@ -196,37 +199,40 @@ function InfraMockData() { "sum" : "0.3513834" } } ], - "process_state_list" : [ { "core_file_list" : [ ], - "exit_count" : 0, - "last_exit_time" : null, - "last_start_time" : "1395208421747763", - "last_stop_time" : "1395208417363453", - "process_name" : "contrail-vrouter", - "process_state" : "PROCESS_STATE_RUNNING", - "start_count" : 2, - "stop_count" : 1 - }, - { "core_file_list" : [ ], - "exit_count" : 0, - "last_exit_time" : null, - "last_start_time" : "1395137366570779", - "last_stop_time" : null, - "process_name" : "contrail-vrouter-nodemgr", - "process_state" : "PROCESS_STATE_RUNNING", - "start_count" : 1, - "stop_count" : 0 - }, - { "core_file_list" : [ ], - "exit_count" : 0, - "last_exit_time" : null, - "last_start_time" : "1395137360211414", - "last_stop_time" : null, - "process_name" : "openstack-nova-compute", - "process_state" : "PROCESS_STATE_RUNNING", - "start_count" : 1, - "stop_count" : 0 - } - ] + "NodeStatus":{ + "process_info" : [ + { "core_file_list" : [ ], + "exit_count" : 0, + "last_exit_time" : null, + "last_start_time" : "1395208421747763", + "last_stop_time" : "1395208417363453", + "process_name" : "contrail-vrouter", + "process_state" : "PROCESS_STATE_RUNNING", + "start_count" : 2, + "stop_count" : 1 + }, + { "core_file_list" : [ ], + "exit_count" : 0, + "last_exit_time" : null, + "last_start_time" : "1395137366570779", + "last_stop_time" : null, + "process_name" : "contrail-vrouter-nodemgr", + "process_state" : "PROCESS_STATE_RUNNING", + "start_count" : 1, + "stop_count" : 0 + }, + { "core_file_list" : [ ], + "exit_count" : 0, + "last_exit_time" : null, + "last_start_time" : "1395137360211414", + "last_stop_time" : null, + "process_name" : "openstack-nova-compute", + "process_state" : "PROCESS_STATE_RUNNING", + "start_count" : 1, + "stop_count" : 0 + } + ] + } } } }, @@ -310,37 +316,39 @@ function InfraMockData() { "sum" : "0.5111039" } } ], - "process_state_list" : [ { "core_file_list" : [ ], - "exit_count" : 0, - "last_exit_time" : null, - "last_start_time" : "1395137363474175", - "last_stop_time" : null, - "process_name" : "contrail-vrouter", - "process_state" : "PROCESS_STATE_RUNNING", - "start_count" : 1, - "stop_count" : 0 - }, - { "core_file_list" : [ ], - "exit_count" : 0, - "last_exit_time" : null, - "last_start_time" : "1395137361471053", - "last_stop_time" : null, - "process_name" : "contrail-vrouter-nodemgr", - "process_state" : "PROCESS_STATE_RUNNING", - "start_count" : 1, - "stop_count" : 0 - }, - { "core_file_list" : [ ], - "exit_count" : 0, - "last_exit_time" : null, - "last_start_time" : "1395137355364969", - "last_stop_time" : null, - "process_name" : "openstack-nova-compute", - "process_state" : "PROCESS_STATE_RUNNING", - "start_count" : 1, - "stop_count" : 0 - } - ] + "NodeStatus":{ + "process_info" : [ { "core_file_list" : [ ], + "exit_count" : 0, + "last_exit_time" : null, + "last_start_time" : "1395137363474175", + "last_stop_time" : null, + "process_name" : "contrail-vrouter", + "process_state" : "PROCESS_STATE_RUNNING", + "start_count" : 1, + "stop_count" : 0 + }, + { "core_file_list" : [ ], + "exit_count" : 0, + "last_exit_time" : null, + "last_start_time" : "1395137361471053", + "last_stop_time" : null, + "process_name" : "contrail-vrouter-nodemgr", + "process_state" : "PROCESS_STATE_RUNNING", + "start_count" : 1, + "stop_count" : 0 + }, + { "core_file_list" : [ ], + "exit_count" : 0, + "last_exit_time" : null, + "last_start_time" : "1395137355364969", + "last_stop_time" : null, + "process_name" : "openstack-nova-compute", + "process_state" : "PROCESS_STATE_RUNNING", + "start_count" : 1, + "stop_count" : 0 + } + ] + } } } }, @@ -424,37 +432,39 @@ function InfraMockData() { "sum" : "0.4555491" } } ], - "process_state_list" : [ { "core_file_list" : [ ], - "exit_count" : 0, - "last_exit_time" : null, - "last_start_time" : "1395137426055669", - "last_stop_time" : null, - "process_name" : "contrail-vrouter", - "process_state" : "PROCESS_STATE_RUNNING", - "start_count" : 1, - "stop_count" : 0 - }, - { "core_file_list" : [ ], - "exit_count" : 0, - "last_exit_time" : null, - "last_start_time" : "1395137424052005", - "last_stop_time" : null, - "process_name" : "contrail-vrouter-nodemgr", - "process_state" : "PROCESS_STATE_RUNNING", - "start_count" : 1, - "stop_count" : 0 - }, - { "core_file_list" : [ ], - "exit_count" : 0, - "last_exit_time" : null, - "last_start_time" : "1395137416543513", - "last_stop_time" : null, - "process_name" : "openstack-nova-compute", - "process_state" : "PROCESS_STATE_RUNNING", - "start_count" : 1, - "stop_count" : 0 - } - ] + "NodeStatus":{ + "process_info" : [ { "core_file_list" : [ ], + "exit_count" : 0, + "last_exit_time" : null, + "last_start_time" : "1395137426055669", + "last_stop_time" : null, + "process_name" : "contrail-vrouter", + "process_state" : "PROCESS_STATE_RUNNING", + "start_count" : 1, + "stop_count" : 0 + }, + { "core_file_list" : [ ], + "exit_count" : 0, + "last_exit_time" : null, + "last_start_time" : "1395137424052005", + "last_stop_time" : null, + "process_name" : "contrail-vrouter-nodemgr", + "process_state" : "PROCESS_STATE_RUNNING", + "start_count" : 1, + "stop_count" : 0 + }, + { "core_file_list" : [ ], + "exit_count" : 0, + "last_exit_time" : null, + "last_start_time" : "1395137416543513", + "last_stop_time" : null, + "process_name" : "openstack-nova-compute", + "process_state" : "PROCESS_STATE_RUNNING", + "start_count" : 1, + "stop_count" : 0 + } + ] + } } } } @@ -553,47 +563,49 @@ function InfraMockData() { "num_up_xmpp_peer" : 1, "num_xmpp_peer" : 1, "output_queue_depth" : 0, - "process_state_list" : [ { "core_file_list" : [ ], - "exit_count" : 0, - "last_exit_time" : null, - "last_start_time" : "1392031408218460", - "last_stop_time" : null, - "process_name" : "contrail-control", - "process_state" : "PROCESS_STATE_RUNNING", - "start_count" : 1, - "stop_count" : 0 - }, - { "core_file_list" : [ ], - "exit_count" : 0, - "last_exit_time" : null, - "last_start_time" : "1392031406212682", - "last_stop_time" : null, - "process_name" : "contrail-control-nodemgr", - "process_state" : "PROCESS_STATE_RUNNING", - "start_count" : 1, - "stop_count" : 0 - }, - { "core_file_list" : [ ], - "exit_count" : 0, - "last_exit_time" : null, - "last_start_time" : "1392031410227087", - "last_stop_time" : null, - "process_name" : "contrail-dns", - "process_state" : "PROCESS_STATE_RUNNING", - "start_count" : 1, - "stop_count" : 0 - }, - { "core_file_list" : [ ], - "exit_count" : 0, - "last_exit_time" : null, - "last_start_time" : "1392031412228269", - "last_stop_time" : null, - "process_name" : "contrail-named", - "process_state" : "PROCESS_STATE_RUNNING", - "start_count" : 1, - "stop_count" : 0 - } - ], + "NodeStatus":{ + "process_info" : [ { "core_file_list" : [ ], + "exit_count" : 0, + "last_exit_time" : null, + "last_start_time" : "1392031408218460", + "last_stop_time" : null, + "process_name" : "contrail-control", + "process_state" : "PROCESS_STATE_RUNNING", + "start_count" : 1, + "stop_count" : 0 + }, + { "core_file_list" : [ ], + "exit_count" : 0, + "last_exit_time" : null, + "last_start_time" : "1392031406212682", + "last_stop_time" : null, + "process_name" : "contrail-control-nodemgr", + "process_state" : "PROCESS_STATE_RUNNING", + "start_count" : 1, + "stop_count" : 0 + }, + { "core_file_list" : [ ], + "exit_count" : 0, + "last_exit_time" : null, + "last_start_time" : "1392031410227087", + "last_stop_time" : null, + "process_name" : "contrail-dns", + "process_state" : "PROCESS_STATE_RUNNING", + "start_count" : 1, + "stop_count" : 0 + }, + { "core_file_list" : [ ], + "exit_count" : 0, + "last_exit_time" : null, + "last_start_time" : "1392031412228269", + "last_stop_time" : null, + "process_name" : "contrail-named", + "process_state" : "PROCESS_STATE_RUNNING", + "start_count" : 1, + "stop_count" : 0 + } + ] + }, "uptime" : 1392031395956100, "virt_mem" : [ { "history-10" : { "{\"ts\":1392167118706305}" : 421336, "{\"ts\":1392173898782740}" : 421336, @@ -797,87 +809,89 @@ function InfraMockData() { "module_id" : "ServiceMonitor" } ], - "process_state_list" : [ { "core_file_list" : [ ], - "exit_count" : 0, - "last_exit_time" : null, - "last_start_time" : "1392031421077655", - "last_stop_time" : null, - "process_name" : "contrail-api:0", - "process_state" : "PROCESS_STATE_RUNNING", - "start_count" : 1, - "stop_count" : 0 - }, - { "core_file_list" : [ ], - "exit_count" : 0, - "last_exit_time" : null, - "last_start_time" : "1392031415064786", - "last_stop_time" : null, - "process_name" : "redis-config", - "process_state" : "PROCESS_STATE_RUNNING", - "start_count" : 1, - "stop_count" : 0 - }, - { "core_file_list" : [ ], - "exit_count" : 0, - "last_exit_time" : null, - "last_start_time" : "1392031413059723", - "last_stop_time" : null, - "process_name" : "contrail-config-nodemgr", - "process_state" : "PROCESS_STATE_RUNNING", - "start_count" : 1, - "stop_count" : 0 - }, - { "core_file_list" : [ ], - "exit_count" : 0, - "last_exit_time" : null, - "last_start_time" : "1392031417072072", - "last_stop_time" : "1392186852753830", - "process_name" : "contrail-discovery:0", - "process_state" : "PROCESS_STATE_STOPPED", - "start_count" : 1, - "stop_count" : 1 - }, - { "core_file_list" : [ ], - "exit_count" : 0, - "last_exit_time" : null, - "last_start_time" : "1392031425086415", - "last_stop_time" : null, - "process_name" : "contrail-svc-monitor", - "process_state" : "PROCESS_STATE_RUNNING", - "start_count" : 1, - "stop_count" : 0 - }, - { "core_file_list" : [ ], - "exit_count" : 0, - "last_exit_time" : null, - "last_start_time" : "1392031419075457", - "last_stop_time" : "1392189058210917", - "process_name" : "ifmap", - "process_state" : "PROCESS_STATE_STOPPED", - "start_count" : 1, - "stop_count" : 1 - }, - { "core_file_list" : [ ], - "exit_count" : 1, - "last_exit_time" : "1392189060216682", - "last_start_time" : "1392031423083104", - "last_stop_time" : null, - "process_name" : "contrail-schema", - "process_state" : "PROCESS_STATE_EXITED", - "start_count" : 1, - "stop_count" : 0 - }, - { "core_file_list" : [ ], - "exit_count" : 0, - "last_exit_time" : null, - "last_start_time" : "1392031427092471", - "last_stop_time" : null, - "process_name" : "contrail-zookeeper", - "process_state" : "PROCESS_STATE_RUNNING", - "start_count" : 1, - "stop_count" : 0 - } - ], + "NodeStatus":{ + "process_info" : [ { "core_file_list" : [ ], + "exit_count" : 0, + "last_exit_time" : null, + "last_start_time" : "1392031421077655", + "last_stop_time" : null, + "process_name" : "contrail-api:0", + "process_state" : "PROCESS_STATE_RUNNING", + "start_count" : 1, + "stop_count" : 0 + }, + { "core_file_list" : [ ], + "exit_count" : 0, + "last_exit_time" : null, + "last_start_time" : "1392031415064786", + "last_stop_time" : null, + "process_name" : "redis-config", + "process_state" : "PROCESS_STATE_RUNNING", + "start_count" : 1, + "stop_count" : 0 + }, + { "core_file_list" : [ ], + "exit_count" : 0, + "last_exit_time" : null, + "last_start_time" : "1392031413059723", + "last_stop_time" : null, + "process_name" : "contrail-config-nodemgr", + "process_state" : "PROCESS_STATE_RUNNING", + "start_count" : 1, + "stop_count" : 0 + }, + { "core_file_list" : [ ], + "exit_count" : 0, + "last_exit_time" : null, + "last_start_time" : "1392031417072072", + "last_stop_time" : "1392186852753830", + "process_name" : "contrail-discovery:0", + "process_state" : "PROCESS_STATE_STOPPED", + "start_count" : 1, + "stop_count" : 1 + }, + { "core_file_list" : [ ], + "exit_count" : 0, + "last_exit_time" : null, + "last_start_time" : "1392031425086415", + "last_stop_time" : null, + "process_name" : "contrail-svc-monitor", + "process_state" : "PROCESS_STATE_RUNNING", + "start_count" : 1, + "stop_count" : 0 + }, + { "core_file_list" : [ ], + "exit_count" : 0, + "last_exit_time" : null, + "last_start_time" : "1392031419075457", + "last_stop_time" : "1392189058210917", + "process_name" : "ifmap", + "process_state" : "PROCESS_STATE_STOPPED", + "start_count" : 1, + "stop_count" : 1 + }, + { "core_file_list" : [ ], + "exit_count" : 1, + "last_exit_time" : "1392189060216682", + "last_start_time" : "1392031423083104", + "last_stop_time" : null, + "process_name" : "contrail-schema", + "process_state" : "PROCESS_STATE_EXITED", + "start_count" : 1, + "stop_count" : 0 + }, + { "core_file_list" : [ ], + "exit_count" : 0, + "last_exit_time" : null, + "last_start_time" : "1392031427092471", + "last_stop_time" : null, + "process_name" : "contrail-zookeeper", + "process_state" : "PROCESS_STATE_RUNNING", + "start_count" : 1, + "stop_count" : 0 + } + ] + }, "schema_xmer_cpu_share" : [ { "history-10" : { "{\"ts\":1392188456790712}" : 0, "{\"ts\":1392188516893411}" : 0, "{\"ts\":1392188576996887}" : 0, @@ -1217,77 +1231,79 @@ function InfraMockData() { "sum" : "14046560" } } ], - "process_state_list" : [ { "core_file_list" : [ ], - "exit_count" : 0, - "last_exit_time" : null, - "last_start_time" : "1392031412546885", - "last_stop_time" : null, - "process_name" : "redis-query", - "process_state" : "PROCESS_STATE_RUNNING", - "start_count" : 1, - "stop_count" : 0 - }, - { "core_file_list" : [ ], - "exit_count" : 0, - "last_exit_time" : null, - "last_start_time" : "1392031418563789", - "last_stop_time" : null, - "process_name" : "contrail-qe", - "process_state" : "PROCESS_STATE_RUNNING", - "start_count" : 1, - "stop_count" : 0 - }, - { "core_file_list" : [ ], - "exit_count" : 0, - "last_exit_time" : null, - "last_start_time" : "1392031416558338", - "last_stop_time" : null, - "process_name" : "contrail-collector", - "process_state" : "PROCESS_STATE_RUNNING", - "start_count" : 1, - "stop_count" : 0 - }, - { "core_file_list" : [ ], - "exit_count" : 0, - "last_exit_time" : null, - "last_start_time" : "1392031408536264", - "last_stop_time" : null, - "process_name" : "contrail-analytics-nodemgr", - "process_state" : "PROCESS_STATE_RUNNING", - "start_count" : 1, - "stop_count" : 0 - }, - { "core_file_list" : [ ], - "exit_count" : 0, - "last_exit_time" : null, - "last_start_time" : "1392031414552561", - "last_stop_time" : null, - "process_name" : "redis-uve", - "process_state" : "PROCESS_STATE_RUNNING", - "start_count" : 1, - "stop_count" : 0 - }, - { "core_file_list" : [ ], - "exit_count" : 0, - "last_exit_time" : null, - "last_start_time" : "1392031420569403", - "last_stop_time" : null, - "process_name" : "contrail-opserver", - "process_state" : "PROCESS_STATE_RUNNING", - "start_count" : 1, - "stop_count" : 0 - }, - { "core_file_list" : [ ], - "exit_count" : 0, - "last_exit_time" : null, - "last_start_time" : "1392031410542571", - "last_stop_time" : null, - "process_name" : "redis-sentinel", - "process_state" : "PROCESS_STATE_RUNNING", - "start_count" : 1, - "stop_count" : 0 - } - ], + "NodeStatus":{ + "process_info" : [ { "core_file_list" : [ ], + "exit_count" : 0, + "last_exit_time" : null, + "last_start_time" : "1392031412546885", + "last_stop_time" : null, + "process_name" : "redis-query", + "process_state" : "PROCESS_STATE_RUNNING", + "start_count" : 1, + "stop_count" : 0 + }, + { "core_file_list" : [ ], + "exit_count" : 0, + "last_exit_time" : null, + "last_start_time" : "1392031418563789", + "last_stop_time" : null, + "process_name" : "contrail-qe", + "process_state" : "PROCESS_STATE_RUNNING", + "start_count" : 1, + "stop_count" : 0 + }, + { "core_file_list" : [ ], + "exit_count" : 0, + "last_exit_time" : null, + "last_start_time" : "1392031416558338", + "last_stop_time" : null, + "process_name" : "contrail-collector", + "process_state" : "PROCESS_STATE_RUNNING", + "start_count" : 1, + "stop_count" : 0 + }, + { "core_file_list" : [ ], + "exit_count" : 0, + "last_exit_time" : null, + "last_start_time" : "1392031408536264", + "last_stop_time" : null, + "process_name" : "contrail-analytics-nodemgr", + "process_state" : "PROCESS_STATE_RUNNING", + "start_count" : 1, + "stop_count" : 0 + }, + { "core_file_list" : [ ], + "exit_count" : 0, + "last_exit_time" : null, + "last_start_time" : "1392031414552561", + "last_stop_time" : null, + "process_name" : "redis-uve", + "process_state" : "PROCESS_STATE_RUNNING", + "start_count" : 1, + "stop_count" : 0 + }, + { "core_file_list" : [ ], + "exit_count" : 0, + "last_exit_time" : null, + "last_start_time" : "1392031420569403", + "last_stop_time" : null, + "process_name" : "contrail-opserver", + "process_state" : "PROCESS_STATE_RUNNING", + "start_count" : 1, + "stop_count" : 0 + }, + { "core_file_list" : [ ], + "exit_count" : 0, + "last_exit_time" : null, + "last_start_time" : "1392031410542571", + "last_stop_time" : null, + "process_name" : "redis-sentinel", + "process_state" : "PROCESS_STATE_RUNNING", + "start_count" : 1, + "stop_count" : 0 + } + ] + }, "queryengine_cpu_share" : [ { "history-10" : { "{\"ts\":1392198391710580}" : 0.0083347200000000003, "{\"ts\":1392198451710998}" : 0.0041673600000000002, "{\"ts\":1392198511711397}" : 0.0041673600000000002, diff --git a/webroot/monitor/infra/vrouter/api/vrouternode.api.js b/webroot/monitor/infra/vrouter/api/vrouternode.api.js index 76890d0bd..6124e3fac 100644 --- a/webroot/monitor/infra/vrouter/api/vrouternode.api.js +++ b/webroot/monitor/infra/vrouter/api/vrouternode.api.js @@ -369,7 +369,7 @@ function getvRouterDetailConfigUVEData (configData, uuidList, nodeList, addGen, 'VrouterAgent:total_interface_count', 'VrouterAgent:down_interface_count', 'VrouterAgent:connected_networks', 'VrouterAgent:control_ip', 'VrouterAgent:build_info', - 'VrouterStatsAgent:cpu_share', 'VrouterStatsAgent:process_state_list']; + 'VrouterStatsAgent:cpu_share', 'NodeStatus']; commonUtils.createReqObj(dataObjArr, reqUrl, global.HTTP_REQUEST_POST, postData, opApiServer, null, appData); if (null != addGen) { diff --git a/webroot/monitor/infra/vrouter/ui/js/monitor_infra_vrouter_details.js b/webroot/monitor/infra/vrouter/ui/js/monitor_infra_vrouter_details.js index 722fcd91d..b00da2cb0 100644 --- a/webroot/monitor/infra/vrouter/ui/js/monitor_infra_vrouter_details.js +++ b/webroot/monitor/infra/vrouter/ui/js/monitor_infra_vrouter_details.js @@ -57,7 +57,7 @@ monitorInfraComputeDetailsClass = (function() { var vRouterProcessStatusList = []; var statusTemplate = contrail.getTemplate4Id("statusTemplate"); overallStatus = getOverallNodeStatusForDetails(parsedData); - procStateList = getValueByJsonPath(computeNodeData,"VrouterStatsAgent;process_state_list"); + procStateList = getValueByJsonPath(computeNodeData,"NodeStatus;process_info"); vRouterProcessStatusList = getStatusesForAllvRouterProcesses(procStateList); computeNodeDashboardInfo = [ {lbl:'Hostname', value:obj['name']}, From f76b7107c1106bd4e048067b3cafbc82dec60ef3 Mon Sep 17 00:00:00 2001 From: Manoj Naik Date: Thu, 7 Aug 2014 12:19:56 +0530 Subject: [PATCH 6/9] Fix for Bug 1352946: Handling the case when the protocol field is empty object in control node routes Change-Id: Ifcf99ee6a5fb81ccfc2e816c4d8c4b0528951136 --- .../ui/js/monitor_infra_controlnode_routes.js | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/webroot/monitor/infra/controlnode/ui/js/monitor_infra_controlnode_routes.js b/webroot/monitor/infra/controlnode/ui/js/monitor_infra_controlnode_routes.js index 00f737c04..eac86a953 100644 --- a/webroot/monitor/infra/controlnode/ui/js/monitor_infra_controlnode_routes.js +++ b/webroot/monitor/infra/controlnode/ui/js/monitor_infra_controlnode_routes.js @@ -67,26 +67,31 @@ monitorInfraControlRoutesClass = (function() { (selPeerSrc == "All" || selPeerSrc == obj['source']) && (selProtocol == "All" || selProtocol == obj['protocol'])){ var src = obj['source']; - src = ifNullOrEmptyObject(src, "-").split(":").pop(); - origVn = ifNullOrEmptyObject(origVn, "-") ; + var protocol = ifNullOrEmptyObject(obj['protocol'],noDataStr); + var nextHop = ifNullOrEmptyObject(obj['next_hop'],noDataStr); + var label = ifNullOrEmptyObject(obj['label'],noDataStr); + var prefix = ifNullOrEmptyObject(currRoute['prefix'],noDataStr); + src = ifNullOrEmptyObject(src, noDataStr).split(":").pop(); + origVn = ifNullOrEmptyObject(origVn, noDataStr) ; + if(idx == 0) { routesArr.push({ - prefix:currRoute['Prefix'], - dispPrefix:currRoute['prefix'], + prefix:prefix, + dispPrefix:prefix, table:rtTable, instance:routeInstances[i], addrFamily:addfamily, sg:ifEmpty(sg,'-'), raw_json:rawJson, originVn:origVn, - protocol:obj['protocol'], + protocol:protocol, source:src, - next_hop:obj['next_hop'], - label:obj['label'] + next_hop:nextHop, + label:label }); } else { routesArr.push({ - prefix:currRoute['Prefix'], + prefix:prefix, dispPrefix:'', table:rtTable, instance:routeInstances[i], @@ -94,10 +99,10 @@ monitorInfraControlRoutesClass = (function() { sg:ifEmpty(sg,'-'), raw_json:rawJson, originVn:origVn, - protocol:obj['protocol'], + protocol:protocol, source:src, - next_hop:obj['next_hop'], - label:obj['label'] + next_hop:nextHop, + label:label }); } isRtTableDisplayed = true; From 62f1b1dc50496b358cb3e0abee42c3221e687efb Mon Sep 17 00:00:00 2001 From: Manoj Naik Date: Fri, 8 Aug 2014 11:53:36 +0530 Subject: [PATCH 7/9] Fix for Bug:1354280 - UI changes to incorporate process name changes Replaced the following : - contrail-vrouter to contrail-vrouter-agent - contrail-opserver to contrail-analytics-api - contrail-qe to contrail-query-engine Change-Id: Idc27271793628d63b5be2a39ae2947ff4be47b8d --- webroot/common/api/infra.common.api.js | 2 +- .../ui/js/monitor_infra_analyticsnode_details.js | 12 ++++++------ .../infra/common/ui/js/monitor_infra_utils.js | 2 +- .../infra/test/monitor_infra_dashboard_mock.js | 14 +++++++------- .../infra/test/monitor_infra_vrouter_mock.js | 4 ++-- .../vrouter/ui/js/monitor_infra_vrouter_details.js | 6 +++--- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/webroot/common/api/infra.common.api.js b/webroot/common/api/infra.common.api.js index 9352ab6e9..f7088d149 100644 --- a/webroot/common/api/infra.common.api.js +++ b/webroot/common/api/infra.common.api.js @@ -126,7 +126,7 @@ function getProcStateMappedModule(moduleName) { switch (moduleName) { case 'VRouterAgent': - return 'contrail-vrouter'; + return 'contrail-vrouter-agent'; case 'ControlNode': return 'contrail-control'; default: diff --git a/webroot/monitor/infra/analyticsnode/ui/js/monitor_infra_analyticsnode_details.js b/webroot/monitor/infra/analyticsnode/ui/js/monitor_infra_analyticsnode_details.js index 4e051e767..92ab67ae1 100644 --- a/webroot/monitor/infra/analyticsnode/ui/js/monitor_infra_analyticsnode_details.js +++ b/webroot/monitor/infra/analyticsnode/ui/js/monitor_infra_analyticsnode_details.js @@ -96,10 +96,10 @@ monitorInfraAnalyticsDetailsClass = (function() { return ifNull(analyticsProcessStatusList['contrail-collector'],noDataStr); })()}, {lbl:INDENT_RIGHT+'Query Engine', value:(function(){ - return ifNull(analyticsProcessStatusList['contrail-qe'],noDataStr); + return ifNull(analyticsProcessStatusList['contrail-query-engine'],noDataStr); })()}, {lbl:INDENT_RIGHT+'OpServer', value:(function(){ - return ifNull(analyticsProcessStatusList['contrail-opserver'],noDataStr); + return ifNull(analyticsProcessStatusList['contrail-analytics-api'],noDataStr); })()}, /* {lbl:INDENT_RIGHT+'Redis Sentinel', value:(function(){ return ifNull(analyticsProcessStatusList['redis-sentinel'],noDataStr); @@ -177,12 +177,12 @@ function getStatusesForAllAnalyticsProcesses(processStateList){ if(processStateList != null){ for(var i=0; i < processStateList.length; i++){ var currProc = processStateList[i]; - if (currProc.process_name == "contrail-qe"){ - ret['contrail-qe'] = getProcessUpTime(currProc); + if (currProc.process_name == "contrail-query-engine"){ + ret['contrail-query-engine'] = getProcessUpTime(currProc); } else if (currProc.process_name == "contrail-analytics-nodemgr"){ ret['contrail-analytics-nodemgr'] = getProcessUpTime(currProc); - } else if (currProc.process_name == "contrail-opserver"){ - ret['contrail-opserver'] = getProcessUpTime(currProc); + } else if (currProc.process_name == "contrail-analytics-api"){ + ret['contrail-analytics-api'] = getProcessUpTime(currProc); } else if (currProc.process_name == "contrail-collector"){ ret['contrail-collector'] = getProcessUpTime(currProc); } diff --git a/webroot/monitor/infra/common/ui/js/monitor_infra_utils.js b/webroot/monitor/infra/common/ui/js/monitor_infra_utils.js index f99b76d96..d3a4484b1 100644 --- a/webroot/monitor/infra/common/ui/js/monitor_infra_utils.js +++ b/webroot/monitor/infra/common/ui/js/monitor_infra_utils.js @@ -246,7 +246,7 @@ var infraMonitorUtils = { obj['histCpuArr'] = parseUveHistoricalValues(dValue,'','VrouterStatsAgent;cpu_share;0;history-10'); obj['status'] = getOverallNodeStatus(d,'compute'); - var processes = ['contrail-vrouter','contrail-vrouter-nodemgr','supervisor-vrouter']; + var processes = ['contrail-vrouter-agent','contrail-vrouter-nodemgr','supervisor-vrouter']; obj['memory'] = formatMemory(getValueByJsonPath(dValue,'VrouterStatsAgent;cpu_info;meminfo','--')); obj['size'] = getValueByJsonPath(dValue,'VrouterStatsAgent;phy_if_1min_usage;0;out_bandwidth_usage',0) + getValueByJsonPath(dValue,'VrouterStatsAgent;phy_if_1min_usage;0;in_bandwidth_usage',0) + 1; diff --git a/webroot/monitor/infra/test/monitor_infra_dashboard_mock.js b/webroot/monitor/infra/test/monitor_infra_dashboard_mock.js index b77b77c2e..d1e7a00b9 100644 --- a/webroot/monitor/infra/test/monitor_infra_dashboard_mock.js +++ b/webroot/monitor/infra/test/monitor_infra_dashboard_mock.js @@ -90,7 +90,7 @@ function InfraMockData() { "last_exit_time" : null, "last_start_time" : "1391061692459593", "last_stop_time" : null, - "process_name" : "contrail-vrouter", + "process_name" : "contrail-vrouter-agent", "process_state" : "PROCESS_STATE_RUNNING", "start_count" : 1, "stop_count" : 0 @@ -206,7 +206,7 @@ function InfraMockData() { "last_exit_time" : null, "last_start_time" : "1395208421747763", "last_stop_time" : "1395208417363453", - "process_name" : "contrail-vrouter", + "process_name" : "contrail-vrouter-agent", "process_state" : "PROCESS_STATE_RUNNING", "start_count" : 2, "stop_count" : 1 @@ -322,7 +322,7 @@ function InfraMockData() { "last_exit_time" : null, "last_start_time" : "1395137363474175", "last_stop_time" : null, - "process_name" : "contrail-vrouter", + "process_name" : "contrail-vrouter-agent", "process_state" : "PROCESS_STATE_RUNNING", "start_count" : 1, "stop_count" : 0 @@ -438,7 +438,7 @@ function InfraMockData() { "last_exit_time" : null, "last_start_time" : "1395137426055669", "last_stop_time" : null, - "process_name" : "contrail-vrouter", + "process_name" : "contrail-vrouter-agent", "process_state" : "PROCESS_STATE_RUNNING", "start_count" : 1, "stop_count" : 0 @@ -1247,7 +1247,7 @@ function InfraMockData() { "last_exit_time" : null, "last_start_time" : "1392031418563789", "last_stop_time" : null, - "process_name" : "contrail-qe", + "process_name" : "contrail-query-engine", "process_state" : "PROCESS_STATE_RUNNING", "start_count" : 1, "stop_count" : 0 @@ -1287,7 +1287,7 @@ function InfraMockData() { "last_exit_time" : null, "last_start_time" : "1392031420569403", "last_stop_time" : null, - "process_name" : "contrail-opserver", + "process_name" : "contrail-analytics-api", "process_state" : "PROCESS_STATE_RUNNING", "start_count" : 1, "stop_count" : 0 @@ -1420,7 +1420,7 @@ function InfraMockData() { "isUveMissing": false, "configIP": "10.204.217.11", "processDetails": { - "contrail-vrouter": { + "contrail-vrouter-agent": { "state": "PROCESS_STATE_RUNNING", "since": "1393912630664005" } diff --git a/webroot/monitor/infra/test/monitor_infra_vrouter_mock.js b/webroot/monitor/infra/test/monitor_infra_vrouter_mock.js index 5ea8b392d..93c1965b9 100644 --- a/webroot/monitor/infra/test/monitor_infra_vrouter_mock.js +++ b/webroot/monitor/infra/test/monitor_infra_vrouter_mock.js @@ -11,7 +11,7 @@ function InfraComputeMockData() { "last_exit_time" : null, "last_start_time" : "1391578930317483", "last_stop_time" : null, - "process_name" : "contrail-vrouter", + "process_name" : "contrail-vrouter-agent", "process_state" : "PROCESS_STATE_RUNNING", "start_count" : 1, "stop_count" : 0 @@ -39,7 +39,7 @@ function InfraComputeMockData() { }, "output" : { "PROCESS_STATE_LIST" : { - "contrail-vrouter" : "Up since 4d 9h 28m", + "contrail-vrouter-agent" : "Up since 4d 9h 28m", "contrail-vrouter-nodemgr" : "Up since 4d 9h 28m", "openstack-nova-compute" : "Up since 4d 9h 28m" } diff --git a/webroot/monitor/infra/vrouter/ui/js/monitor_infra_vrouter_details.js b/webroot/monitor/infra/vrouter/ui/js/monitor_infra_vrouter_details.js index 56df0b020..014f2512e 100644 --- a/webroot/monitor/infra/vrouter/ui/js/monitor_infra_vrouter_details.js +++ b/webroot/monitor/infra/vrouter/ui/js/monitor_infra_vrouter_details.js @@ -67,7 +67,7 @@ monitorInfraComputeDetailsClass = (function() { {lbl:'Overall Node Status', value:overallStatus}, {lbl:'Processes', value:" "}, {lbl:INDENT_RIGHT+'vRouter Agent', value:(function(){ - return ifNull(vRouterProcessStatusList['contrail-vrouter'],noDataStr); + return ifNull(vRouterProcessStatusList['contrail-vrouter-agent'],noDataStr); })()}, /*{lbl:INDENT_RIGHT+'vRouter Node Manager', value:(function(){ try{ @@ -261,8 +261,8 @@ function getStatusesForAllvRouterProcesses(processStateList){ ret['contrail-vrouter-nodemgr'] = getProcessUpTime(currProc); } else if (currProc.process_name == "openstack-nova-compute"){ ret['openstack-nova-compute'] = getProcessUpTime(currProc); - } else if (currProc.process_name == "contrail-vrouter"){ - ret['contrail-vrouter'] = getProcessUpTime(currProc); + } else if (currProc.process_name == "contrail-vrouter-agent"){ + ret['contrail-vrouter-agent'] = getProcessUpTime(currProc); } } } From 17df1e7c302676f17b19788bfdf6a01e12139122 Mon Sep 17 00:00:00 2001 From: Manoj Naik Date: Mon, 11 Aug 2014 16:07:46 +0530 Subject: [PATCH 8/9] Fix for Bug: 1328085- Added the detail expansion to all summary pages in infra monitor. Had to reorganized the code to reuse the code to build the label value pairs. Change-Id: I09ae7f3f33a743c88461ff3f41c717ee23a5880f --- .../js/monitor_infra_analyticsnode_details.js | 93 +-- .../js/monitor_infra_analyticsnode_summary.js | 24 +- .../infra/common/ui/js/monitor_infra_utils.js | 559 ++++++++++++++++++ .../ui/js/monitor_infra_confignode_details.js | 97 +-- .../ui/js/monitor_infra_confignode_summary.js | 24 +- .../js/monitor_infra_controlnode_details.js | 159 +---- .../js/monitor_infra_controlnode_summary.js | 24 +- .../ui/js/monitor_infra_vrouter_details.js | 157 +---- .../ui/js/monitor_infra_vrouter_summary.js | 24 +- .../ui/views/tenant_monitor_common.view | 39 -- 10 files changed, 660 insertions(+), 540 deletions(-) diff --git a/webroot/monitor/infra/analyticsnode/ui/js/monitor_infra_analyticsnode_details.js b/webroot/monitor/infra/analyticsnode/ui/js/monitor_infra_analyticsnode_details.js index 92ab67ae1..59a375c1c 100644 --- a/webroot/monitor/infra/analyticsnode/ui/js/monitor_infra_analyticsnode_details.js +++ b/webroot/monitor/infra/analyticsnode/ui/js/monitor_infra_analyticsnode_details.js @@ -60,82 +60,9 @@ monitorInfraAnalyticsDetailsClass = (function() { return contrail.format(monitorInfraUrls['FLOWSERIES_CPU'], 'OpServer', '30', '10', obj['name'], endTime); }, parser: "parseProcessMemCPUData", plotOnLoad: false, showWidgetIds: ['opServer-chart-box'], hideWidgetIds: ['collector-chart-box', 'queryengine-chart-box'], titles: {memTitle:'Memory',cpuTitle:'% CPU Utilization'}}),110); }); - var procStateList, overallStatus = noDataStr; - var analyticsProcessStatusList = []; var statusTemplate = contrail.getTemplate4Id("statusTemplate"); - overallStatus = getOverallNodeStatusForDetails(parsedData); - procStateList = getValueByJsonPath(aNodeData,"NodeStatus;process_info",[]); - analyticsProcessStatusList = getStatusesForAllAnalyticsProcesses(procStateList); - aNodeDashboardInfo = [ - {lbl:'Hostname', value:obj['name']}, - {lbl:'IP Address', value:(function(){ - var ips = ''; - iplist = getValueByJsonPath(aNodeData,"CollectorState;self_ip_list",[]); - if(iplist != null && iplist.length>0){ - for (var i=0; i< iplist.length;i++){ - if(i+1 == iplist.length) { - ips = ips + iplist[i]; - } else { - ips = ips + iplist[i] + ', '; - } - } - } else { - ips = noDataStr; - } - return ips; - })()}, - {lbl:'Overall Node Status', value:overallStatus}, - {lbl:'Processes', value:" "}, - /*{lbl:INDENT_RIGHT+'Analytics Node Manager', value:(function(){ - try{ - return ifNull(analyticsProcessStatusList['contrail-analytics-nodemgr'],noDataStr); - }catch(e){return noDataStr;} - })()},*/ - {lbl:INDENT_RIGHT+'Collector', value:(function(){ - return ifNull(analyticsProcessStatusList['contrail-collector'],noDataStr); - })()}, - {lbl:INDENT_RIGHT+'Query Engine', value:(function(){ - return ifNull(analyticsProcessStatusList['contrail-query-engine'],noDataStr); - })()}, - {lbl:INDENT_RIGHT+'OpServer', value:(function(){ - return ifNull(analyticsProcessStatusList['contrail-analytics-api'],noDataStr); - })()}, - /* {lbl:INDENT_RIGHT+'Redis Sentinel', value:(function(){ - return ifNull(analyticsProcessStatusList['redis-sentinel'],noDataStr); - })()},*/ - {lbl:'CPU', value:$.isNumeric(parsedData['cpu']) ? parsedData['cpu'] + ' %' : noDataStr}, - {lbl:'Memory', value:parsedData['memory'] != '-' ? parsedData['memory'] : noDataStr}, - {lbl:'Messages', value:(function(){ - var msgs = getAnalyticsMessagesCountAndSize(aNodeData,['Collector']); - return msgs['count'] + ' [' + formatBytes(msgs['size']) + ']'; - })()}, - {lbl:'Generators', value:(function(){ - var ret=''; - var genno; - try{ - if(aNodeData.CollectorState["generator_infos"]!=null){ - genno = aNodeData.CollectorState["generator_infos"].length; - }; - ret = ret + ifNull(genno,noDataStr); - }catch(e){ return noDataStr;} - return ret; - })()}, - {lbl:'Version', value:parsedData['version'] != '-' ? parsedData['version'] : noDataStr}, - {lbl:'Last Log', value: (function(){ - var lmsg; - lmsg = getLastLogTimestamp(aNodeData,"analytics"); - if(lmsg != null){ - try{ - return new Date(parseInt(lmsg)/1000).toLocaleString(); - }catch(e){return noDataStr;} - } else return noDataStr; - })()} - //'vRouters ' + aNodeData['establishedPeerCount'] + ', ' + - //'Collectors ' + aNodeData['activevRouterCount'] + ', ' + - //'Analytics Nodes ' + aNodeData['activevRouterCount'] + ', ' + - //'Config Nodes ' + aNodeData['activevRouterCount']}, - ] + aNodeDashboardInfo = getAnalyticsNodeLblValuePairs(parsedData); /*Selenium Testing*/ aNodeDetailsData = aNodeDashboardInfo; /*End of Selenium Testing*/ @@ -172,21 +99,3 @@ monitorInfraAnalyticsDetailsClass = (function() { return {populateDetailsTab:populateDetailsTab}; })(); -function getStatusesForAllAnalyticsProcesses(processStateList){ - var ret = []; - if(processStateList != null){ - for(var i=0; i < processStateList.length; i++){ - var currProc = processStateList[i]; - if (currProc.process_name == "contrail-query-engine"){ - ret['contrail-query-engine'] = getProcessUpTime(currProc); - } else if (currProc.process_name == "contrail-analytics-nodemgr"){ - ret['contrail-analytics-nodemgr'] = getProcessUpTime(currProc); - } else if (currProc.process_name == "contrail-analytics-api"){ - ret['contrail-analytics-api'] = getProcessUpTime(currProc); - } else if (currProc.process_name == "contrail-collector"){ - ret['contrail-collector'] = getProcessUpTime(currProc); - } - } - } - return ret; -} diff --git a/webroot/monitor/infra/analyticsnode/ui/js/monitor_infra_analyticsnode_summary.js b/webroot/monitor/infra/analyticsnode/ui/js/monitor_infra_analyticsnode_summary.js index c6de8d284..c356253c1 100644 --- a/webroot/monitor/infra/analyticsnode/ui/js/monitor_infra_analyticsnode_summary.js +++ b/webroot/monitor/infra/analyticsnode/ui/js/monitor_infra_analyticsnode_summary.js @@ -29,7 +29,29 @@ monitorInfraAnalyticsSummaryClass = (function() { autoHeight : true, enableAsyncPostRender: true, forceFitColumns:true, - lazyLoading:true + lazyLoading:true, + detail:{ + template: $("#gridDetailTemplate").html(), + onExpand: function (e,dc) { + var detailTemplate = contrail.getTemplate4Id('infra-summary-details-template'); + var rowData = e.data; + var grid = $(e['target']).closest('div.contrail-grid'); + var dataItem = dc; + var data = getAnalyticsNodeLblValuePairs(dc); + data = {d:data}; + //Issue a call for fetching the details + if(data != null) { + e.detailRow.find('.row-fluid.advancedDetails').html('
' + syntaxHighlight(dc.raw_json) + '
'); + //DataItem consists of row data,passing it as a parameter to the parsefunction + e.detailRow.find('.row-fluid.basicDetails').html(detailTemplate(data)); + $(grid).data('contrailGrid').adjustDetailRowHeight(dataItem['id']); + } else { + e.detailRow.find('.row-fluid.basicDetails').html(detailTemplate(data)); + } + }, + onCollapse:function (e,dc) { + } + } }, dataSource: { dataView: analyticsNodesDataSource, diff --git a/webroot/monitor/infra/common/ui/js/monitor_infra_utils.js b/webroot/monitor/infra/common/ui/js/monitor_infra_utils.js index d3a4484b1..27fe3f1f9 100644 --- a/webroot/monitor/infra/common/ui/js/monitor_infra_utils.js +++ b/webroot/monitor/infra/common/ui/js/monitor_infra_utils.js @@ -223,9 +223,11 @@ var infraMonitorUtils = { parsevRoutersDashboardData : function(result,isSummaryPage) { var retArr = []; var vRouterCnt = result.length; + for(var i=0;i";} + try{ + procStateList = jsonPath(ctrlNodeData,"$..NodeStatus.process_info")[0]; + controlProcessStatusList = getStatusesForAllControlProcesses(procStateList); + }catch(e){} + var ctrlNodeDashboardInfo = [ + {lbl:'Hostname', value:parsedData.name}, + {lbl:'IP Address',value:(function(){ + var ip = ifNullOrEmpty(getControlIpAddresses(ctrlNodeData,"details"),noDataStr); + return ip; + })()}, + {lbl:'Overall Node Status', value:overallStatus}, + {lbl:'Processes', value:" "}, + {lbl:INDENT_RIGHT+'Control Node', value:(function(){ + return ifNull(controlProcessStatusList['contrail-control'],noDataStr); + })()}, + /*{lbl:INDENT_RIGHT+'Control Node Manager', value:(function(){ + try{ + return ifNull(controlProcessStatusList['contrail-control-nodemgr'],noDataStr); + }catch(e){return noDataStr;} + })()},*/ + {lbl:'Ifmap Connection', value:(function(){ + var cnfNode = ''; + try{ + var url = ctrlNodeData.BgpRouterState.ifmap_info.url; + if(url != null && url != undefined && url != ""){ + var pos = url.indexOf(':8443'); + if(pos != -1) + cnfNode = url.substr(0, pos); + pos = cnfNode.indexOf('https://'); + if(pos != -1) + cnfNode = cnfNode.slice(pos + 8) ; + } + var status = ctrlNodeData.BgpRouterState.ifmap_info.connection_status; + var stateChangeAtTime = ctrlNodeData.BgpRouterState.ifmap_info.connection_status_change_at; + var stateChangeSince = ""; + var statusString = ""; + if(stateChangeAtTime != null){ + var stateChangeAtTime = new XDate(stateChangeAtTime/1000); + var currTime = new XDate(); + stateChangeSince = diffDates(stateChangeAtTime,currTime); + } + if(status != null && status != undefined && status != ""){ + if(stateChangeSince != ""){ + if(status.toLowerCase() == "up" || status.toLowerCase() == "down"){ + status = status + " since"; + } + statusString = status + " " + stateChangeSince; + } else { + statusString = status; + } + } + if(statusString != ""){ + cnfNode = cnfNode.concat( ' (' + statusString + ')'); + } + }catch (e){} + return ifNull(cnfNode,noDataStr); + })()}, + {lbl:'Analytics Node', value:(function(){ + var anlNode = noDataStr; + var secondaryAnlNode, status; + try{ + //anlNode = ifNull(computeNodeData.VrouterAgent.collector,noDataStr); + anlNode = jsonPath(ctrlNodeData,"$..ModuleClientState..primary")[0].split(':')[0]; + status = jsonPath(ctrlNodeData,"$..ModuleClientState..status")[0]; + secondaryAnlNode = jsonPath(ctrlNodeData,"$..ModuleClientState..secondary")[0].split(':')[0]; + }catch(e){ + anlNode = "--"; + } + try{ + if(anlNode != null && anlNode != noDataStr && status.toLowerCase() == "established") + anlNode = anlNode.concat(' (Up)'); + }catch(e){ + if(anlNode != null && anlNode != noDataStr) { + anlNode = anlNode.concat(' (Down)'); + } + } + if(secondaryAnlNode != null && secondaryAnlNode != "" && secondaryAnlNode != "0.0.0.0"){ + anlNode.concat(', ' + secondaryAnlNode); + } + return ifNull(anlNode,noDataStr); + })()}, + //TODO{lbl:'Config Messages', value:ctrlNodeData['configMessagesIn'] + ' In, ' + ctrlNodeData['configMessagesOut'] + ' Out'}, + {lbl:'Analytics Messages', value:(function(){ + var msgs = getAnalyticsMessagesCountAndSize(ctrlNodeData,['ControlNode']); + return msgs['count'] + ' [' + formatBytes(msgs['size']) + ']'; + })()}, + {lbl:'Peers', value:(function(){ + var totpeers= 0,uppeers=0; + totpeers= ifNull(parsedData['totalBgpPeerCnt'],0); + uppeers = ifNull(parsedData['upBgpPeerCnt'],0); + var downpeers = 0; + if(totpeers > 0){ + downpeers = totpeers - uppeers; + } + if (downpeers > 0){ + downpeers = ", "+ downpeers +" Down"; + } else { + downpeers = ""; + } + return contrail.format('BGP Peers: {0} Total {1}',totpeers,downpeers); + })()}, + {lbl:'',value:(function(){ + var totXmppPeers = 0,upXmppPeers = 0,downXmppPeers = 0,subsCnt = 0; + totXmppPeers = parsedData['totalXMPPPeerCnt']; + upXmppPeers = parsedData['upXMPPPeerCnt']; + subsCnt = ifNull(jsonPath(ctrlNodeData,'$..BgpRouterState.ifmap_server_info.num_peer_clients')[0],0) + if(totXmppPeers > 0){ + downXmppPeers = totXmppPeers - upXmppPeers; + } + if (downXmppPeers > 0){ + downXmppPeers = ", "+ downXmppPeers +" Down"; + } else { + downXmppPeers = ""; + } + if (subsCnt > 0){ + subsCnt = ", "+ subsCnt +" subscribed for configuration"; + } else { + subsCnt = "" + } + return contrail.format('vRouters: {0} Established in Sync{1}{2} ', + upXmppPeers,downXmppPeers,subsCnt); + })()}, + {lbl:'CPU', value:$.isNumeric(parsedData['cpu']) ? parsedData['cpu'] + ' %' : noDataStr}, + {lbl:'Memory', value:parsedData['memory'] != '-' ? parsedData['memory'] : noDataStr}, + {lbl:'Version', value:parsedData['version'] != '-' ? parsedData['version'] : noDataStr}, + {lbl:'Last Log', value: (function(){ + var lmsg; + lmsg = getLastLogTimestamp(ctrlNodeData,"control"); + if(lmsg != null){ + try{ + return new Date(parseInt(lmsg)/1000).toLocaleString(); + }catch(e){return noDataStr;} + } else return noDataStr; + })()} + ]; + } + return ctrlNodeDashboardInfo; +} + +function getStatusesForAllControlProcesses(processStateList){ + var ret = []; + if(processStateList != null){ + for(var i=0; i < processStateList.length; i++){ + var currProc = processStateList[i]; + if(currProc.process_name == "contrail-control-nodemgr"){ + ret['contrail-control-nodemgr'] = getProcessUpTime(currProc); + } else if(currProc.process_name == "contrail-control"){ + ret['contrail-control'] = getProcessUpTime(currProc); + } + } + } + return ret; + } + +/*****\END Get label value pairs for Control Node details and detail template in summary *****/ + + +/**** Get label value pairs for vRouter Node details and detail template in summaryv****/ +function getvRouterDetailsLblValuePairs(parsedData) { + var computeNodeDashboardInfo = []; + var computeNodeData; + if(parsedData.raw_json != null && parsedData.raw_json.value){ + computeNodeData = parsedData.raw_json.value; + } + if(computeNodeData != null){ + var overallStatus = getOverallNodeStatusForDetails(parsedData); + var procStateList = getValueByJsonPath(computeNodeData,"NodeStatus;process_info"); + var vRouterProcessStatusList = getStatusesForAllvRouterProcesses(procStateList); + + computeNodeDashboardInfo = [ + {lbl:'Hostname', value:parsedData.name}, + {lbl:'IP Address', value:(function(){ + return ifNullOrEmpty(getVrouterIpAddresses(computeNodeData,"details"),noDataStr); + })()}, + {lbl:'Overall Node Status', value:overallStatus}, + {lbl:'Processes', value:" "}, + {lbl:INDENT_RIGHT+'vRouter Agent', value:(function(){ + return ifNull(vRouterProcessStatusList['contrail-vrouter-agent'],noDataStr); + })()}, + /*{lbl:INDENT_RIGHT+'vRouter Node Manager', value:(function(){ + try{ + return ifNull(vRouterProcessStatusList['contrail-vrouter-nodemgr'],noDataStr); + }catch(e){return noDataStr;} + })()}, + {lbl:INDENT_RIGHT+'Openstack Nova Compute', value:(function(){ + try{ + return ifNull(vRouterProcessStatusList['openstack-nova-compute'],noDataStr); + }catch(e){return noDataStr;} + })()},*/ + {lbl:'Analytics Node', value:(function(){ + var anlNode = noDataStr; + var secondaryAnlNode, status; + try{ + //anlNode = ifNull(computeNodeData.VrouterAgent.collector,noDataStr); + anlNode = jsonPath(computeNodeData,"$..ModuleClientState..primary")[0].split(':')[0]; + status = jsonPath(computeNodeData,"$..ModuleClientState..status")[0]; + secondaryAnlNode = jsonPath(computeNodeData,"$..ModuleClientState..secondary")[0].split(':')[0]; + }catch(e){ + anlNode = noDataStr; + } + try{ + if(anlNode != null && anlNode != noDataStr && status.toLowerCase() == "established") + anlNode = anlNode.concat(' (Up)'); + }catch(e){ + if(anlNode != null && anlNode != noDataStr) { + anlNode = anlNode.concat(' (Down)'); + } + } + if(secondaryAnlNode != null && secondaryAnlNode != "" && secondaryAnlNode != "0.0.0.0"){ + anlNode.concat(', ' + secondaryAnlNode); + } + return ifNull(anlNode,noDataStr); + })()}, + {lbl:'Control Nodes', value:(function(){ + var peerList ; + try{ + peerList = computeNodeData.VrouterAgent.xmpp_peer_list; + }catch(e){} + var nodeArr=noDataStr ; + if(peerList != null && peerList.length>0){ + nodeArr = '
'; + var nodes = ''; + + for (var i=0; i< peerList.length;i++){ + var node = ''; + node = ''+ peerList[i].ip +'' ; + + if(peerList[i].primary != null && peerList[i].primary == true){ + if(peerList[i].status == true){ + if((i+1) == peerList.length){//only primary present + node = node + "* (Up) " ; + } else { + node = node + "* (Up), " ; + } + } else { + node = "" + node + "* (Down), " ; + } + if(nodes == ''){ + nodes = node; + } else { + nodes = node + nodes + } + } else { + if(peerList[i].status == true) + node = node + " (Up)" ; + else + node = "" + node + " (Down)" ; + if(node != ''){ + nodes = nodes + node + } else { + nodes = node; + } + } + } + nodeArr = nodeArr + nodes + '
' + } + return nodeArr; + })(),clk:'url'}, + + //Best way to get the primary node - jsonPath(computeNodeData,'$.VrouterAgent.xmpp_peer_list[?(@.primary==true)].ip')}, + {lbl:'Analytics Messages', value:(function(){ + var msgs = getAnalyticsMessagesCountAndSize(computeNodeData,['VRouterAgent']); + return msgs['count'] + ' [' + formatBytes(msgs['size']) + ']'; + })()}, + {lbl:'XMPP Messages', value:(function(){ + var xmppStatsList = getValueByJsonPath(computeNodeData,'VrouterStatsAgent;xmpp_stats_list',[]); + var inMsgs = outMsgs = 0; + for(var i = 0; i < xmppStatsList.length ; i++) { + inMsgs += getValueByJsonPath(xmppStatsList[i],'in_msgs',0); + outMsgs += getValueByJsonPath(xmppStatsList[i],'out_msgs',0); + } + return (inMsgs + ' In, ' + outMsgs + ' Out'); + })()}, + {lbl:'Flow Count', value:(function(){ + return (getValueByJsonPath(computeNodeData,"VrouterStatsAgent;active_flows", noDataStr) + ' Active, ' + + getValueByJsonPath(computeNodeData,"VrouterStatsAgent;total_flows", noDataStr) + ' Total'); + })()}, + {lbl:'Networks', value:parsedData['vnCnt']}, + {lbl:'Interfaces', value:(function(){ + var downInts = parsedData['errorIntfCnt']; + var totInts = parsedData['intfCnt']; + var ret; + if(downInts > 0){ + downInts = ", " + downInts + " Down"; + } else { + downInts = ""; + } + return totInts + " Total" + downInts; + })()}, + {lbl:'Instances', value:parsedData['instCnt']}, + {lbl:'CPU', value:$.isNumeric(parsedData['cpu']) ? parsedData['cpu'] + ' %' : noDataStr}, + {lbl:'Memory', value:parsedData['memory'] != '-' ? parsedData['memory'] : noDataStr}, + {lbl:'Version', value:parsedData['version'] != '-' ? parsedData['version'] : noDataStr}, + {lbl:'Last Log', value: (function(){ + var lmsg; + lmsg = getLastLogTimestamp(computeNodeData,"compute"); + if(lmsg != null){ + try{ + return new Date(parseInt(lmsg)/1000).toLocaleString(); + }catch(e){return noDataStr;} + } else return noDataStr; + })()} + ]; + }//if + return computeNodeDashboardInfo; +} + +function getStatusesForAllvRouterProcesses(processStateList){ + var ret = []; + if(processStateList != null){ + for(var i=0; i < processStateList.length; i++){ + var currProc = processStateList[i]; + if(currProc.process_name == "contrail-vrouter-nodemgr"){ + ret['contrail-vrouter-nodemgr'] = getProcessUpTime(currProc); + } else if (currProc.process_name == "openstack-nova-compute"){ + ret['openstack-nova-compute'] = getProcessUpTime(currProc); + } else if (currProc.process_name == "contrail-vrouter-agent"){ + ret['contrail-vrouter-agent'] = getProcessUpTime(currProc); + } + } + } + return ret; +} + + +/****\END Get label value pairs for vRouter Node details and detail template in summary****/ + +/**** Get label value pairs for Analytics Node details and detail template in summary****/ +function getAnalyticsNodeLblValuePairs(parsedData){ + var aNodeDashboardInfo = []; + var aNodeData = parsedData.raw_json; + var analyticsProcessStatusList = []; + var procStateList, overallStatus = noDataStr; + + if(parsedData.raw_json != null && parsedData.raw_json.value){ + aNodeData = parsedData.raw_json.value; + } + if(aNodeData != null){ + overallStatus = getOverallNodeStatusForDetails(parsedData); + procStateList = getValueByJsonPath(aNodeData,"NodeStatus;process_info",[]); + analyticsProcessStatusList = getStatusesForAllAnalyticsProcesses(procStateList); + aNodeDashboardInfo = [ + {lbl:'Hostname', value:parsedData.name}, + {lbl:'IP Address', value:(function(){ + var ips = ''; + iplist = getValueByJsonPath(aNodeData,"CollectorState;self_ip_list",[]); + if(iplist != null && iplist.length>0){ + for (var i=0; i< iplist.length;i++){ + if(i+1 == iplist.length) { + ips = ips + iplist[i]; + } else { + ips = ips + iplist[i] + ', '; + } + } + } else { + ips = noDataStr; + } + return ips; + })()}, + {lbl:'Overall Node Status', value:overallStatus}, + {lbl:'Processes', value:" "}, + /*{lbl:INDENT_RIGHT+'Analytics Node Manager', value:(function(){ + try{ + return ifNull(analyticsProcessStatusList['contrail-analytics-nodemgr'],noDataStr); + }catch(e){return noDataStr;} + })()},*/ + {lbl:INDENT_RIGHT+'Collector', value:(function(){ + return ifNull(analyticsProcessStatusList['contrail-collector'],noDataStr); + })()}, + {lbl:INDENT_RIGHT+'Query Engine', value:(function(){ + return ifNull(analyticsProcessStatusList['contrail-query-engine'],noDataStr); + })()}, + {lbl:INDENT_RIGHT+'OpServer', value:(function(){ + return ifNull(analyticsProcessStatusList['contrail-analytics-api'],noDataStr); + })()}, + /* {lbl:INDENT_RIGHT+'Redis Sentinel', value:(function(){ + return ifNull(analyticsProcessStatusList['redis-sentinel'],noDataStr); + })()},*/ + {lbl:'CPU', value:$.isNumeric(parsedData['cpu']) ? parsedData['cpu'] + ' %' : noDataStr}, + {lbl:'Memory', value:parsedData['memory'] != '-' ? parsedData['memory'] : noDataStr}, + {lbl:'Messages', value:(function(){ + var msgs = getAnalyticsMessagesCountAndSize(aNodeData,['Collector']); + return msgs['count'] + ' [' + formatBytes(msgs['size']) + ']'; + })()}, + {lbl:'Generators', value:(function(){ + var ret=''; + var genno; + try{ + if(aNodeData.CollectorState["generator_infos"]!=null){ + genno = aNodeData.CollectorState["generator_infos"].length; + }; + ret = ret + ifNull(genno,noDataStr); + }catch(e){ return noDataStr;} + return ret; + })()}, + {lbl:'Version', value:parsedData['version'] != '-' ? parsedData['version'] : noDataStr}, + {lbl:'Last Log', value: (function(){ + var lmsg; + lmsg = getLastLogTimestamp(aNodeData,"analytics"); + if(lmsg != null){ + try{ + return new Date(parseInt(lmsg)/1000).toLocaleString(); + }catch(e){return noDataStr;} + } else return noDataStr; + })()} + ]; + } + return aNodeDashboardInfo; +} + +function getStatusesForAllAnalyticsProcesses(processStateList){ + var ret = []; + if(processStateList != null){ + for(var i=0; i < processStateList.length; i++){ + var currProc = processStateList[i]; + if (currProc.process_name == "contrail-query-engine"){ + ret['contrail-query-engine'] = getProcessUpTime(currProc); + } else if (currProc.process_name == "contrail-analytics-nodemgr"){ + ret['contrail-analytics-nodemgr'] = getProcessUpTime(currProc); + } else if (currProc.process_name == "contrail-analytics-api"){ + ret['contrail-analytics-api'] = getProcessUpTime(currProc); + } else if (currProc.process_name == "contrail-collector"){ + ret['contrail-collector'] = getProcessUpTime(currProc); + } + } + } + return ret; +} +/****\END Get label value pairs for Analytics Node details and detail template in summaryv****/ + +/**** Get label value pairs for Config Node details and detail template in summary****/ +function getConfigNodeLblValuePairs(parsedData){ + var confNodeDashboardInfo = []; + var confNodeData = parsedData.raw_json; + var analyticsProcessStatusList = []; + + if(parsedData.raw_json != null && parsedData.raw_json.value){ + confNodeData = parsedData.raw_json.value; + } + if(confNodeData != null){ + var procStateList, overallStatus = noDataStr; + var configProcessStatusList = []; + overallStatus = getOverallNodeStatusForDetails(parsedData); + procStateList = getValueByJsonPath(confNodeData,"configNode;NodeStatus;process_info",[]); + if(!(procStateList instanceof Array)){ + procStateList = [procStateList]; + } + configProcessStatusList = getStatusesForAllConfigProcesses(procStateList); + confNodeDashboardInfo = [ + {lbl:'Hostname', value:parsedData.name}, + {lbl:'IP Address', value:(function (){ + var ips = ''; + try{ + iplist = getValueByJsonPath(confNodeData,"configNode;ModuleCpuState;config_node_ip",[]); + if(iplist instanceof Array){ + nodeIp = iplist[0];//using the first ip in the list for status + } else { + nodeIp = iplist; + } + } catch(e){return noDataStr;} + if(iplist != null && iplist != noDataStr && iplist.length>0){ + for (var i=0; i< iplist.length;i++){ + if(i+1 == iplist.length) { + ips = ips + iplist[i]; + } else { + ips = ips + iplist[i] + ', '; + } + } + } else { + ips = noDataStr; + } + return ips; + })()}, + {lbl:'Overall Node Status', value:overallStatus}, + {lbl:'Processes', value:" "}, + {lbl:INDENT_RIGHT+'API Server', value:(function(){ + return configProcessStatusList['contrail-api']; + })()}, + {lbl:INDENT_RIGHT+'Schema Transformer', value:(function(){ + return configProcessStatusList['contrail-schema']; + })()}, + {lbl:INDENT_RIGHT+'Service Monitor', value:(function(){ + return configProcessStatusList['contrail-svc-monitor']; + })()}, + /*{lbl:INDENT_RIGHT+'Config Node Manager', value:(function(){ + return ifNull(configProcessStatusList['contrail-config-nodemgr'],noDataStr); + })()},*/ + {lbl:INDENT_RIGHT+'Discovery', value:(function(){ + return ifNull(configProcessStatusList['contrail-discovery'],noDataStr); + })()}, + /* {lbl:INDENT_RIGHT+'Zookeeper', value:(function(){ + return ifNull(configProcessStatusList['contrail-zookeeper'],noDataStr); + })()},*/ + {lbl:INDENT_RIGHT+'Ifmap', value:(function(){ + return ifNull(configProcessStatusList['ifmap'],noDataStr); + })()}, + {lbl:'Analytics Node', value:(function(){ + var anlNode = noDataStr; + var secondaryAnlNode, status; + try{ + //anlNode = ifNull(computeNodeData.VrouterAgent.collector,noDataStr); + anlNode = jsonPath(confNodeData,"$..ModuleClientState..primary")[0].split(':')[0]; + status = jsonPath(confNodeData,"$..ModuleClientState..status")[0]; + secondaryAnlNode = ifNull(jsonPath(confNodeData,"$..ModuleClientState..secondary")[0],"").split(':')[0]; + }catch(e){ + anlNode = "--"; + } + try{ + if(anlNode != null && anlNode != noDataStr && status.toLowerCase() == "established") + anlNode = anlNode.concat(' (Up)'); + }catch(e){ + if(anlNode != null && anlNode != noDataStr) { + anlNode = anlNode.concat(' (Down)'); + } + } + if(secondaryAnlNode != null && secondaryAnlNode != "" && secondaryAnlNode != "0.0.0.0"){ + anlNode.concat(', ' + secondaryAnlNode); + } + return ifNull(anlNode,noDataStr); + })()}, + // {lbl:'Analytics Messages', value:(function(){return (parseInt(confNodeData.ApiServer.ModuleServerState["generator_info"]["connect_time"]) + // > parseInt(confNodeData.ModuleServerState["generator_info"]["reset_time"]))?"Up":"Down"})()}, + {lbl:'CPU', value:$.isNumeric(parsedData['cpu']) ? parsedData['cpu'] + ' %' : noDataStr}, + {lbl:'Memory', value:parsedData['memory'] != '-' ? parsedData['memory'] : noDataStr}, + {lbl:'Version', value:parsedData['version'] != '-' ? parsedData['version'] : noDataStr}, + {lbl:'Last Log', value: (function(){ + var lmsg; + lmsg = getLastLogTimestamp(confNodeData,"config"); + if(lmsg != null){ + try{ + return new Date(parseInt(lmsg)/1000).toLocaleString(); + }catch(e){return noDataStr;} + } else return noDataStr; + })()} + ]; + } + return confNodeDashboardInfo; +} + +/****\END Get label value pairs for Config Node details and detail template in summary****/ \ No newline at end of file diff --git a/webroot/monitor/infra/confignode/ui/js/monitor_infra_confignode_details.js b/webroot/monitor/infra/confignode/ui/js/monitor_infra_confignode_details.js index 89409bda7..46d391f3f 100644 --- a/webroot/monitor/infra/confignode/ui/js/monitor_infra_confignode_details.js +++ b/webroot/monitor/infra/confignode/ui/js/monitor_infra_confignode_details.js @@ -61,102 +61,9 @@ monitorInfraConfigDetailsClass = (function() { memory = "N/A", confNodeDashboardInfo, oneMinCPU, fiveMinCPU, fifteenMinCPU, usedMemory, totalMemory; - var procStateList, overallStatus = noDataStr; - var configProcessStatusList = []; + var statusTemplate = contrail.getTemplate4Id("statusTemplate"); - overallStatus = getOverallNodeStatusForDetails(parsedData); - procStateList = getValueByJsonPath(confNodeData,"configNode;NodeStatus;process_info",[]); - if(!(procStateList instanceof Array)){ - procStateList = [procStateList]; - } - configProcessStatusList = getStatusesForAllConfigProcesses(procStateList); - confNodeDashboardInfo = [ - {lbl:'Hostname', value:obj['name']}, - {lbl:'IP Address', value:(function (){ - var ips = ''; - try{ - iplist = getValueByJsonPath(confNodeData,"configNode;ModuleCpuState;config_node_ip",[]); - if(iplist instanceof Array){ - nodeIp = iplist[0];//using the first ip in the list for status - } else { - nodeIp = iplist; - } - } catch(e){return noDataStr;} - if(iplist != null && iplist != noDataStr && iplist.length>0){ - for (var i=0; i< iplist.length;i++){ - if(i+1 == iplist.length) { - ips = ips + iplist[i]; - } else { - ips = ips + iplist[i] + ', '; - } - } - } else { - ips = noDataStr; - } - return ips; - })()}, - {lbl:'Overall Node Status', value:overallStatus}, - {lbl:'Processes', value:" "}, - {lbl:INDENT_RIGHT+'API Server', value:(function(){ - return configProcessStatusList['contrail-api']; - })()}, - {lbl:INDENT_RIGHT+'Schema Transformer', value:(function(){ - return configProcessStatusList['contrail-schema']; - })()}, - {lbl:INDENT_RIGHT+'Service Monitor', value:(function(){ - return configProcessStatusList['contrail-svc-monitor']; - })()}, - /*{lbl:INDENT_RIGHT+'Config Node Manager', value:(function(){ - return ifNull(configProcessStatusList['contrail-config-nodemgr'],noDataStr); - })()},*/ - {lbl:INDENT_RIGHT+'Discovery', value:(function(){ - return ifNull(configProcessStatusList['contrail-discovery'],noDataStr); - })()}, - /* {lbl:INDENT_RIGHT+'Zookeeper', value:(function(){ - return ifNull(configProcessStatusList['contrail-zookeeper'],noDataStr); - })()},*/ - {lbl:INDENT_RIGHT+'Ifmap', value:(function(){ - return ifNull(configProcessStatusList['ifmap'],noDataStr); - })()}, - {lbl:'Analytics Node', value:(function(){ - var anlNode = noDataStr; - var secondaryAnlNode, status; - try{ - //anlNode = ifNull(computeNodeData.VrouterAgent.collector,noDataStr); - anlNode = jsonPath(confNodeData,"$..ModuleClientState..primary")[0].split(':')[0]; - status = jsonPath(confNodeData,"$..ModuleClientState..status")[0]; - secondaryAnlNode = ifNull(jsonPath(confNodeData,"$..ModuleClientState..secondary")[0],"").split(':')[0]; - }catch(e){ - anlNode = "--"; - } - try{ - if(anlNode != null && anlNode != noDataStr && status.toLowerCase() == "established") - anlNode = anlNode.concat(' (Up)'); - }catch(e){ - if(anlNode != null && anlNode != noDataStr) { - anlNode = anlNode.concat(' (Down)'); - } - } - if(secondaryAnlNode != null && secondaryAnlNode != "" && secondaryAnlNode != "0.0.0.0"){ - anlNode.concat(', ' + secondaryAnlNode); - } - return ifNull(anlNode,noDataStr); - })()}, - // {lbl:'Analytics Messages', value:(function(){return (parseInt(confNodeData.ApiServer.ModuleServerState["generator_info"]["connect_time"]) - // > parseInt(confNodeData.ModuleServerState["generator_info"]["reset_time"]))?"Up":"Down"})()}, - {lbl:'CPU', value:$.isNumeric(parsedData['cpu']) ? parsedData['cpu'] + ' %' : noDataStr}, - {lbl:'Memory', value:parsedData['memory'] != '-' ? parsedData['memory'] : noDataStr}, - {lbl:'Version', value:parsedData['version'] != '-' ? parsedData['version'] : noDataStr}, - {lbl:'Last Log', value: (function(){ - var lmsg; - lmsg = getLastLogTimestamp(confNodeData,"config"); - if(lmsg != null){ - try{ - return new Date(parseInt(lmsg)/1000).toLocaleString(); - }catch(e){return noDataStr;} - } else return noDataStr; - })()} - ] + confNodeDashboardInfo = getConfigNodeLblValuePairs(parsedData); /*Selenium Testing*/ confNodeDetailsData = confNodeDashboardInfo; /*End of Selenium Testing*/ diff --git a/webroot/monitor/infra/confignode/ui/js/monitor_infra_confignode_summary.js b/webroot/monitor/infra/confignode/ui/js/monitor_infra_confignode_summary.js index 84dc7897a..6b3ccbfc6 100644 --- a/webroot/monitor/infra/confignode/ui/js/monitor_infra_confignode_summary.js +++ b/webroot/monitor/infra/confignode/ui/js/monitor_infra_confignode_summary.js @@ -29,7 +29,29 @@ monitorInfraConfigSummaryClass = (function() { autoHeight : true, enableAsyncPostRender:true, forceFitColumns:true, - lazyLoading:true + lazyLoading:true, + detail:{ + template: $("#gridDetailTemplate").html(), + onExpand: function (e,dc) { + var detailTemplate = contrail.getTemplate4Id('infra-summary-details-template'); + var rowData = e.data; + var grid = $(e['target']).closest('div.contrail-grid'); + var dataItem = dc; + var data = getConfigNodeLblValuePairs(dc); + data = {d:data}; + //Issue a call for fetching the details + if(data != null) { + e.detailRow.find('.row-fluid.advancedDetails').html('
' + syntaxHighlight(dc.raw_json) + '
'); + //DataItem consists of row data,passing it as a parameter to the parsefunction + e.detailRow.find('.row-fluid.basicDetails').html(detailTemplate(data)); + $(grid).data('contrailGrid').adjustDetailRowHeight(dataItem['id']); + } else { + e.detailRow.find('.row-fluid.basicDetails').html(detailTemplate(data)); + } + }, + onCollapse:function (e,dc) { + } + } }, dataSource: { dataView: configNodesDataSource, diff --git a/webroot/monitor/infra/controlnode/ui/js/monitor_infra_controlnode_details.js b/webroot/monitor/infra/controlnode/ui/js/monitor_infra_controlnode_details.js index 4537acbd3..cc67e03c4 100644 --- a/webroot/monitor/infra/controlnode/ui/js/monitor_infra_controlnode_details.js +++ b/webroot/monitor/infra/controlnode/ui/js/monitor_infra_controlnode_details.js @@ -44,147 +44,11 @@ monitorInfraControlDetailsClass = (function() { return contrail.format(monitorInfraUrls['FLOWSERIES_CPU'], 'ControlNode', '30', '10', obj['name'], endTime); }, parser: "parseProcessMemCPUData", plotOnLoad: true, showWidgetIds: [], hideWidgetIds: [], titles: {memTitle:'Memory',cpuTitle:'% CPU Utilization'}}),110); }); - var procStateList, overallStatus = noDataStr; - var controlProcessStatusList = []; + var statusTemplate = contrail.getTemplate4Id("statusTemplate"); - try{ - overallStatus = getOverallNodeStatusForDetails(parsedData); - }catch(e){overallStatus = " "+statusTemplate({sevLevel:sevLevels['ERROR'],sevLevels:sevLevels})+" Down";} - try{ - procStateList = jsonPath(ctrlNodeData,"$..NodeStatus.process_info")[0]; - controlProcessStatusList = getStatusesForAllControlProcesses(procStateList); - }catch(e){} - ctrlNodeDashboardInfo = [ - {lbl:'Hostname', value:obj['name']}, - {lbl:'IP Address',value:(function(){ - var ip = ifNullOrEmpty(getControlIpAddresses(ctrlNodeData,"details"),noDataStr); - return ip; - })()}, - {lbl:'Overall Node Status', value:overallStatus}, - {lbl:'Processes', value:" "}, - {lbl:INDENT_RIGHT+'Control Node', value:(function(){ - return ifNull(controlProcessStatusList['contrail-control'],noDataStr); - })()}, - /*{lbl:INDENT_RIGHT+'Control Node Manager', value:(function(){ - try{ - return ifNull(controlProcessStatusList['contrail-control-nodemgr'],noDataStr); - }catch(e){return noDataStr;} - })()},*/ - {lbl:'Ifmap Connection', value:(function(){ - var cnfNode = ''; - try{ - var url = ctrlNodeData.BgpRouterState.ifmap_info.url; - if(url != null && url != undefined && url != ""){ - var pos = url.indexOf(':8443'); - if(pos != -1) - cnfNode = url.substr(0, pos); - pos = cnfNode.indexOf('https://'); - if(pos != -1) - cnfNode = cnfNode.slice(pos + 8) ; - } - var status = ctrlNodeData.BgpRouterState.ifmap_info.connection_status; - var stateChangeAtTime = ctrlNodeData.BgpRouterState.ifmap_info.connection_status_change_at; - var stateChangeSince = ""; - var statusString = ""; - if(stateChangeAtTime != null){ - var stateChangeAtTime = new XDate(stateChangeAtTime/1000); - var currTime = new XDate(); - stateChangeSince = diffDates(stateChangeAtTime,currTime); - } - if(status != null && status != undefined && status != ""){ - if(stateChangeSince != ""){ - if(status.toLowerCase() == "up" || status.toLowerCase() == "down"){ - status = status + " since"; - } - statusString = status + " " + stateChangeSince; - } else { - statusString = status; - } - } - if(statusString != ""){ - cnfNode = cnfNode.concat( ' (' + statusString + ')'); - } - }catch (e){} - return ifNull(cnfNode,noDataStr); - })()}, - {lbl:'Analytics Node', value:(function(){ - var anlNode = noDataStr; - var secondaryAnlNode, status; - try{ - //anlNode = ifNull(computeNodeData.VrouterAgent.collector,noDataStr); - anlNode = jsonPath(ctrlNodeData,"$..ModuleClientState..primary")[0].split(':')[0]; - status = jsonPath(ctrlNodeData,"$..ModuleClientState..status")[0]; - secondaryAnlNode = jsonPath(ctrlNodeData,"$..ModuleClientState..secondary")[0].split(':')[0]; - }catch(e){ - anlNode = "--"; - } - try{ - if(anlNode != null && anlNode != noDataStr && status.toLowerCase() == "established") - anlNode = anlNode.concat(' (Up)'); - }catch(e){ - if(anlNode != null && anlNode != noDataStr) { - anlNode = anlNode.concat(' (Down)'); - } - } - if(secondaryAnlNode != null && secondaryAnlNode != "" && secondaryAnlNode != "0.0.0.0"){ - anlNode.concat(', ' + secondaryAnlNode); - } - return ifNull(anlNode,noDataStr); - })()}, - //TODO{lbl:'Config Messages', value:ctrlNodeData['configMessagesIn'] + ' In, ' + ctrlNodeData['configMessagesOut'] + ' Out'}, - {lbl:'Analytics Messages', value:(function(){ - var msgs = getAnalyticsMessagesCountAndSize(ctrlNodeData,['ControlNode']); - return msgs['count'] + ' [' + formatBytes(msgs['size']) + ']'; - })()}, - {lbl:'Peers', value:(function(){ - var totpeers= 0,uppeers=0; - totpeers= ifNull(parsedData['totalBgpPeerCnt'],0); - uppeers = ifNull(parsedData['upBgpPeerCnt'],0); - var downpeers = 0; - if(totpeers > 0){ - downpeers = totpeers - uppeers; - } - if (downpeers > 0){ - downpeers = ", "+ downpeers +" Down"; - } else { - downpeers = ""; - } - return contrail.format('BGP Peers: {0} Total {1}',totpeers,downpeers); - })()}, - {lbl:'',value:(function(){ - var totXmppPeers = 0,upXmppPeers = 0,downXmppPeers = 0,subsCnt = 0; - totXmppPeers = parsedData['totalXMPPPeerCnt']; - upXmppPeers = parsedData['upXMPPPeerCnt']; - subsCnt = ifNull(jsonPath(ctrlNodeData,'$..BgpRouterState.ifmap_server_info.num_peer_clients')[0],0) - if(totXmppPeers > 0){ - downXmppPeers = totXmppPeers - upXmppPeers; - } - if (downXmppPeers > 0){ - downXmppPeers = ", "+ downXmppPeers +" Down"; - } else { - downXmppPeers = ""; - } - if (subsCnt > 0){ - subsCnt = ", "+ subsCnt +" subscribed for configuration"; - } else { - subsCnt = "" - } - return contrail.format('vRouters: {0} Established in Sync{1}{2} ', - upXmppPeers,downXmppPeers,subsCnt); - })()}, - {lbl:'CPU', value:$.isNumeric(parsedData['cpu']) ? parsedData['cpu'] + ' %' : noDataStr}, - {lbl:'Memory', value:parsedData['memory'] != '-' ? parsedData['memory'] : noDataStr}, - {lbl:'Version', value:parsedData['version'] != '-' ? parsedData['version'] : noDataStr}, - {lbl:'Last Log', value: (function(){ - var lmsg; - lmsg = getLastLogTimestamp(ctrlNodeData,"control"); - if(lmsg != null){ - try{ - return new Date(parseInt(lmsg)/1000).toLocaleString(); - }catch(e){return noDataStr;} - } else return noDataStr; - })()} - ] + + ctrlNodeDashboardInfo = getControlNodeDetailsLblValuePairs(parsedData); + /*Selenium Testing*/ ctrlNodeDetailsData = ctrlNodeDashboardInfo; /*End of Selenium Testing*/ @@ -220,21 +84,6 @@ monitorInfraControlDetailsClass = (function() { return {populateDetailsTab:populateDetailsTab} })(); -function getStatusesForAllControlProcesses(processStateList){ - var ret = []; - if(processStateList != null){ - for(var i=0; i < processStateList.length; i++){ - var currProc = processStateList[i]; - if(currProc.process_name == "contrail-control-nodemgr"){ - ret['contrail-control-nodemgr'] = getProcessUpTime(currProc); - } else if(currProc.process_name == "contrail-control"){ - ret['contrail-control'] = getProcessUpTime(currProc); - } - } - } - return ret; - } - function getControlNodeIpAddressList(data){ var ips = getValueByJsonPath(data,'$..bgp_router_ip_list',[]); var configip = jsonPath(data,'$..ConfigData..bgp_router_parameters.address')[0]; diff --git a/webroot/monitor/infra/controlnode/ui/js/monitor_infra_controlnode_summary.js b/webroot/monitor/infra/controlnode/ui/js/monitor_infra_controlnode_summary.js index 5deeb7a11..bbd08e459 100644 --- a/webroot/monitor/infra/controlnode/ui/js/monitor_infra_controlnode_summary.js +++ b/webroot/monitor/infra/controlnode/ui/js/monitor_infra_controlnode_summary.js @@ -33,7 +33,29 @@ monitorInfraControlSummaryClass = (function() { autoHeight : true, forceFitColumns:true, enableAsyncPostRender: true, - lazyLoading:true + lazyLoading:true, + detail:{ + template: $("#gridDetailTemplate").html(), + onExpand: function (e,dc) { + var detailTemplate = contrail.getTemplate4Id('infra-summary-details-template'); + var rowData = e.data; + var grid = $(e['target']).closest('div.contrail-grid'); + var dataItem = dc; + var data = getControlNodeDetailsLblValuePairs(dc); + data = {d:data}; + //Issue a call for fetching the details + if(data != null) { + e.detailRow.find('.row-fluid.advancedDetails').html('
' + syntaxHighlight(dc.raw_json) + '
'); + //DataItem consists of row data,passing it as a parameter to the parsefunction + e.detailRow.find('.row-fluid.basicDetails').html(detailTemplate(data)); + $(grid).data('contrailGrid').adjustDetailRowHeight(dataItem['id']); + } else { + e.detailRow.find('.row-fluid.basicDetails').html(detailTemplate(data)); + } + }, + onCollapse:function (e,dc) { + } + }, }, dataSource: { dataView: controlNodesDataSource, diff --git a/webroot/monitor/infra/vrouter/ui/js/monitor_infra_vrouter_details.js b/webroot/monitor/infra/vrouter/ui/js/monitor_infra_vrouter_details.js index 014f2512e..793a2e6b9 100644 --- a/webroot/monitor/infra/vrouter/ui/js/monitor_infra_vrouter_details.js +++ b/webroot/monitor/infra/vrouter/ui/js/monitor_infra_vrouter_details.js @@ -56,143 +56,7 @@ monitorInfraComputeDetailsClass = (function() { var procStateList, overallStatus = noDataStr; var vRouterProcessStatusList = []; var statusTemplate = contrail.getTemplate4Id("statusTemplate"); - overallStatus = getOverallNodeStatusForDetails(parsedData); - procStateList = getValueByJsonPath(computeNodeData,"NodeStatus;process_info"); - vRouterProcessStatusList = getStatusesForAllvRouterProcesses(procStateList); - computeNodeDashboardInfo = [ - {lbl:'Hostname', value:obj['name']}, - {lbl:'IP Address', value:(function(){ - return ifNullOrEmpty(getVrouterIpAddresses(computeNodeData,"details"),noDataStr); - })()}, - {lbl:'Overall Node Status', value:overallStatus}, - {lbl:'Processes', value:" "}, - {lbl:INDENT_RIGHT+'vRouter Agent', value:(function(){ - return ifNull(vRouterProcessStatusList['contrail-vrouter-agent'],noDataStr); - })()}, - /*{lbl:INDENT_RIGHT+'vRouter Node Manager', value:(function(){ - try{ - return ifNull(vRouterProcessStatusList['contrail-vrouter-nodemgr'],noDataStr); - }catch(e){return noDataStr;} - })()}, - {lbl:INDENT_RIGHT+'Openstack Nova Compute', value:(function(){ - try{ - return ifNull(vRouterProcessStatusList['openstack-nova-compute'],noDataStr); - }catch(e){return noDataStr;} - })()},*/ - {lbl:'Analytics Node', value:(function(){ - var anlNode = noDataStr; - var secondaryAnlNode, status; - try{ - //anlNode = ifNull(computeNodeData.VrouterAgent.collector,noDataStr); - anlNode = jsonPath(computeNodeData,"$..ModuleClientState..primary")[0].split(':')[0]; - status = jsonPath(computeNodeData,"$..ModuleClientState..status")[0]; - secondaryAnlNode = jsonPath(computeNodeData,"$..ModuleClientState..secondary")[0].split(':')[0]; - }catch(e){ - anlNode = noDataStr; - } - try{ - if(anlNode != null && anlNode != noDataStr && status.toLowerCase() == "established") - anlNode = anlNode.concat(' (Up)'); - }catch(e){ - if(anlNode != null && anlNode != noDataStr) { - anlNode = anlNode.concat(' (Down)'); - } - } - if(secondaryAnlNode != null && secondaryAnlNode != "" && secondaryAnlNode != "0.0.0.0"){ - anlNode.concat(', ' + secondaryAnlNode); - } - return ifNull(anlNode,noDataStr); - })()}, - {lbl:'Control Nodes', value:(function(){ - var peerList ; - try{ - peerList = computeNodeData.VrouterAgent.xmpp_peer_list; - }catch(e){} - var nodeArr=noDataStr ; - if(peerList != null && peerList.length>0){ - nodeArr = '
'; - var nodes = ''; - - for (var i=0; i< peerList.length;i++){ - var node = ''; - node = ''+ peerList[i].ip +'' ; - - if(peerList[i].primary != null && peerList[i].primary == true){ - if(peerList[i].status == true){ - if((i+1) == peerList.length){//only primary present - node = node + "* (Up) " ; - } else { - node = node + "* (Up), " ; - } - } else { - node = "" + node + "* (Down), " ; - } - if(nodes == ''){ - nodes = node; - } else { - nodes = node + nodes - } - } else { - if(peerList[i].status == true) - node = node + " (Up)" ; - else - node = "" + node + " (Down)" ; - if(node != ''){ - nodes = nodes + node - } else { - nodes = node; - } - } - } - nodeArr = nodeArr + nodes + '
' - } - return nodeArr; - })(),clk:'url'}, - - //Best way to get the primary node - jsonPath(computeNodeData,'$.VrouterAgent.xmpp_peer_list[?(@.primary==true)].ip')}, - {lbl:'Analytics Messages', value:(function(){ - var msgs = getAnalyticsMessagesCountAndSize(computeNodeData,['VRouterAgent']); - return msgs['count'] + ' [' + formatBytes(msgs['size']) + ']'; - })()}, - {lbl:'XMPP Messages', value:(function(){ - var xmppStatsList = getValueByJsonPath(computeNodeData,'VrouterStatsAgent;xmpp_stats_list',[]); - var inMsgs = outMsgs = 0; - for(var i = 0; i < xmppStatsList.length ; i++) { - inMsgs += getValueByJsonPath(xmppStatsList[i],'in_msgs',0); - outMsgs += getValueByJsonPath(xmppStatsList[i],'out_msgs',0); - } - return (inMsgs + ' In, ' + outMsgs + ' Out'); - })()}, - {lbl:'Flow Count', value:(function(){ - return (getValueByJsonPath(computeNodeData,"VrouterStatsAgent;active_flows", noDataStr) + ' Active, ' + - getValueByJsonPath(computeNodeData,"VrouterStatsAgent;total_flows", noDataStr) + ' Total'); - })()}, - {lbl:'Networks', value:parsedData['vnCnt']}, - {lbl:'Interfaces', value:(function(){ - var downInts = parsedData['errorIntfCnt']; - var totInts = parsedData['intfCnt']; - var ret; - if(downInts > 0){ - downInts = ", " + downInts + " Down"; - } else { - downInts = ""; - } - return totInts + " Total" + downInts; - })()}, - {lbl:'Instances', value:parsedData['instCnt']}, - {lbl:'CPU', value:$.isNumeric(parsedData['cpu']) ? parsedData['cpu'] + ' %' : noDataStr}, - {lbl:'Memory', value:parsedData['memory'] != '-' ? parsedData['memory'] : noDataStr}, - {lbl:'Version', value:parsedData['version'] != '-' ? parsedData['version'] : noDataStr}, - {lbl:'Last Log', value: (function(){ - var lmsg; - lmsg = getLastLogTimestamp(computeNodeData,"compute"); - if(lmsg != null){ - try{ - return new Date(parseInt(lmsg)/1000).toLocaleString(); - }catch(e){return noDataStr;} - } else return noDataStr; - })()} - ] + computeNodeDashboardInfo = getvRouterDetailsLblValuePairs(parsedData); var cores=getCores(computeNodeData); for(var i=0;i
' + syntaxHighlight(dc.raw_json) + '
'); + //DataItem consists of row data,passing it as a parameter to the parsefunction + e.detailRow.find('.row-fluid.basicDetails').html(detailTemplate(data)); + $(grid).data('contrailGrid').adjustDetailRowHeight(dataItem['id']); + } else { + e.detailRow.find('.row-fluid.basicDetails').html(detailTemplate(data)); + } + }, + onCollapse:function (e,dc) { + } + } }, dataSource: { dataView: vRoutersDataSource, diff --git a/webroot/monitor/tenant-network/common/ui/views/tenant_monitor_common.view b/webroot/monitor/tenant-network/common/ui/views/tenant_monitor_common.view index a39201981..0c926fa1c 100644 --- a/webroot/monitor/tenant-network/common/ui/views/tenant_monitor_common.view +++ b/webroot/monitor/tenant-network/common/ui/views/tenant_monitor_common.view @@ -7,45 +7,6 @@ - -