You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2019/05/16 02:03:03 UTC

[trafficserver] 02/03: Removes the email feature of the Alarms subsystem

This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit fb3e59cf881c7b71eb0e9c759fa156add1a343fb
Author: Leif Hedstrom <zw...@apache.org>
AuthorDate: Fri May 10 13:40:48 2019 -0600

    Removes the email feature of the Alarms subsystem
    
    In addition, the following two configurations are gone:
    
       proxy.config.admin.admin_user
       proxy.config.alarm_email
    
    This closes #5459
---
 contrib/python/compare_RecordsConfigcc.py                |  1 -
 doc/admin-guide/files/records.config.en.rst              | 16 ----------------
 doc/admin-guide/monitoring/alarms.en.rst                 | 13 -------------
 .../LC_MESSAGES/admin-guide/files/records.config.en.po   |  4 ----
 .../ja/LC_MESSAGES/admin-guide/monitoring/alarms.en.po   |  8 --------
 lib/perl/lib/Apache/TS/AdminClient.pm                    |  2 --
 mgmt/Alarms.cc                                           | 14 ++------------
 mgmt/RecordsConfig.cc                                    |  4 ----
 8 files changed, 2 insertions(+), 60 deletions(-)

diff --git a/contrib/python/compare_RecordsConfigcc.py b/contrib/python/compare_RecordsConfigcc.py
index b01a133..90835c9 100644
--- a/contrib/python/compare_RecordsConfigcc.py
+++ b/contrib/python/compare_RecordsConfigcc.py
@@ -32,7 +32,6 @@ ignore_keys = {
     "proxy.config.ssl.server.cert.path": 1,
     "proxy.config.admin.user_id": 1,
     "proxy.config.ssl.client.cert.path": 1,
-    "proxy.config.alarm_email": 1,
     "proxy.config.log.logfile_dir": 1,
     "proxy.config.ssl.CA.cert.path": 1,
     "proxy.config.ssl.client.CA.cert.path": 1,
diff --git a/doc/admin-guide/files/records.config.en.rst b/doc/admin-guide/files/records.config.en.rst
index 4065b56..8f877ba 100644
--- a/doc/admin-guide/files/records.config.en.rst
+++ b/doc/admin-guide/files/records.config.en.rst
@@ -551,22 +551,6 @@ Local Manager
 Alarm Configuration
 ===================
 
-.. ts:cv:: CONFIG proxy.config.alarm_email STRING
-   :reloadable:
-
-   The address to which the alarm script should send email.
-
-.. ts:cv:: CONFIG proxy.config.alarm.bin STRING example_alarm_bin.sh
-   :reloadable:
-
-   Name of the script file that can execute certain actions when
-   an alarm is signaled. The script is invoked with up to 4 arguments:
-
-   - The alarm message.
-   - The value of :ts:cv:`proxy.config.product_name`.
-   - The value of :ts:cv:`proxy.config.admin.user_id`.
-   - The value of :ts:cv:`proxy.config.alarm_email`.
-
 .. ts:cv:: CONFIG proxy.config.alarm.abs_path STRING NULL
    :reloadable:
 
diff --git a/doc/admin-guide/monitoring/alarms.en.rst b/doc/admin-guide/monitoring/alarms.en.rst
index f3c085d..08c1422 100644
--- a/doc/admin-guide/monitoring/alarms.en.rst
+++ b/doc/admin-guide/monitoring/alarms.en.rst
@@ -26,19 +26,6 @@ Traffic Manager Alarms
 allocated to event logs could be full or |TS| may not be able to write to a
 configuration file.
 
-Email Alarms
-============
-
-To configure |TS| to send an email to a specific address whenever an alarm
-occurs, follow the steps below:
-
-#. Set :ts:cv:`proxy.config.alarm_email` in :file:`records.config` to the email
-   address you want to receive alarm notifications. ::
-
-        CONFIG proxy.config.alarm_email STRING alerts@example.com
-
-#. Run the command :option:`traffic_ctl config reload` to apply the configuration changes.
-
 Using a Script File for Alarms
 ------------------------------
 
diff --git a/doc/locale/ja/LC_MESSAGES/admin-guide/files/records.config.en.po b/doc/locale/ja/LC_MESSAGES/admin-guide/files/records.config.en.po
index 806eed4..05e603e 100644
--- a/doc/locale/ja/LC_MESSAGES/admin-guide/files/records.config.en.po
+++ b/doc/locale/ja/LC_MESSAGES/admin-guide/files/records.config.en.po
@@ -1096,10 +1096,6 @@ msgstr ""
 msgid "The value of :ts:cv:`proxy.config.admin.user_id`."
 msgstr ""
 
-#: ../../../admin-guide/files/records.config.en.rst:627
-msgid "The value of :ts:cv:`proxy.config.alarm_email`."
-msgstr ""
-
 #: ../../../admin-guide/files/records.config.en.rst:632
 msgid ""
 "The absolute path to the directory containing the alarm script. If this is "
diff --git a/doc/locale/ja/LC_MESSAGES/admin-guide/monitoring/alarms.en.po b/doc/locale/ja/LC_MESSAGES/admin-guide/monitoring/alarms.en.po
index 81841d7..a879e29 100644
--- a/doc/locale/ja/LC_MESSAGES/admin-guide/monitoring/alarms.en.po
+++ b/doc/locale/ja/LC_MESSAGES/admin-guide/monitoring/alarms.en.po
@@ -53,14 +53,6 @@ msgstr ""
 "アラームが発生したときに |TS| が指定したアドレスに E メールを送信するように"
 "設定するには、以下の手順に従ってください。"
 
-#: ../../../admin-guide/monitoring/alarms.en.rst:35
-msgid ""
-"Set :ts:cv:`proxy.config.alarm_email` in :file:`records.config` to the "
-"email address you want to receive alarm notifications. ::"
-msgstr ""
-":file:`records.config` の :ts:cv:`proxy.config.alarm_email` にアラーム通知を"
-"受け取りたいメールアドレスを設定 ::"
-
 #: ../../../admin-guide/monitoring/alarms.en.rst:40
 msgid ""
 "Run the command :option:`traffic_ctl config reload` to apply the "
diff --git a/lib/perl/lib/Apache/TS/AdminClient.pm b/lib/perl/lib/Apache/TS/AdminClient.pm
index 9892a90..e53e357 100644
--- a/lib/perl/lib/Apache/TS/AdminClient.pm
+++ b/lib/perl/lib/Apache/TS/AdminClient.pm
@@ -317,14 +317,12 @@ The Apache Traffic Server Administration Manual will explain what these strings
 
  proxy.config.accept_threads
  proxy.config.task_threads
- proxy.config.admin.admin_user
  proxy.config.admin.synthetic_port
  proxy.config.admin.cli_path
  proxy.config.admin.number_config_bak
  proxy.config.admin.user_id
  proxy.config.alarm.abs_path
  proxy.config.alarm.bin
- proxy.config.alarm_email
  proxy.config.alarm.script_runtime
  proxy.config.bandwidth_mgmt.filename
  proxy.config.bin_path
diff --git a/mgmt/Alarms.cc b/mgmt/Alarms.cc
index a252274..839d1fd 100644
--- a/mgmt/Alarms.cc
+++ b/mgmt/Alarms.cc
@@ -350,11 +350,6 @@ Alarms::execAlarmBin(const char *desc)
     return;
   }
 
