trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zw...@apache.org
Subject git commit: TS-2143 Remove alarm email address support (and config).
Date Tue, 20 Aug 2013 22:16:03 GMT
Updated Branches:
  refs/heads/3.4.x 151326711 -> fbdbd00cb


TS-2143 Remove alarm email address support (and config).

This removes proxy.config.admin.admin_user, which was used for
other things in the past, but now only for an email address
passed to the alarm script.

The alarm scripts now only get two arguments (and always 2):

    A description of the alarm
    A number identifying the alarm (e.g. "14")

In addition, this script cleans up some old code that was
customized for an old Inktomi customer. This is obviously
no longer something we need, or should support.

The "Upgrade to v4.0.0" Wiki will be updated with these details.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/fbdbd00c
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/fbdbd00c
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/fbdbd00c

Branch: refs/heads/3.4.x
Commit: fbdbd00cbfb60779c47d72ca92940b854f9ca259
Parents: 1513267
Author: Leif Hedstrom <zwoop@apache.org>
Authored: Tue Aug 20 16:11:10 2013 -0600
Committer: Leif Hedstrom <zwoop@apache.org>
Committed: Tue Aug 20 16:15:45 2013 -0600

----------------------------------------------------------------------
 CHANGES                                |   2 +
 ci/jenkins/records.config              |   1 -
 lib/perl/lib/Apache/TS/AdminClient.pm  |   1 -
 lib/records/I_RecAlarms.h              |   8 --
 lib/records/I_RecSignals.h             |   5 --
 mgmt/Alarms.cc                         | 114 +++++-----------------------
 mgmt/Alarms.h                          |  12 +--
 mgmt/BaseManager.h                     |   8 --
 mgmt/LocalManager.cc                   |  13 ----
 mgmt/RecordsConfig.cc                  |   2 -
 proxy/InkAPI.cc                        |  12 ---
 proxy/api/ts/experimental.h            |  15 ----
 proxy/config/records.config.default.in |   1 -
 proxy/example_alarm_bin.sh             |  50 ++----------
 14 files changed, 29 insertions(+), 215 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/fbdbd00c/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 3ad4edc..3700fc4 100644
--- a/CHANGES
+++ b/CHANGES
@@ -3,6 +3,8 @@
 Changes with Apache Traffic Server 3.4.0
 
 
+  *) [TS-2143] Remove alarm email address support (and config).
+
   *) [TS-2127] Move hostdb.config to var/trafficserver, together with with the
    host.db itself.
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/fbdbd00c/ci/jenkins/records.config
----------------------------------------------------------------------
diff --git a/ci/jenkins/records.config b/ci/jenkins/records.config
index 239e901..702618f 100644
--- a/ci/jenkins/records.config
+++ b/ci/jenkins/records.config
@@ -43,7 +43,6 @@ CONFIG proxy.config.accept_threads INT 1
 # Local Manager
 #
 ##############################################################################
-CONFIG proxy.config.admin.admin_user STRING admin
 CONFIG proxy.config.admin.number_config_bak INT 3
 CONFIG proxy.config.admin.user_id STRING nobody
 ##############################################################################

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/fbdbd00c/lib/perl/lib/Apache/TS/AdminClient.pm
----------------------------------------------------------------------
diff --git a/lib/perl/lib/Apache/TS/AdminClient.pm b/lib/perl/lib/Apache/TS/AdminClient.pm
index 2e171f4..11f7f0f 100644
--- a/lib/perl/lib/Apache/TS/AdminClient.pm
+++ b/lib/perl/lib/Apache/TS/AdminClient.pm
@@ -264,7 +264,6 @@ 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.autoconf.localhost_only
  proxy.config.admin.autoconf.pac_filename
  proxy.config.admin.autoconf_port

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/fbdbd00c/lib/records/I_RecAlarms.h
----------------------------------------------------------------------
diff --git a/lib/records/I_RecAlarms.h b/lib/records/I_RecAlarms.h
index 985c656..25bebb9 100644
--- a/lib/records/I_RecAlarms.h
+++ b/lib/records/I_RecAlarms.h
@@ -47,12 +47,4 @@
 #define REC_ALARM_PROXY_HTTP_CONGESTED_SERVER   20
 #define REC_ALARM_PROXY_HTTP_ALLEVIATED_SERVER  21
 
