Skip to content

Commit

Permalink
AMBARI-1033. Nagios and Ganglia links should use public host names in…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
Yusaku Sako committed Dec 9, 2012
1 parent d9376e8 commit 762191f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
3 changes: 3 additions & 0 deletions AMBARI-666-CHANGES.txt
Expand Up @@ -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)

Expand Down
14 changes: 11 additions & 3 deletions ambari-web/app/controllers/global/cluster_controller.js
Expand Up @@ -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 {
Expand All @@ -96,14 +96,18 @@ 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";
}
}
}
}
return null;
}
}.property('App.router.updateController.isUpdated'),
}.property('App.router.updateController.isUpdated', 'dataLoadList.hosts'),

/**
* Provides the URL to use for NAGIOS server. This URL
Expand All @@ -126,14 +130,18 @@ 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";
}
}
}
}
return null;
}
}.property('App.router.updateController.isUpdated'),
}.property('App.router.updateController.isUpdated', 'dataLoadList.hosts'),

isNagiosInstalled:function () {
if (App.testMode) {
Expand Down
1 change: 1 addition & 0 deletions ambari-web/app/mappers/hosts_mapper.js
Expand Up @@ -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',
Expand Down
1 change: 1 addition & 0 deletions ambari-web/app/models/host.js
Expand Up @@ -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'),
Expand Down

0 comments on commit 762191f

Please sign in to comment.