Przeglądaj źródła

AMBARI-1033. Nagios and Ganglia links should use public host names in URLs. (Srimanth Gunturi via yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/branches/AMBARI-666@1418973 13f79535-47bb-0310-9956-ffa450edef68
Yusaku Sako 12 lat temu
rodzic
commit
762191fe31

+ 3 - 0
AMBARI-666-CHANGES.txt

@@ -424,6 +424,9 @@ AMBARI-666 branch (unreleased changes)
 
   IMPROVEMENTS
 
+  AMBARI-1033. Nagios and Ganglia links should use public host names in URLs.
+  (Srimanth Gunturi via yusaku)
+
   AMBARI-1030. Metrics links in web ui should link to Ganglia UI. (Srimanth
   Gunturi via yusaku)
 

+ 11 - 3
ambari-web/app/controllers/global/cluster_controller.js

@@ -82,7 +82,7 @@ App.ClusterController = Em.Controller.extend({
    *
    * If null is returned, it means GANGLIA service is not installed.
    */
-  gangliaUrl:function () {
+  gangliaUrl: function () {
     if (App.testMode) {
       return 'http://gangliaserver/ganglia/?t=yes';
     } else {
@@ -96,6 +96,10 @@ App.ClusterController = Em.Controller.extend({
           if (gangliaSvcComponent) {
             var hostName = gangliaSvcComponent.get('host.hostName');
             if (hostName) {
+              var host = App.Host.find(hostName);
+              if (host) {
+                hostName = host.get('publicHostName');
+              }
               return "http://" + hostName + "/ganglia";
             }
           }
@@ -103,7 +107,7 @@ App.ClusterController = Em.Controller.extend({
       }
       return null;
     }
-  }.property('App.router.updateController.isUpdated'),
+  }.property('App.router.updateController.isUpdated', 'dataLoadList.hosts'),
 
   /**
    * Provides the URL to use for NAGIOS server. This URL
@@ -126,6 +130,10 @@ App.ClusterController = Em.Controller.extend({
           if (nagiosSvcComponent) {
             var hostName = nagiosSvcComponent.get('host.hostName');
             if (hostName) {
+              var host = App.Host.find(hostName);
+              if (host) {
+                hostName = host.get('publicHostName');
+              }
               return "http://" + hostName + "/nagios";
             }
           }
@@ -133,7 +141,7 @@ App.ClusterController = Em.Controller.extend({
       }
       return null;
     }
-  }.property('App.router.updateController.isUpdated'),
+  }.property('App.router.updateController.isUpdated', 'dataLoadList.hosts'),
 
   isNagiosInstalled:function () {
     if (App.testMode) {

+ 1 - 0
ambari-web/app/mappers/hosts_mapper.js

@@ -20,6 +20,7 @@ App.hostsMapper = App.QuickDataMapper.create({
   config: {
     id: 'Hosts.host_name',
     host_name: 'Hosts.host_name',
+    public_host_name: 'Hosts.public_host_name',
     cluster_id: 'Hosts.cluster_name',// 1
     components_key: 'host_components',
     components_type: 'array',

+ 1 - 0
ambari-web/app/models/host.js

@@ -22,6 +22,7 @@ var misc = require('utils/misc');
 
 App.Host = DS.Model.extend({
   hostName: DS.attr('string'),
+  publicHostName: DS.attr('string'),
   cluster: DS.belongsTo('App.Cluster'),
   components: DS.hasMany('App.Component'),
   hostComponents: DS.hasMany('App.HostComponent'),