-#define REC_ALARM_WDA_BILLING_CONNECTION_DIED   100
-#define REC_ALARM_WDA_BILLING_CORRUPTED_DATA    101
-#define REC_ALARM_WDA_XF_ENGINE_DOWN            102
-#define REC_ALARM_WDA_RADIUS_CORRUPTED_PACKETS  103
-
-#define REC_ALARM_ACC_ALARMS_START              200
-#define REC_ALARM_ACC_ALARMS_END                299
-
 #endif

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/fbdbd00c/lib/records/I_RecSignals.h
----------------------------------------------------------------------
diff --git a/lib/records/I_RecSignals.h b/lib/records/I_RecSignals.h
index 0115e56..2e6f21b 100644
--- a/lib/records/I_RecSignals.h
+++ b/lib/records/I_RecSignals.h
@@ -45,11 +45,6 @@
 #define REC_SIGNAL_HTTP_CONGESTED_SERVER        20
 #define REC_SIGNAL_HTTP_ALLEVIATED_SERVER       21
 
-#define REC_SIGNAL_WDA_BILLING_CONNECTION_DIED  100
-#define REC_SIGNAL_WDA_BILLING_CORRUPTED_DATA   101
-#define REC_SIGNAL_WDA_XF_ENGINE_DOWN           102
-#define REC_SIGNAL_WDA_RADIUS_CORRUPTED_PACKETS 103
-
 #define REC_SIGNAL_ACC_ALARMS_START             200
 #define REC_SIGNAL_ACC_ALARMS_END               299
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/fbdbd00c/mgmt/Alarms.cc
----------------------------------------------------------------------
diff --git a/mgmt/Alarms.cc b/mgmt/Alarms.cc
index 94fbbf8..56f46d0 100644
--- a/mgmt/Alarms.cc
+++ b/mgmt/Alarms.cc
@@ -211,11 +211,6 @@ Alarms::signalAlarm(alarm_t a, const char *desc, const char *ip)
   case MGMT_ALARM_PROXY_HTTP_CONGESTED_SERVER:
   case MGMT_ALARM_PROXY_HTTP_ALLEVIATED_SERVER:
     return;
-  case MGMT_ALARM_WDA_BILLING_CONNECTION_DIED:
-  case MGMT_ALARM_WDA_BILLING_CORRUPTED_DATA:
-  case MGMT_ALARM_WDA_XF_ENGINE_DOWN:
-    priority = 2;
-    break;
   default:
     priority = 2;
     break;
