Skip to content

Commit

Permalink
Removes the email feature of the Alarms subsystem
Browse files Browse the repository at this point in the history
In addition, the following two configurations are gone:

   proxy.config.admin.admin_user
   proxy.config.alarm_email

This closes apache#5459
  • Loading branch information
zwoop committed May 16, 2019
1 parent 5c672b1 commit fb3e59c
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 60 deletions.
1 change: 0 additions & 1 deletion contrib/python/compare_RecordsConfigcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
"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,
Expand Down
16 changes: 0 additions & 16 deletions doc/admin-guide/files/records.config.en.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
13 changes: 0 additions & 13 deletions doc/admin-guide/monitoring/alarms.en.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected]

#. Run the command :option:`traffic_ctl config reload` to apply the configuration changes.

Using a Script File for Alarms
------------------------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 "
Expand Down
8 changes: 0 additions & 8 deletions doc/locale/ja/LC_MESSAGES/admin-guide/monitoring/alarms.en.po
Original file line number Diff line number Diff line change
Expand Up @@ -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 "
Expand Down
2 changes: 0 additions & 2 deletions lib/perl/lib/Apache/TS/AdminClient.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 2 additions & 12 deletions mgmt/Alarms.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
}
}
Expand Down
4 changes: 0 additions & 4 deletions mgmt/RecordsConfig.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand Down

0 comments on commit fb3e59c

Please sign in to comment.