-  // get email info
-  alarm_email_from_name = REC_readString("proxy.config.product_name", nullptr);
-  alarm_email_from_addr = REC_readString("proxy.config.admin.admin_user", nullptr);
-  alarm_email_to_addr   = REC_readString("proxy.config.alarm_email", nullptr);
-
   ink_filepath_make(cmd_line, sizeof(cmd_line), bindir, alarm_bin);
 
 #ifdef POSIX_THREAD
@@ -391,13 +386,8 @@ Alarms::execAlarmBin(const char *desc)
       waitpid(pid, &status, 0); // to reap the thread
     }
   } else {
-    int res;
-    if (alarm_email_from_name && alarm_email_from_addr && alarm_email_to_addr) {
-      res = execl(cmd_line, (const char *)alarm_bin, desc, (const char *)alarm_email_from_name, (const char *)alarm_email_from_addr,
-                  (const char *)alarm_email_to_addr, (char *)nullptr);
-    } else {
-      res = execl(cmd_line, (const char *)alarm_bin, desc, (char *)nullptr);
-    }
+    int res = execl(cmd_line, (const char *)alarm_bin, desc, (char *)nullptr);
+
     _exit(res);
   }
 }
diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc
index 4dbb24c..fdc79c1 100644
--- a/mgmt/RecordsConfig.cc
+++ b/mgmt/RecordsConfig.cc
@@ -63,8 +63,6 @@ static const RecordElement RecordsConfig[] =
   // Jira TS-21
   {RECT_CONFIG, "proxy.config.local_state_dir", RECD_STRING, TS_BUILD_RUNTIMEDIR, RECU_RESTART_TS, RR_NULL, RECC_NULL, nullptr, RECA_READ_ONLY}
   ,
-  {RECT_CONFIG, "proxy.config.alarm_email", RECD_STRING, TS_PKGSYSUSER, RECU_DYNAMIC, RR_NULL, RECC_STR, ".*", RECA_NULL}
-  ,
   {RECT_CONFIG, "proxy.config.syslog_facility", RECD_STRING, "LOG_DAEMON", RECU_RESTART_TM, RR_NULL, RECC_STR, ".*", RECA_NULL}
   ,
   //# Negative core limit means max out limit
@@ -246,8 +244,6 @@ static const RecordElement RecordsConfig[] =
   ,
   {RECT_CONFIG, "proxy.config.admin.autoconf.localhost_only", RECD_INT, "1", RECU_RESTART_TM, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
   ,
-  {RECT_CONFIG, "proxy.config.admin.admin_user", RECD_STRING, "admin", RECU_DYNAMIC, RR_REQUIRED, RECC_STR, ".+", RECA_NO_ACCESS}
-  ,
   {RECT_CONFIG, "proxy.config.admin.number_config_bak", RECD_INT, "3", RECU_NULL, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
   ,
   {RECT_CONFIG, "proxy.config.admin.user_id", RECD_STRING, TS_PKGSYSUSER, RECU_NULL, RR_REQUIRED, RECC_NULL, nullptr, RECA_READ_ONLY}