@@ -225,19 +220,12 @@ Alarms::signalAlarm(alarm_t a, const char *desc, const char *ip)
   if (desc && (priority == 1 || priority == 2) && !ip) {
 
     if (strcmp(prev_alarm_text, desc) == 0) {   /* a repeated alarm */
-
-      /* INKqa11884: repeated wireless alarms always signalled */
-      if (a != MGMT_ALARM_WDA_BILLING_CONNECTION_DIED &&
-          a != MGMT_ALARM_WDA_BILLING_CORRUPTED_DATA &&
-          a != MGMT_ALARM_WDA_XF_ENGINE_DOWN) {
-
-        time_t time_delta = time(0) - last_sent;
-        if (time_delta < 900) {
-          mgmt_log("[Alarms::signalAlarm] Skipping Alarm: '%s'\n", desc);
-          return;
-        } else {
-          last_sent = time(0);
-        }
+      time_t time_delta = time(0) - last_sent;
+      if (time_delta < 900) {
+        mgmt_log("[Alarms::signalAlarm] Skipping Alarm: '%s'\n", desc);
+        return;
+      } else {
+        last_sent = time(0);
       }
     } else {
       ink_strlcpy(prev_alarm_text, desc, sizeof(prev_alarm_text));
@@ -256,11 +244,9 @@ Alarms::signalAlarm(alarm_t a, const char *desc, const char *ip)
    * don't want every node in the cluster reporting the same alarm.
    */
   if (priority == 1 && alarm_bin && alarm_bin_path && !ip) {
-    execAlarmBin(desc);
+    execAlarmBin(desc, a);
   }
 
-
-
   ink_mutex_acquire(&mutex);
   if (!ip) {
     // if an OEM alarm, then must create the unique key alarm type;
@@ -271,18 +257,8 @@ Alarms::signalAlarm(alarm_t a, const char *desc, const char *ip)
     }
     snprintf(buf, sizeof(buf), "%d", a);
     if (ink_hash_table_lookup(local_alarms, buf, &hash_value) != 0) {
-      // INKqa11884: if wireless alarm already active, just
-      // update desc with new timestamp and skip to actions part
-      if (a == MGMT_ALARM_WDA_BILLING_CONNECTION_DIED ||
-          a == MGMT_ALARM_WDA_BILLING_CORRUPTED_DATA ||
-          a == MGMT_ALARM_WDA_XF_ENGINE_DOWN) {
-        Debug("alarm", "[signalAlarm] wireless alarm already active");
-        atmp = (Alarm *) hash_value;
-        goto ALARM_REPEAT;
-      } else {
-        ink_mutex_release(&mutex);
-        return;
-      }
+      ink_mutex_release(&mutex);
+      return;
     }
   } else {
     snprintf(buf, sizeof(buf), "%d-%s", a, ip);
@@ -291,18 +267,8 @@ Alarms::signalAlarm(alarm_t a, const char *desc, const char *ip)
       //   still active
       atmp = (Alarm *) hash_value;
       atmp->seen = true;
-
-      // INKqa11884: if wireless alarm already active, just
-      // update desc with new timstamp and skip to actions part
-      if (a == MGMT_ALARM_WDA_BILLING_CONNECTION_DIED ||
-          a == MGMT_ALARM_WDA_BILLING_CORRUPTED_DATA ||
-          a == MGMT_ALARM_WDA_XF_ENGINE_DOWN) {
-        Debug("alarm", "[Alarms::signalAlarm] wireless alarm already active");
-        goto ALARM_REPEAT;
-      } else {
-        ink_mutex_release(&mutex);
-        return;
-      }
+      ink_mutex_release(&mutex);
+      return;
     }
   }
 
@@ -323,7 +289,6 @@ Alarms::signalAlarm(alarm_t a, const char *desc, const char *ip)
     ink_hash_table_insert(remote_alarms, (InkHashTableKey) (buf), (atmp));
   }
 
-ALARM_REPEAT:
   // Swap desc with time-stamped description.  Kinda hackish
   // Temporary until we get a new
   // alarm system in place.  TS 5.0.0, 02/08/2001
@@ -399,7 +364,7 @@ ALARM_REPEAT:
   }
   /* Priority 2 alarms get signalled if they are the first unsolved occurence. */
   if (priority == 2 && alarm_bin && alarm_bin_path && !ip) {
-    execAlarmBin(desc);
+    execAlarmBin(desc, a);
   }
 
   return;
@@ -539,29 +504,17 @@ Alarms::checkSystemNAlert()
 }                               /* End Alarms::checkSystenNAlert */
 
 void
-Alarms::execAlarmBin(const char *desc)
+Alarms::execAlarmBin(const char *desc, alarm_t a)
 {
   char cmd_line[1024];
-  char *alarm_email_from_name = 0;
-  char *alarm_email_from_addr = 0;
-  char *alarm_email_to_addr = 0;
+  char alarm[80];
   bool found;
 
-  // get email info
-  alarm_email_from_name = REC_readString("proxy.config.product_name", &found);
-  if (!found)
-    alarm_email_from_name = 0;
-  alarm_email_from_addr = REC_readString("proxy.config.admin.admin_user", &found);
-  if (!found)
-    alarm_email_from_addr = 0;
-  alarm_email_to_addr = REC_readString("proxy.config.alarm_email", &found);
-  if (!found)
-    alarm_email_to_addr = 0;
-
   int status;
   pid_t pid;
 
   ink_filepath_make(cmd_line, sizeof(cmd_line), alarm_bin_path, alarm_bin);
+  snprintf(alarm, sizeof(alarm), "%d", a);
 
 #ifdef POSIX_THREAD
   if ((pid = fork()) < 0)
@@ -596,21 +549,10 @@ 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, alarm_bin, desc, alarm_email_from_name, alarm_email_from_addr,
alarm_email_to_addr, (char*)NULL);
-    } else {
-      res = execl(cmd_line, alarm_bin, desc, (char*)NULL);
-    }
+    int res = execl(cmd_line, alarm_bin, desc, alarm, (char*)NULL);
+
     _exit(res);
   }
