Procházet zdrojové kódy

AMBARI-3265. Add alert for iptables on host checks on the UI. (srimanth)

Srimanth Gunturi před 12 roky
rodič
revize
e059591f7e

+ 37 - 9
ambari-web/app/controllers/wizard/step3_controller.js

@@ -867,6 +867,25 @@ App.WizardStep3Controller = Em.Controller.extend({
         }
         host.warnings.push(warning);
       }
+      
+      var firewallRunning = _host.Hosts.last_agent_env.iptablesIsRunning;
+      if (firewallRunning!==null && firewallRunning) {
+        var name = Em.I18n.t('installer.step3.hostWarningsPopup.firewall.name');
+        warning = warnings.filterProperty('category', 'firewall').findProperty('name', name);
+        if (warning) {
+          warning.hosts.push(_host.Hosts.host_name);
+          warning.onSingleHost = false;
+        } else {
+          warning = {
+            name: name,
+            hosts: [_host.Hosts.host_name],
+            category: 'firewall',
+            onSingleHost: true
+          }
+          warnings.push(warning);
+        }
+        host.warnings.push(warning);
+      }
 
       hosts.push(host);
     }, this);
@@ -978,15 +997,24 @@ App.WizardStep3Controller = Em.Controller.extend({
         content: function () {
           var categoryWarnings = this.get('categoryWarnings');
           return [
-            Ember.Object.create({
-              warnings: categoryWarnings.filterProperty('category', 'processes'),
-              title: Em.I18n.t('installer.step3.hostWarningsPopup.process'),
-              message: Em.I18n.t('installer.step3.hostWarningsPopup.processes.message'),
-              type: Em.I18n.t('common.process'),
-              emptyName: Em.I18n.t('installer.step3.hostWarningsPopup.empty.processes'),
-              action: Em.I18n.t('installer.step3.hostWarningsPopup.action.running'),
-              category: 'process'
-            }),
+             Ember.Object.create({
+               warnings: categoryWarnings.filterProperty('category', 'firewall'),
+               title: Em.I18n.t('installer.step3.hostWarningsPopup.firewall'),
+               message: Em.I18n.t('installer.step3.hostWarningsPopup.firewall.message'),
+               type: Em.I18n.t('common.issues'),
+               emptyName: Em.I18n.t('installer.step3.hostWarningsPopup.empty.firewall'),
+               action: Em.I18n.t('installer.step3.hostWarningsPopup.action.running'),
+               category: 'firewall'
+             }),
+             Ember.Object.create({
+               warnings: categoryWarnings.filterProperty('category', 'processes'),
+               title: Em.I18n.t('installer.step3.hostWarningsPopup.process'),
+               message: Em.I18n.t('installer.step3.hostWarningsPopup.processes.message'),
+               type: Em.I18n.t('common.process'),
+               emptyName: Em.I18n.t('installer.step3.hostWarningsPopup.empty.processes'),
+               action: Em.I18n.t('installer.step3.hostWarningsPopup.action.running'),
+               category: 'process'
+             }),
              Ember.Object.create({
               warnings: categoryWarnings.filterProperty('category', 'packages'),
               title: Em.I18n.t('installer.step3.hostWarningsPopup.package'),

+ 5 - 0
ambari-web/app/messages.js

@@ -98,6 +98,7 @@ Em.I18n.translations = {
   'common.clients':'Clients',
   'common.user': 'User',
   'common.users': 'Users',
+  'common.issues': 'Issues',
   'common.os':'OS',
   'common.memory':'Memory',
   'common.maximum':'Maximum',
@@ -347,6 +348,9 @@ Em.I18n.translations = {
   'installer.step3.hostWarningsPopup.checks': 'Host Checks found',
   'installer.step3.hostWarningsPopup.notice':'After manually resolving the issues, click <b>Rerun Checks</b>.<br>To manually resolve issues on <b>each host</b> run the HostCleanup script (Python 2.6 or greater is required):<br><div class="code-snippet">python /usr/lib/python2.6/site-packages/ambari_agent/HostCleanup.py</div>',
   'installer.step3.hostWarningsPopup.summary':'{0} on {1}',
+  'installer.step3.hostWarningsPopup.firewall':'Firewall Issues',
+  'installer.step3.hostWarningsPopup.firewall.message':'Firewall is running on the following hosts. Please configure the firewall to allow communications on the ports documented in the <i>Configuring Ports</i> section of  the <a target=\"_blank\" href=\"http://incubator.apache.org/ambari/current/installing-hadoop-using-ambari/content/\">Ambari documentation</a>',
+  'installer.step3.hostWarningsPopup.firewall.name':'<i>iptables</i> Running',
   'installer.step3.hostWarningsPopup.process':'Process Issues',
   'installer.step3.hostWarningsPopup.processes.message':'The following processes should not be running',
   'installer.step3.hostWarningsPopup.fileAndFolder':'File and Folder Issues',
@@ -369,6 +373,7 @@ Em.I18n.translations = {
   'installer.step3.hostWarningsPopup.empty.users':'unwanted users',
   'installer.step3.hostWarningsPopup.empty.services':'unwanted services',
   'installer.step3.hostWarningsPopup.empty.misc':'issues',
+  'installer.step3.hostWarningsPopup.empty.firewall':'firewalls running',
   'installer.step3.hostWarningsPopup.action.exists':'Exists on',
   'installer.step3.hostWarningsPopup.action.notRunning':'Not running on',
   'installer.step3.hostWarningsPopup.action.installed':'Installed on',

+ 2 - 2
ambari-web/app/templates/wizard/step3_host_warnings_popup.hbs

@@ -56,7 +56,7 @@
           <table>
             <thead>
             <tr>
-              <th colspan="2">{{category.message}}</th>
+              <th colspan="2">{{{category.message}}}</th>
             </tr>
             <tr>
               <th colspan="2"><b>{{category.type}}</b></th>
@@ -65,7 +65,7 @@
             <tbody>
             {{#each warning in category.warnings}}
             <tr>
-              <td class="warning-name" {{bindAttr data-original-title="warning.command"}} >{{warning.name}}</td>
+              <td class="warning-name" {{bindAttr data-original-title="warning.command"}} >{{{warning.name}}}</td>
               {{#if warning.version}}
                   <td class="package-version">{{warning.version}}</td>
               {{/if}}