-
-
-
-  // free memory
-  ats_free(alarm_email_from_name);
-  ats_free(alarm_email_from_addr);
-  ats_free(alarm_email_to_addr);
 }
 
 //
@@ -621,22 +563,8 @@ Alarms::execAlarmBin(const char *desc)
 const char *
 Alarms::getAlarmText(alarm_t id)
 {
-  const char *wda_conn_died = "The connection to the billing system is broken. Unable to
retrieve user profile.";
-  const char *wda_corr_data =
-    "Could not read user profile or URL list from the billing system. The data received doesn't
have the expected format.";
-  const char *wda_xf_down = "The XF engine heartbeat could not be properly detected. It appears
dead.";
-
-  switch (id) {
-  case MGMT_ALARM_WDA_BILLING_CONNECTION_DIED:
-    return wda_conn_died;
-  case MGMT_ALARM_WDA_BILLING_CORRUPTED_DATA:
-    return wda_corr_data;
-  case MGMT_ALARM_WDA_XF_ENGINE_DOWN:
-    return wda_xf_down;
-  default:
-    if (id < alarmTextNum)
-      return alarmText[id];
-    else
-      return alarmText[0];      // "Unknown Alarm";
-  }
+  if (id < alarmTextNum)
+    return alarmText[id];
+  else
+    return alarmText[0];      // "Unknown Alarm";
 }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/fbdbd00c/mgmt/Alarms.h
----------------------------------------------------------------------
diff --git a/mgmt/Alarms.h b/mgmt/Alarms.h
index a58a350..a712d01 100644
--- a/mgmt/Alarms.h
+++ b/mgmt/Alarms.h
@@ -75,18 +75,8 @@
 #define MGMT_ALARM_PROXY_HTTP_ALLEVIATED_SERVER  21     /* Congestion control -- alleviated
server */
 #define MGMT_ALARM_PROXY_FTP_ERROR	         22
 
-// Wireless (WDA) alarms
-#define MGMT_ALARM_WDA_BILLING_CONNECTION_DIED   100
-#define MGMT_ALARM_WDA_BILLING_CORRUPTED_DATA    101
-#define MGMT_ALARM_WDA_XF_ENGINE_DOWN            102
-
 #define MGMT_ALARM_SAC_SERVER_DOWN		400
 
-// ACC alarms -- 200-300 -- I tried using just one, but a bunch of 'ACL was dropped'
-// warnings didn't get to the manager UI, that's badness.
-#define MGMT_ALARM_ACC_ALARMS_START              200
-#define MGMT_ALARM_ACC_ALARMS_END                299
-
 extern const char *alarmText[];
 extern const int alarmTextNum;
 
@@ -129,7 +119,7 @@ public:
   void clearUnSeen(char *ip);
 
   void checkSystemNAlert();
-  void execAlarmBin(const char *desc);
+  void execAlarmBin(const char *desc, alarm_t a);
 
   const char *getAlarmText(alarm_t id);
   InkHashTable *getLocalAlarms()

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/fbdbd00c/mgmt/BaseManager.h
----------------------------------------------------------------------
diff --git a/mgmt/BaseManager.h b/mgmt/BaseManager.h
index a8d268c..80268a4 100644
--- a/mgmt/BaseManager.h
+++ b/mgmt/BaseManager.h
@@ -93,14 +93,6 @@
 #define MGMT_SIGNAL_HTTP_CONGESTED_SERVER   20  /* Congestion control -- congested server
*/
 #define MGMT_SIGNAL_HTTP_ALLEVIATED_SERVER  21  /* Congestion control -- alleviated server
*/
 
-// Wireless (WDA) plugin signal
-// Warning: 1. Don't change the # mapping 'cuase 3rd party software depends on them.
-//          2. Ensure 1:1 maps with alarms in Alarm.h
-#define INK_MGMT_SIGNAL_WDA_BILLING_CONNECTION_DIED  100
-#define INK_MGMT_SIGNAL_WDA_BILLING_CORRUPTED_DATA   101
-#define INK_MGMT_SIGNAL_WDA_XF_ENGINE_DOWN           102
-#define INK_MGMT_SIGNAL_WDA_RADIUS_CORRUPTED_PACKETS 103
-
 #define INK_MGMT_SIGNAL_ACC_ALARMS_START  200
 #define INK_MGMT_SIGNAL_ACC_ALARMS_END    299
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/fbdbd00c/mgmt/LocalManager.cc
----------------------------------------------------------------------
diff --git a/mgmt/LocalManager.cc b/mgmt/LocalManager.cc
index 863a771..79b1ef4 100644
--- a/mgmt/LocalManager.cc
+++ b/mgmt/LocalManager.cc
@@ -697,16 +697,6 @@ LocalManager::handleMgmtMsgFromProcesses(MgmtMessageHdr * mh)
     alarm_keeper->signalAlarm(MGMT_ALARM_PROXY_HTTP_ALLEVIATED_SERVER, data_raw);
     break;
     // Congestion Control - end
-  case INK_MGMT_SIGNAL_WDA_BILLING_CONNECTION_DIED:
-    alarm_keeper->signalAlarm(MGMT_ALARM_WDA_BILLING_CONNECTION_DIED, data_raw);
-    break;
-  case INK_MGMT_SIGNAL_WDA_BILLING_CORRUPTED_DATA:
-    alarm_keeper->signalAlarm(MGMT_ALARM_WDA_BILLING_CORRUPTED_DATA, data_raw);
-    break;
-  case INK_MGMT_SIGNAL_WDA_XF_ENGINE_DOWN:
-    alarm_keeper->signalAlarm(MGMT_ALARM_WDA_XF_ENGINE_DOWN, data_raw);
-    break;
-    // Wireless plugin signal - end
   case INK_MGMT_SIGNAL_SAC_SERVER_DOWN:
     alarm_keeper->signalAlarm(MGMT_ALARM_SAC_SERVER_DOWN, data_raw);
     break;
@@ -715,9 +705,6 @@ LocalManager::handleMgmtMsgFromProcesses(MgmtMessageHdr * mh)
     break;
   }
 
-  // #define MGMT_ALARM_ACC_ALARMS_START              200
-  // #define MGMT_ALARM_ACC_ALARMS_END                299
-
   if (mh->msg_id >= INK_MGMT_SIGNAL_ACC_ALARMS_START && mh->msg_id <=
INK_MGMT_SIGNAL_ACC_ALARMS_END) {
     alarm_keeper->signalAlarm(mh->msg_id, data_raw);
   }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/fbdbd00c/mgmt/RecordsConfig.cc
----------------------------------------------------------------------
diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc
index bf4b9ee..39b03e0 100644
--- a/mgmt/RecordsConfig.cc
+++ b/mgmt/RecordsConfig.cc
@@ -239,8 +239,6 @@ RecordElement RecordsConfig[] = {
   ,
   {RECT_CONFIG, "proxy.config.admin.autoconf.pac_filename", RECD_STRING, "proxy.pac", RECU_DYNAMIC,
RR_NULL, RECC_NULL, NULL, 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, NULL, RECA_NULL}
   ,
   {RECT_CONFIG, "proxy.config.admin.user_id", RECD_STRING, TS_PKGSYSUSER, RECU_NULL, RR_REQUIRED,
RECC_NULL, NULL, RECA_NULL}

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/fbdbd00c/proxy/InkAPI.cc
----------------------------------------------------------------------
diff --git a/proxy/InkAPI.cc b/proxy/InkAPI.cc
index 6ae68ea..289bbb2 100644
--- a/proxy/InkAPI.cc
+++ b/proxy/InkAPI.cc
@@ -6975,18 +6975,6 @@ TSMgmtConfigIntSet(const char *var_name, TSMgmtInt value)
   return TS_SUCCESS;
 }
 
-
-/* Alarm */
-/* return type is "int" currently, it should be TSReturnCode */
-void
-TSSignalWarning(TSAlarmType code, char *msg)
-{
-  sdk_assert(code >= TS_SIGNAL_WDA_BILLING_CONNECTION_DIED && code <= TS_SIGNAL_WDA_RADIUS_CORRUPTED_PACKETS);
-  sdk_assert(sdk_sanity_check_null_ptr((void*)msg) == TS_SUCCESS);
-
-  REC_SignalWarning(code, msg);
-}
-
 void
 TSICPFreshnessFuncSet(TSPluginFreshnessCalcFunc funcp)
 {

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/fbdbd00c/proxy/api/ts/experimental.h
----------------------------------------------------------------------
diff --git a/proxy/api/ts/experimental.h b/proxy/api/ts/experimental.h
index 282bd06..1eb2da8 100644
--- a/proxy/api/ts/experimental.h
+++ b/proxy/api/ts/experimental.h
@@ -314,21 +314,6 @@ extern "C"
 #define TS_NET_EVENT_DATAGRAM_OPEN	      TS_EVENT_INTERNAL_211
 #define TS_NET_EVENT_DATAGRAM_ERROR          TS_EVENT_INTERNAL_212
 
-  typedef enum
-    {
-      TS_SIGNAL_WDA_BILLING_CONNECTION_DIED = 100,
-      TS_SIGNAL_WDA_BILLING_CORRUPTED_DATA = 101,
-      TS_SIGNAL_WDA_XF_ENGINE_DOWN = 102,
-      TS_SIGNAL_WDA_RADIUS_CORRUPTED_PACKETS = 103
-    } TSAlarmType;
-
-  /* ===== Alarm ===== */
-  /****************************************************************************
-   *  ??
-   *  contact: OXYGEN
-   ****************************************************************************/
-  tsapi void TSSignalWarning(TSAlarmType code, char *msg);
-
   /*****************************************************************************
    * 			Cluster RPC API support 			     *
    *****************************************************************************/

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/fbdbd00c/proxy/config/records.config.default.in
----------------------------------------------------------------------
diff --git a/proxy/config/records.config.default.in b/proxy/config/records.config.default.in
index d2649c0..9a8b338 100644
--- a/proxy/config/records.config.default.in
+++ b/proxy/config/records.config.default.in
@@ -43,7 +43,6 @@ CONFIG proxy.config.accept_threads INT 1
 # Local Manager
 #
 ##############################################################################
-CONFIG proxy.config.admin.admin_user STRING admin
 CONFIG proxy.config.admin.number_config_bak INT 3
 CONFIG proxy.config.admin.user_id STRING @pkgsysuser@
 ##############################################################################

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/fbdbd00c/proxy/example_alarm_bin.sh
----------------------------------------------------------------------
diff --git a/proxy/example_alarm_bin.sh b/proxy/example_alarm_bin.sh
index c288f07..b970779 100644
--- a/proxy/example_alarm_bin.sh
+++ b/proxy/example_alarm_bin.sh
@@ -18,54 +18,14 @@
 
 #
 #   Example alarm bin program. Proxy manager execs this script with
-# a brief message as its argument. This program sends mail to the
-# e-mail address passed in by the caller.  The subject of the
-# e-mail is the passed in message, and a 'date' stamp is added 
-# as the body.
+#   a brief message as its argument, and an alarm code.
 #
-ostype=`(uname -s) 2>/dev/null`
-if [ "$ostype" = "Linux" ]; then
-SENDMAIL="/usr/sbin/sendmail"
-else
-  SENDMAIL="/usr/lib/sendmail"
-fi
-
-if [ ! -x $SENDMAIL ]; then
-    echo "$0: Could not find $SENDMAIL program"
-    exit 1
-fi
-
-if [ $# -eq 1 ]; then
-  # if only one parameter, then no email information was provided
-  msg="`hostname` $1"
-  echo
-  echo "[example_alarm_bin.sh] no e-mail sent: $msg"
-  echo
-  exit 0
-
-elif [ $# -eq 4 ]; then
-  # if four parameters, the caller specified email information
-  msg="`hostname` $1"
-  email_from_name=$2
-  email_from_addr=$3
-  email_to_addr=$4
-
-  result=`(echo "From: $email_from_name <$email_from_addr>"; echo "To: $email_to_addr";
echo "Subject: $msg"; echo; date) | $SENDMAIL -bm $email_to_addr`
-  if [ "$result" = "" ]; then
-    echo
-    echo "[example_alarm_bin.sh] sent alarm: $msg";
-    echo
-    exit 0
-  else
-    echo
-    echo "[example_alarm_bin.sh] sendmail failed"
-    echo
-    exit 1
-  fi
-
+if [ $# -eq 2 ]; then
+  # two parameters, from ATS
+    echo "$0: desc=$1 alarm=$2"
 else
   # give a little help
-  echo "Usage: example_alarm_bin.sh <message> [<email_from_name> <email_from_addr>
<email_to_addr>]"
+  echo "Usage: example_alarm_bin.sh <message> <alarm type ID>"
   exit
 
 fi


Mime
View raw message