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 2010/09/17 19:49:22 UTC

svn commit: r998224 - in /trafficserver/traffic/trunk: contrib/perl/AdminClient/lib/Apache/TS/ doc/man/ proxy/config/ proxy/congest/ proxy/mgmt2/ proxy/mgmt2/cli/ proxy/mgmt2/cli2/ proxy/mgmt2/tools/ proxy/mgmt2/utils/ proxy/mgmt2/web2/ test/plugin/tes...

Author: zwoop
Date: Fri Sep 17 17:49:21 2010
New Revision: 998224

URL: http://svn.apache.org/viewvc?rev=998224&view=rev
Log:
TS-401 Remove vestige of SNMP.

Removed:
    trafficserver/traffic/trunk/doc/man/config_snmp.1
    trafficserver/traffic/trunk/doc/man/show_snmp.1
    trafficserver/traffic/trunk/proxy/config/mgr.v14.cnf
    trafficserver/traffic/trunk/proxy/config/mgr.v15.cnf
    trafficserver/traffic/trunk/proxy/config/snmpd.cnf
Modified:
    trafficserver/traffic/trunk/contrib/perl/AdminClient/lib/Apache/TS/AdminClient.pm
    trafficserver/traffic/trunk/proxy/config/Makefile.am
    trafficserver/traffic/trunk/proxy/config/congestion.config
    trafficserver/traffic/trunk/proxy/congest/Congestion.cc
    trafficserver/traffic/trunk/proxy/congest/Congestion.h
    trafficserver/traffic/trunk/proxy/congest/CongestionTest.cc
    trafficserver/traffic/trunk/proxy/congest/FeatureSpec.txt
    trafficserver/traffic/trunk/proxy/mgmt2/AddConfigFilesHere.cc
    trafficserver/traffic/trunk/proxy/mgmt2/Alarms.cc
    trafficserver/traffic/trunk/proxy/mgmt2/LocalManager.cc
    trafficserver/traffic/trunk/proxy/mgmt2/LocalManager.h
    trafficserver/traffic/trunk/proxy/mgmt2/Main.cc
    trafficserver/traffic/trunk/proxy/mgmt2/Main.h
    trafficserver/traffic/trunk/proxy/mgmt2/RecordsConfig.cc
    trafficserver/traffic/trunk/proxy/mgmt2/StatAggregation.cc
    trafficserver/traffic/trunk/proxy/mgmt2/cli/CLIeventHandler.cc
    trafficserver/traffic/trunk/proxy/mgmt2/cli/CLIhelp.cc
    trafficserver/traffic/trunk/proxy/mgmt2/cli2/CliCreateCommands.cc
    trafficserver/traffic/trunk/proxy/mgmt2/cli2/ConfigCmd.cc
    trafficserver/traffic/trunk/proxy/mgmt2/cli2/ConfigCmd.h
    trafficserver/traffic/trunk/proxy/mgmt2/cli2/ShowCmd.cc
    trafficserver/traffic/trunk/proxy/mgmt2/cli2/ShowCmd.h
    trafficserver/traffic/trunk/proxy/mgmt2/cli2/cli_detailed_command_list.txt
    trafficserver/traffic/trunk/proxy/mgmt2/cli2/cli_feature_spec.txt
    trafficserver/traffic/trunk/proxy/mgmt2/cli2/script_configs.sh
    trafficserver/traffic/trunk/proxy/mgmt2/cli2/script_configs.tcl
    trafficserver/traffic/trunk/proxy/mgmt2/tools/ConfigAPI.cc
    trafficserver/traffic/trunk/proxy/mgmt2/tools/ConfigAPI.h
    trafficserver/traffic/trunk/proxy/mgmt2/tools/SysAPI.cc
    trafficserver/traffic/trunk/proxy/mgmt2/tools/SysAPI.h
    trafficserver/traffic/trunk/proxy/mgmt2/utils/WebMgmtUtils.h
    trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttpRender.cc
    trafficserver/traffic/trunk/proxy/mgmt2/web2/WebOverview.cc
    trafficserver/traffic/trunk/test/plugin/test-mgmt/test-mgmt.c

Modified: trafficserver/traffic/trunk/contrib/perl/AdminClient/lib/Apache/TS/AdminClient.pm
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/contrib/perl/AdminClient/lib/Apache/TS/AdminClient.pm?rev=998224&r1=998223&r2=998224&view=diff
==============================================================================
--- trafficserver/traffic/trunk/contrib/perl/AdminClient/lib/Apache/TS/AdminClient.pm (original)
+++ trafficserver/traffic/trunk/contrib/perl/AdminClient/lib/Apache/TS/AdminClient.pm Fri Sep 17 17:49:21 2010
@@ -409,7 +409,6 @@ The Apache Traffic Server Administration
  proxy.config.http.congestion_control.default.max_connection
  proxy.config.http.congestion_control.default.max_connection_failures
  proxy.config.http.congestion_control.default.proxy_retry_interval
- proxy.config.http.congestion_control.default.snmp
  proxy.config.http.congestion_control.default.wait_interval_alpha
  proxy.config.http.congestion_control.enabled
  proxy.config.http.congestion_control.filename
@@ -643,9 +642,6 @@ The Apache Traffic Server Administration
  proxy.config.reverse_proxy.oldasxbehavior
  proxy.config.server_name
  proxy.config.snapshot_dir
- proxy.config.snmp.master_agent_enabled
- proxy.config.snmp.snmp_encap_enabled
- proxy.config.snmp.trap_message
  proxy.config.socks.accept_enabled
  proxy.config.socks.accept_port
  proxy.config.socks.connection_attempts

Modified: trafficserver/traffic/trunk/proxy/config/Makefile.am
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/config/Makefile.am?rev=998224&r1=998223&r2=998224&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/config/Makefile.am (original)
+++ trafficserver/traffic/trunk/proxy/config/Makefile.am Fri Sep 17 17:49:21 2010
@@ -46,7 +46,6 @@ dist_sysconf_DATA =	\
   plugin.config \
   plugin.db \
   remap.config \
-  snmpd.cnf \
   socks.config \
   splitdns.config \
   ssl_multicert.config \

Modified: trafficserver/traffic/trunk/proxy/config/congestion.config
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/config/congestion.config?rev=998224&r1=998223&r2=998224&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/config/congestion.config (original)
+++ trafficserver/traffic/trunk/proxy/config/congestion.config Fri Sep 17 17:49:21 2010
@@ -35,7 +35,6 @@
 #        max_connection=<integer>                // -1 means unlimited
 #        error_page=<page uri>
 #        congestion_scheme=per_ip|per_host
-#        snmp=on|off
 #
 #
 # The suggested default values are as follows:
@@ -51,7 +50,6 @@
 #        max_connection=-1
 #        error_page="congestion#retryAfter"
 #        congestion_scheme="per_ip"
-#        snmp=on
 #
 # You can change the records.config config variables to change the above defaults:
 # CONFIG proxy.config.http.congestion_control.default.XXX INT|STRING YYY

Modified: trafficserver/traffic/trunk/proxy/congest/Congestion.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/congest/Congestion.cc?rev=998224&r1=998223&r2=998224&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/congest/Congestion.cc (original)
+++ trafficserver/traffic/trunk/proxy/congest/Congestion.cc Fri Sep 17 17:49:21 2010
@@ -67,7 +67,6 @@ static const char *default_dead_os_conn_
 static const char *default_max_connection_var = "proxy.config.http.congestion_control.default.max_connection";
 static const char *default_error_page_var = "proxy.config.http.congestion_control.default.error_page";
 static const char *default_congestion_scheme_var = "proxy.config.http.congestion_control.default.congestion_scheme";
-static const char *default_snmp_var = "proxy.config.http.congestion_control.default.snmp";
 
 char *DEFAULT_error_page = xstrdup("congestion#retryAfter");
 int DEFAULT_max_connection_failures = 5;
@@ -82,8 +81,6 @@ int DEFAULT_dead_os_conn_retries = 1;
 int DEFAULT_max_connection = -1;
 char *DEFAULT_congestion_scheme_str = xstrdup("per_ip");
 int DEFAULT_congestion_scheme = PER_IP;
-char *DEFAULT_snmp_str = xstrdup("on");
-int DEFAULT_snmp = 1;
 
 /* congestion control limits */
 #define CONG_RULE_MAX_max_connection_failures \
@@ -114,7 +111,6 @@ CongestionControlRecord::CongestionContr
   dead_os_conn_timeout = rec.dead_os_conn_timeout;
   dead_os_conn_retries = rec.dead_os_conn_retries;
   max_connection = rec.max_connection;
-  snmp_enabled = rec.snmp_enabled;
   pRecord = NULL;
   ref_count = 1;
   line_num = rec.line_num;
@@ -139,7 +135,6 @@ CongestionControlRecord::setdefault()
   dead_os_conn_timeout = DEFAULT_dead_os_conn_timeout;
   dead_os_conn_retries = DEFAULT_dead_os_conn_retries;
   max_connection = DEFAULT_max_connection;
-  snmp_enabled = DEFAULT_snmp;
 }
 
 char *
@@ -235,12 +230,6 @@ CongestionControlRecord::Init(matcher_li
       }
     } else if (strcasecmp(label, "error_page") == 0) {
       error_page = xstrdup(val);
-    } else if (strcasecmp(label, "snmp") == 0) {
-      if (!strcasecmp(val, "on")) {
-        snmp_enabled = 1;
-      } else {
-        snmp_enabled = 0;
-      }
     } else if (strcasecmp(label, "prefix") == 0) {
       prefix = xstrdup(val);
       prefix_len = strlen(prefix);
@@ -329,7 +318,6 @@ CongestionControlRecord::Print()
   PrintNUM(dead_os_conn_timeout);
   PrintNUM(dead_os_conn_retries);
   PrintNUM(max_connection);
-  PrintNUM(snmp_enabled);
 #undef PrintNUM
 #undef PrintSTR
 }
@@ -392,21 +380,6 @@ CongestionControlDefaultSchemeChanged(co
   return 0;
 }
 
-static int
-CongestionControlDefaultSNMPChanged(const char *name, RecDataT data_type, RecData data, void *cookie)
-{
-  NOWARN_UNUSED(name);
-  NOWARN_UNUSED(data_type);
-  NOWARN_UNUSED(data);
-  NOWARN_UNUSED(cookie);
-  if (strcasecmp(DEFAULT_snmp_str, "on") == 0) {
-    DEFAULT_snmp = 1;
-  } else {
-    DEFAULT_snmp = 0;
-  }
-  return 0;
-}
-
 //-----------------------------------------------
 // hack for link the RegressionTest into the
 //  TS binary
@@ -442,14 +415,12 @@ initCongestionControl()
   CC_EstablishStaticConfigInteger(DEFAULT_max_connection, default_max_connection_var);
   CC_EstablishStaticConfigStringAlloc(DEFAULT_congestion_scheme_str, default_congestion_scheme_var);
   CC_EstablishStaticConfigStringAlloc(DEFAULT_error_page, default_error_page_var);
-  CC_EstablishStaticConfigStringAlloc(DEFAULT_snmp_str, default_snmp_var);
   CC_EstablishStaticConfigInteger(congestionControlEnabled, congestEnabledVar);
   CC_EstablishStaticConfigInteger(congestionControlLocalTime, congestTimeVar);
   {
     RecData recdata;
     recdata.rec_int = 0;
     CongestionControlDefaultSchemeChanged(NULL, RECD_NULL, recdata, NULL);
-    CongestionControlDefaultSNMPChanged(NULL, RECD_NULL, recdata, NULL);
   }
 
   CongestionMatcher = NEW(new CongestionMatcherTable(congestVar, congestPrefix, &congest_dest_tags));
@@ -464,7 +435,6 @@ initCongestionControl()
     Debug("congestion_config", "congestion control disabled");
   }
   RecRegisterConfigUpdateCb(default_congestion_scheme_var, &CongestionControlDefaultSchemeChanged, NULL);
-  RecRegisterConfigUpdateCb(default_snmp_var, &CongestionControlDefaultSNMPChanged, NULL);
   RecRegisterConfigUpdateCb(congestEnabledVar, &CongestionControlEnabledChanged, NULL);
   RecRegisterConfigUpdateCb(congestVar, &CongestionControlFile_CB, NULL);
 }
@@ -678,9 +648,11 @@ CongestionEntry::init(CongestionControlR
   rule->get();
   pRecord = rule;
   clearFailHistory();
+
+  // TODO: This used to signal via SNMP
   if ((pRecord->max_connection > m_num_connections)
       && ink_atomic_swap(&m_M_congested, 0)) {
-    snmp_sig_alive();
+    // action not congested?
   }
 }
 
@@ -713,24 +685,28 @@ CongestionEntry::applyNewRule(Congestion
   pRecord->put();
   rule->get();
   pRecord = rule;
+  // TODO: This used to signal via SNMP
   if (((pRecord->max_connection < 0)
        || (pRecord->max_connection > m_num_connections))
       && ink_atomic_swap(&m_M_congested, 0)) {
-    snmp_sig_alive();
+    // action not congested ?
   }
+  // TODO: This used to signal via SNMP
   if (pRecord->max_connection_failures < 0) {
     if (ink_atomic_swap(&m_congested, 0)) {
-      snmp_sig_alive();
+      // action not congested ?
     }
     return;
   }
+  // TODO: This used to signal via SNMP
   if (mcf < pRecord->max_connection_failures) {
     if (ink_atomic_swap(&m_congested, 0)) {
-      snmp_sig_alive();
+      // action not congested?
     }
   } else if (mcf > pRecord->max_connection_failures && m_history.events >= pRecord->max_connection_failures) {
-    if (!ink_atomic_swap(&m_congested, 1))
-      snmp_sig_congested();
+    if (!ink_atomic_swap(&m_congested, 1)) {
+      // action congested?
+    }
   }
 }
 
@@ -808,9 +784,10 @@ CongestionEntry::failed_at(ink_hrtime t)
     m_history.regist_event(time);
     if (!m_congested) {
       int32 new_congested = compCongested();
+      // TODO: This used to signal via SNMP
       if (new_congested && !ink_atomic_swap(&m_congested, 1)) {
         m_last_congested = m_history.last_event;
-        snmp_sig_congested();
+        // action congested ?
       }
     }
   } else {
@@ -821,8 +798,9 @@ CongestionEntry::failed_at(ink_hrtime t)
 void
 CongestionEntry::go_alive()
 {
+  // TODO: This used to signal via SNMP
   if (ink_atomic_swap(&m_congested, 0)) {
-    snmp_sig_alive();
+    // Action not congested ?
   }
 }
 
@@ -830,31 +808,3 @@ CongestionEntry::go_alive()
 #define SERVER_ALLEVIATED_SIG REC_SIGNAL_HTTP_ALLEVIATED_SERVER
 #define CC_SignalWarning(sig, msg) \
      REC_SignalWarning(sig, msg)
-
-void
-CongestionEntry::snmp_sig_congested()
-{
-  if (pRecord->snmp_enabled) {
-    char msg[1024];
-    struct in_addr addr;
-    snprintf(msg, sizeof(msg), "[%d] server %s/%s congested",
-             pRecord->line_num,
-             (m_hostname ? m_hostname : (addr.s_addr = htonl(m_ip), inet_ntoa(addr))),
-             (pRecord->prefix ? pRecord->prefix : ""));
-    CC_SignalWarning(SERVER_CONGESTED_SIG, msg);
-  }
-}
-
-void
-CongestionEntry::snmp_sig_alive()
-{
-  if (pRecord->snmp_enabled) {
-    char msg[1024];
-    struct in_addr addr;
-    snprintf(msg, sizeof(msg), "[%d] congested server %s/%s alleviated",
-             pRecord->line_num,
-             (m_hostname ? m_hostname : (addr.s_addr = htonl(m_ip), inet_ntoa(addr))),
-             (pRecord->prefix ? pRecord->prefix : ""));
-    CC_SignalWarning(SERVER_ALLEVIATED_SIG, msg);
-  }
-}

Modified: trafficserver/traffic/trunk/proxy/congest/Congestion.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/congest/Congestion.h?rev=998224&r1=998223&r2=998224&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/congest/Congestion.h (original)
+++ trafficserver/traffic/trunk/proxy/congest/Congestion.h Fri Sep 17 17:49:21 2010
@@ -99,7 +99,6 @@ public:
   int dead_os_conn_timeout;
   int dead_os_conn_retries;
   int max_connection;
-  int snmp_enabled;
 
   CongestionControlRecord *pRecord;
   int32 ref_count;
@@ -148,7 +147,6 @@ live_os_conn_retries(2),
 dead_os_conn_timeout(15),
 dead_os_conn_retries(1),
 max_connection(-1),
-snmp_enabled(0),
 pRecord(NULL),
 ref_count(0)
 {
@@ -299,9 +297,6 @@ struct CongestionEntry: public RequestDa
   void applyNewRule(CongestionControlRecord * rule);
   void init(CongestionControlRecord * rule);
 
-  // SNMP functions
-  void snmp_sig_congested();
-  void snmp_sig_alive();
 };
 
 inline bool CongestionEntry::usefulInfo(ink_hrtime t)
@@ -338,7 +333,7 @@ inline bool CongestionEntry::M_congested
   if (pRecord->max_connection >= 0 && m_num_connections >= pRecord->max_connection) {
     if (ink_atomic_swap(&m_M_congested, 1) == 0) {
       m_last_M_congested = t;
-      snmp_sig_congested();
+      // TODO: Used to signal congestions
     }
     return true;
   }
@@ -405,7 +400,7 @@ CongestionEntry::connection_closed()
 {
   ink_atomic_increment(&m_num_connections, -1);
   if (ink_atomic_swap(&m_M_congested, 0) == 1) {
-    snmp_sig_alive();
+    // TODO: Used to signal not congested
   }
 }
 

Modified: trafficserver/traffic/trunk/proxy/congest/CongestionTest.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/congest/CongestionTest.cc?rev=998224&r1=998223&r2=998224&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/congest/CongestionTest.cc (original)
+++ trafficserver/traffic/trunk/proxy/congest/CongestionTest.cc Fri Sep 17 17:49:21 2010
@@ -200,7 +200,6 @@ struct CCFailHistoryTestCont: public Con
     rule = new CongestionControlRecord;
     rule->fail_window = FAIL_WINDOW;
     rule->max_connection_failures = 10;
-    rule->snmp_enabled = 1;
     rule->pRecord = new CongestionControlRecord(*rule);
     entry = new CongestionEntry("dummy_host", 0, rule->pRecord, 0);
   }
@@ -432,7 +431,6 @@ CCCongestionDBTestCont::init()
     rule = new CongestionControlRecord;
     rule->fail_window = 300;
     rule->max_connection_failures = 10;
-    rule->snmp_enabled = 1;
     rule->pRecord = new CongestionControlRecord(*rule);
   }
 

Modified: trafficserver/traffic/trunk/proxy/congest/FeatureSpec.txt
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/congest/FeatureSpec.txt?rev=998224&r1=998223&r2=998224&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/congest/FeatureSpec.txt (original)
+++ trafficserver/traffic/trunk/proxy/congest/FeatureSpec.txt Fri Sep 17 17:49:21 2010
@@ -138,7 +138,6 @@ The tag=value pairs are used to specify 
 	max_connection=<integer>		// -1 means unlimited
 	error_page=<page uri>          
 	congestion_scheme=per_ip|per_host
-	snmp=on|off
 
 The suggested default values are as follows:
 	max_connection_failures=5
@@ -153,7 +152,6 @@ The suggested default values are as foll
 	max_connection=-1
 	error_page="congestion#retryAfter"
 	congestion_scheme="per_ip"
-	snmp="on"
 
 The above tag values will be used as default if the tag is not specified 
 in the rule.
@@ -188,23 +186,6 @@ Whenever these alarms are signalled (eve
 potentially, users can be flooded with SNMP traps if a congested
 server is always signalling an alarm. 
 
-
-<SNMP Enhancement>
-        - when TS detects a congestion server, an alarm is signaled
-          and an SNMP trap is sent (to the configured console).
-	- when a congested server is alleviated, an alarm is signaled
-          and an SNMP trap is sent.
-        - user can disable/enable support SNMP as a whole. SNMP cannot
-          be disabled/enabled per feature basis (e.g.: turn off all congestion
-          control traps only), but SNMP can be enabled/disabled on  per rules
-	  basis (e.g.: ignore traps generated by congested server that 
-          matches this rule)
-	- two traps are defined in the Inktomi vendor MIB tree, they
-          are:
-	    httpCongestedServer    1.3.6.1.4.1.1967.3.1.3.3.2
-	    httpAlleviatedServer   1.3.6.1.4.1.1967.3.1.3.3.3
-
-
 <Web UI Enhancement>
 For configuration purposes, we will add a new "Congestion Control" tab to the 
 "Configure -> Networking -> Connection Management" section of the web UI.  
@@ -440,9 +421,6 @@ long format
 0 congest remove all
 		-- remove all entries in the congestion control internal table
 
-*** SNMP trap enable/disable per congestion rules
-
-
 
 
 

Modified: trafficserver/traffic/trunk/proxy/mgmt2/AddConfigFilesHere.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/AddConfigFilesHere.cc?rev=998224&r1=998223&r2=998224&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/AddConfigFilesHere.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/AddConfigFilesHere.cc Fri Sep 17 17:49:21 2010
@@ -82,7 +82,6 @@ initializeRegistry()
   configFiles->addFile("parent.config", false);
   configFiles->addFile("filter.config", false);
   configFiles->addFile("remap.config", false);
-  configFiles->addFile("snmpinfo.dat", false);  // SNMP daemon agent configuration
   configFiles->addFile("update.config", false);
   configFiles->addFile("admin_access.config", false);
   configFiles->addFile("partition.config", false);

Modified: trafficserver/traffic/trunk/proxy/mgmt2/Alarms.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/Alarms.cc?rev=998224&r1=998223&r2=998224&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/Alarms.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/Alarms.cc Fri Sep 17 17:49:21 2010
@@ -214,18 +214,12 @@ Alarms::signalAlarm(alarm_t a, const cha
   case MGMT_ALARM_PROXY_PROCESS_BORN:
     mgmt_log(stderr, "[Alarms::signalAlarm] Server Process born\n");
     priority = 2;
-#ifdef USE_SNMP
-    snmpAlarmCallback(a, NULL, desc);
-#endif
     return;
   case MGMT_ALARM_ADD_ALARM:
     priority = 2;
     break;
   case MGMT_ALARM_PROXY_HTTP_CONGESTED_SERVER:
   case MGMT_ALARM_PROXY_HTTP_ALLEVIATED_SERVER:
-#ifdef USE_SNMP
-    snmpAlarmCallback(a, NULL, desc);
-#endif // USE_SNMP
     return;
   case MGMT_ALARM_WDA_BILLING_CONNECTION_DIED:
   case MGMT_ALARM_WDA_BILLING_CORRUPTED_DATA:

Modified: trafficserver/traffic/trunk/proxy/mgmt2/LocalManager.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/LocalManager.cc?rev=998224&r1=998223&r2=998224&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/LocalManager.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/LocalManager.cc Fri Sep 17 17:49:21 2010
@@ -78,13 +78,6 @@ void
 LocalManager::mgmtShutdown(int status, bool mainThread)
 {
   if (mainThread) {
-#ifdef USE_SNMP
-    if (snmp) {
-      snmp->shutdown();
-      snmp = NULL;
-    }
-#endif
-
     mgmt_log("[LocalManager::mgmtShutdown] Executing shutdown request.\n");
     processShutdown(mainThread);
 
@@ -1003,17 +996,6 @@ LocalManager::processEventQueue()
         }
         handled_by_mgmt = true;
       }
-      // snmpd.config
-      if (!(strcmp(data_raw, "snmpd.cnf"))) {
-#ifdef USE_SNMP
-        // need to restart SNMP agent
-        Debug("lm", "[TrafficManager] ==> flagging restart of Emanate agent\n");
-        if (snmp) {
-          snmp->signalRereadConfig();
-        }
-#endif
-        handled_by_mgmt = true;
-      }
       // admin_access.config
       if (!(strcmp(data_raw, "admin_access.config"))) {
         markAuthOtherUsersChange();

Modified: trafficserver/traffic/trunk/proxy/mgmt2/LocalManager.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/LocalManager.h?rev=998224&r1=998223&r2=998224&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/LocalManager.h (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/LocalManager.h Fri Sep 17 17:49:21 2010
@@ -39,7 +39,6 @@
 #include "LMRecords.h"
 #include "BaseManager.h"
 #include "ClusterCom.h"
-//#include "SNMP.h"
 #include "VMap.h"
 #include "WebPluginList.h"
 
@@ -181,7 +180,6 @@ public:
   volatile pid_t watched_process_pid;
 
   LMRecords *record_data;
-  //SNMP *m_snmp;
 
 #ifdef MGMT_USE_SYSLOG
   int syslog_facility;

Modified: trafficserver/traffic/trunk/proxy/mgmt2/Main.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/Main.cc?rev=998224&r1=998223&r2=998224&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/Main.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/Main.cc Fri Sep 17 17:49:21 2010
@@ -91,7 +91,6 @@ extern "C"
 extern "C" int getpwnam_r(const char *name, struct passwd *result, char *buffer, size_t buflen, struct passwd **resptr);
 #endif
 
-//SNMP *snmp;                     // global binding with SNMP.cc
 LocalManager *lmgmt = NULL;
 MgmtPing *icmp_ping;
 FileManager *configFiles;
@@ -107,7 +106,6 @@ inkcoreapi DiagsConfig *diagsConfig;
 char debug_tags[1024] = "";
 char action_tags[1024] = "";
 int diags_init = 0;
-int snmpLogLevel = 0;
 bool proxy_on = true;
 bool forceProcessRecordsSnap = false;
 
@@ -520,9 +518,6 @@ main(int argc, char **argv)
         proxy_on = false;
       } else if (strcmp(argv[i], "-nosyslog") == 0) {
         log_to_syslog = false;
-      } else if (strcmp(argv[i], "-snmplog") == 0) {
-        i++;
-        snmpLogLevel = atoi(argv[i]);
       } else {
         // The rest of the options require an argument in the form of -<Flag> <val>
         if ((i + 1) < argc) {
@@ -753,25 +748,11 @@ main(int argc, char **argv)
   }
 #endif /* MGMT_USE_SYSLOG */
 
-#ifdef USE_SNMP
-  ink_thread snmpThrId;
-  SNMPStateInit();
-  snmp = new SNMP();
-  if (snmpLogLevel > 0) {
-    snmp->enableLogging(snmpLogLevel);
-  }
-#endif
-
     /****************************
      * Register Alarm Callbacks *
      ****************************/
   lmgmt->alarm_keeper->registerCallback(overviewAlarmCallback);
 
-#ifdef USE_SNMP
-  lmgmt->alarm_keeper->registerCallback(snmpAlarmCallback);
-#endif
-
-
   // Find out our hostname so we can use it as part of the initialization
   setHostnameVar();
 
@@ -864,11 +845,6 @@ main(int argc, char **argv)
   overviewGenerator->addSelfRecord();
 
   webThrId = ink_thread_create(webIntr_main, NULL);     /* Spin web agent thread */
-#ifdef USE_SNMP
-  snmpThrId = ink_thread_create(snmpThread, (void *) snmp);     /* Spin snmp agent thread */
-#endif
-
-
   lmgmt->listenForProxy();
 
 
@@ -991,7 +967,6 @@ main(int argc, char **argv)
 //          lmgmt->record_data->syncRecords(false);
 //      }
 
-//      snmp->poll();
     lmgmt->ccom->generateClusterDelta();
 
     if (lmgmt->run_proxy && lmgmt->processRunning()) {
@@ -1025,12 +1000,6 @@ main(int argc, char **argv)
       lmgmt->mgmtShutdown(0, true);
     }
 
-#ifdef USE_SNMP
-    // deal with the SNMP agent daemon, fork/exec/etc.
-    if (snmp) {
-      snmp->processMgmt(lmgmt);
-    }
-#endif
     if (lmgmt->run_proxy && !lmgmt->processRunning()) { /* Make sure we still have a proxy up */
       if (lmgmt->startProxy())
         just_started = 0;
@@ -1165,16 +1134,6 @@ SignalHandler(int sig)
       if (sig == SIGTERM || sig == SIGINT) {
         kill(lmgmt->watched_process_pid, sig);
         waitpid(lmgmt->watched_process_pid, &status, 0);
-#if defined(linux) && defined (USE_SNMP)
-        // INKqa08918: band-aid: for some reasons if snmpd.cnf is modified
-        // the snmp processes are killed and restarted successfully. But
-        // when traffic server is shut down, the snmp processes are not killed.
-        // NOTE: race condition with the shutdown() call in LocalManager.cc
-        if (snmp) {
-          snmp->shutdown();
-          snmp = NULL;
-        }
-#endif
       }
     }
     lmgmt->mgmtCleanup();
@@ -1269,7 +1228,6 @@ printUsage()
   fprintf(stderr, "     -debug         <tags>  Enable the given debug tags\n");
   fprintf(stderr, "     -action        <tags>  Enable the given action tags.\n");
   fprintf(stderr, "     -version or -V         Print version id and exit.\n");
-  fprintf(stderr, "     -snmplog       <int>   Turn on SNMP SDK diagnostics. (2147450879 is good...)\n");
   fprintf(stderr, "     -vingid        <id>    Vingid Flag\n");
   fprintf(stderr, "\n");
   fprintf(stderr, "   [...] can be one+ of: [config process node cluster local all]\n");
@@ -1338,9 +1296,6 @@ fileUpdated(char *fname)
   } else if (strcmp(fname, "wpad.dat") == 0) {
     mgmt_log(stderr, "[fileUpdated] wpad.dat file has been modified\n");
 
-  } else if (strcmp(fname, "snmpd.cnf") == 0) {
-    lmgmt->signalFileChange("snmpd.cnf");
-
   } else if (strcmp(fname, "icp.config") == 0) {
     lmgmt->signalFileChange("proxy.config.icp.icp_configuration");
 
@@ -1356,10 +1311,6 @@ fileUpdated(char *fname)
   } else if (strcmp(fname, "hosting.config") == 0) {
     lmgmt->signalFileChange("proxy.config.cache.hosting_filename");
 
-    // INKqa07930: recently added SNMP config files need to be caught here to
-  } else if (strcmp(fname, "snmpinfo.dat") == 0) {
-    mgmt_log(stderr, "[fileUpdated] snmpinfo.dat file has been modified\n");
-
   } else if (strcmp(fname, "mgr.cnf") == 0) {
     mgmt_log(stderr, "[fileUpdated] mgr.cnf file has been modified\n");
 

Modified: trafficserver/traffic/trunk/proxy/mgmt2/Main.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/Main.h?rev=998224&r1=998223&r2=998224&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/Main.h (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/Main.h Fri Sep 17 17:49:21 2010
@@ -27,7 +27,6 @@
 #include "LocalManager.h"
 #include "FileManager.h"
 #include "MgmtPing.h"
-//#include "SNMP.h"
 #include "WebOverview.h"
 #include "I_Version.h"
 
@@ -47,7 +46,6 @@ void extractConfigInfo(char *mgmt_path, 
 void printUsage(void);
 
 extern MgmtPing *icmp_ping;
-//extern SNMP *snmp;
 extern FileManager *configFiles;
 extern overviewPage *overviewGenerator;
 extern AppVersionInfo appVersionInfo;

Modified: trafficserver/traffic/trunk/proxy/mgmt2/RecordsConfig.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/RecordsConfig.cc?rev=998224&r1=998223&r2=998224&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/RecordsConfig.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/RecordsConfig.cc Fri Sep 17 17:49:21 2010
@@ -541,9 +541,6 @@ RecordElement RecordsConfig[] = {
   {CONFIG, "proxy.config.http.congestion_control.default.congestion_scheme", "", INK_STRING, "per_ip", RU_NULL, RR_NULL,
    RC_NULL, NULL, RA_NULL}
   ,
-  {CONFIG, "proxy.config.http.congestion_control.default.snmp", "", INK_STRING, "on", RU_NULL, RR_NULL, RC_NULL, NULL,
-   RA_NULL}
-  ,
 
   //        ###########
   //        # Parsing #
@@ -2620,17 +2617,6 @@ RecordElement RecordsConfig[] = {
   ,
   {PROCESS, "proxy.process.update.state_machines", "", INK_INT, "0", RU_NULL, RR_NULL, RC_NULL, NULL, RA_NULL}
   ,
-  //##############################################################################
-  //# SNMP Configuration
-  //##############################################################################
-  //# Start MIB-II Host MIB (TCP/UDP stats, etc.) and traffic server MIB
-  {CONFIG, "proxy.config.snmp.master_agent_enabled", "", INK_INT, "1", RU_REREAD, RR_NULL, RC_INT, "[0-1]", RA_NULL}
-  ,
-  {CONFIG, "proxy.config.snmp.snmp_encap_enabled", "", INK_INT, "0", RU_REREAD, RR_NULL, RC_INT, "[0-1]", RA_NULL}
-  ,
-  {CONFIG, "proxy.config.snmp.trap_message", "", INK_STRING, "Traffic server trap", RU_NULL, RR_NULL, RC_NULL, NULL,
-   RA_NULL}
-  ,
 
   //##############################################################################
   //# Plug-in Configuration

Modified: trafficserver/traffic/trunk/proxy/mgmt2/StatAggregation.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/StatAggregation.cc?rev=998224&r1=998223&r2=998224&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/StatAggregation.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/StatAggregation.cc Fri Sep 17 17:49:21 2010
@@ -1090,8 +1090,6 @@ aggregateNodeRecords()
   // Overall
   Ag_Connections();
 
-  // These are for the benefit of SNMP so that we don't have to use
-  // 64 bit integers or floating point encodings.
   AgFloat_generic_scale_to_int("proxy.node.client_throughput_out",
                                "proxy.node.client_throughput_out_kbit", MBIT_TO_KBIT_SCALE);
   AgFloat_generic_scale_to_int("proxy.node.http.cache_hit_ratio",

Modified: trafficserver/traffic/trunk/proxy/mgmt2/cli/CLIeventHandler.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/cli/CLIeventHandler.cc?rev=998224&r1=998223&r2=998224&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/cli/CLIeventHandler.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/cli/CLIeventHandler.cc Fri Sep 17 17:49:21 2010
@@ -833,12 +833,12 @@ CmdLine_EventHandler::ConfigureServerLev
     /* Fall through */
   case CL_EV_SIX:              // show throttling of connections
     /* Fall through */
-  case CL_EV_SEVEN:            // show SNMP configuration
-    /* Fall through */
-  case CL_EV_EIGHT:            // Show Customizable Pages
+  case CL_EV_SEVEN:            // Show Customizable Pages
     Debug("cli_event", "ConfigureServerrLevel: entered %d case \n", cli_data->cevent);
     CLI_configure::doConfigureServer(cli_data);
     break;
+  case CL_EV_EIGHT:
+    /* Fall through */
   case CL_EV_NINE:
     /* Fall through */
   case CL_EV_TEN:

Modified: trafficserver/traffic/trunk/proxy/mgmt2/cli/CLIhelp.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/cli/CLIhelp.cc?rev=998224&r1=998223&r2=998224&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/cli/CLIhelp.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/cli/CLIhelp.cc Fri Sep 17 17:49:21 2010
@@ -169,7 +169,7 @@ static const char *ConfigureHelpStrings[
 };
 
 // Help usage at cli->configure->server level
-const int numCmdConfServer = 13;
+const int numCmdConfServer = 12;
 static const char *ConfigureServerHelpStrings[numCmdConfServer] = {
   "1. display            # displays all configuration variables \n",
   "2. server             # server configuration variables \n",
@@ -177,8 +177,7 @@ static const char *ConfigureServerHelpSt
   "4. virtual-ip         # virtual ip configuration variables \n",
   "5. auto-configuration # auto configuration variables \n",
   "6. throttling         # server throttling configuration variables \n",
-  "7. SNMP               # SNMP configuration variables \n",
-  "8. Customizable Response Pages # \n",
+  "7. Customizable Response Pages # \n",
   "     Select above options by number \n",
   "change <no> <value>   # sets variable shown by <no> to <value>\n",
   ".                     # Move back to previous level \n",

Modified: trafficserver/traffic/trunk/proxy/mgmt2/cli2/CliCreateCommands.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/cli2/CliCreateCommands.cc?rev=998224&r1=998223&r2=998224&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/cli2/CliCreateCommands.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/cli2/CliCreateCommands.cc Fri Sep 17 17:49:21 2010
@@ -83,8 +83,6 @@ CliCreateCommands()
 
   createCommand("show:remap", Cmd_ShowRemap, NULL, CLI_COMMAND_EXTERNAL, "show:remap", "Remap configuration");
 
-  createCommand("show:snmp", Cmd_ShowSnmp, NULL, CLI_COMMAND_EXTERNAL, "show:snmp", "SNMP configuration");
-
   createCommand("show:socks", Cmd_ShowSocks, CmdArgs_ShowSocks, CLI_COMMAND_EXTERNAL,
                 "show:socks", "SOCKS configuration");
 
@@ -155,10 +153,6 @@ CliCreateCommands()
   createCommand("config:remap", Cmd_ConfigRemap, NULL, CLI_COMMAND_EXTERNAL,
                 "config:remap <url>", "Update remap configuration file <url>");
 
-
-  createCommand("config:snmp", Cmd_ConfigSnmp, CmdArgs_ConfigSnmp, CLI_COMMAND_EXTERNAL,
-                "config:snmp status <on|off>", "Configure SNMP <on|off>");
-
   createCommand("config:clock", Cmd_ConfigClock, CmdArgs_ConfigClock, CLI_COMMAND_EXTERNAL,
                 "config:clock date <mm/dd/yyyy>\n"
                 "config:clock time <hh:mm:ss>\n"

Modified: trafficserver/traffic/trunk/proxy/mgmt2/cli2/ConfigCmd.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/cli2/ConfigCmd.cc?rev=998224&r1=998223&r2=998224&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/cli2/ConfigCmd.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/cli2/ConfigCmd.cc Fri Sep 17 17:49:21 2010
@@ -865,63 +865,6 @@ CmdArgs_ConfigPorts()
 }
 
 ////////////////////////////////////////////////////////////////
-// Cmd_ConfigSnmp
-//
-// This is the callback function for the "config:snmp" command.
-//
-// Parameters:
-//    clientData -- information about parsed arguments
-//    interp -- the Tcl interpreter
-//    argc -- number of command arguments
-//    argv -- the command arguments
-//
-int
-Cmd_ConfigSnmp(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[])
-{
-  /* call to processArgForCommand must appear at the beginning
-   * of each command's callback function
-   */
-  if (processArgForCommand(interp, argc, argv) != CLI_OK) {
-    return CMD_ERROR;
-  }
-
-  if (processHelpCommand(argc, argv) == CLI_OK)
-    return CMD_OK;
-
-  if (cliCheckIfEnabled("config:snmp") == CLI_ERROR) {
-    return CMD_ERROR;
-  }
-  Cli_Debug("Cmd_ConfigSnmp argc %d\n", argc);
-
-  cli_cmdCallbackInfo *cmdCallbackInfo;
-  cli_parsedArgInfo *argtable;
-
-  cmdCallbackInfo = (cli_cmdCallbackInfo *) clientData;
-  argtable = cmdCallbackInfo->parsedArgTable;
-
-  if (argtable->parsed_args != CLI_PARSED_ARGV_END) {
-    if (argtable->parsed_args == CMD_CONFIG_SNMP_STATUS) {
-      return (Cli_RecordOnOff_Action((argc == 3), "proxy.config.snmp.master_agent_enabled", argtable->arg_string));
-    }
-  }
-  Cli_Error(ERR_COMMAND_SYNTAX, cmdCallbackInfo->command_usage);
-  return CMD_ERROR;
-}
-
-////////////////////////////////////////////////////////////////
-// CmdArgs_ConfigSnmp
-//
-// Register "config:snmp" arguments with the Tcl interpreter.
-//
-int
-CmdArgs_ConfigSnmp()
-{
-  createArgument("status", 1, CLI_ARGV_OPTION_NAME_VALUE,
-                 (char *) NULL, CMD_CONFIG_SNMP_STATUS, "SNMP <on | off>", (char *) NULL);
-  return 0;
-}
-
-////////////////////////////////////////////////////////////////
 // Cmd_ConfigClock
 //
 // This is the callback function for the "config:clock" command.

Modified: trafficserver/traffic/trunk/proxy/mgmt2/cli2/ConfigCmd.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/cli2/ConfigCmd.h?rev=998224&r1=998223&r2=998224&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/cli2/ConfigCmd.h (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/cli2/ConfigCmd.h Fri Sep 17 17:49:21 2010
@@ -57,9 +57,6 @@ typedef enum
   CMD_CONFIG_PORTS_SSL,
   CMD_CONFIG_PORTS_SOCKS_SERVER,
   CMD_CONFIG_PORTS_ICP,
-  CMD_CONFIG_SNMP,
-  CMD_CONFIG_SNMP_STATUS,
-  CMD_CONFIG_SNMP_VALUE,
   CMD_CONFIG_DATE,
   CMD_CONFIG_TIME,
   CMD_CONFIG_TIMEZONE,
@@ -434,27 +431,6 @@ int Cmd_ConfigPorts(ClientData clientDat
 int CmdArgs_ConfigPorts();
 
 ////////////////////////////////////////////////////////////////
-// Cmd_ConfigSnmp
-//
-// This is the callback function for the "config:snmp" command.
-//
-// Parameters:
-//    clientData -- information about parsed arguments
-//    interp -- the Tcl interpreter
-//    argc -- number of command arguments
-//    argv -- the command arguments
-//
-int Cmd_ConfigSnmp(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[]);
-
-////////////////////////////////////////////////////////////////
-// CmdArgs_ConfigSnmp
-//
-// Register "config:snmp" arguments with the Tcl interpreter.
-//
-int CmdArgs_ConfigSnmp();
-
-
-////////////////////////////////////////////////////////////////
 // Cmd_ConfigPortTunnles
 //
 // This is the callback function for the "config:port-tunnels" command.

Modified: trafficserver/traffic/trunk/proxy/mgmt2/cli2/ShowCmd.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/cli2/ShowCmd.cc?rev=998224&r1=998223&r2=998224&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/cli2/ShowCmd.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/cli2/ShowCmd.cc Fri Sep 17 17:49:21 2010
@@ -695,36 +695,6 @@ Cmd_ShowRemap(ClientData clientData, Tcl
 
 
 ////////////////////////////////////////////////////////////////
-// Cmd_ShowSnmp
-//
-// This is the callback function for the "show:snmp" command.
-//
-// Parameters:
-//    clientData -- information about parsed arguments
-//    interp -- the Tcl interpreter
-//    argc -- number of command arguments
-//    argv -- the command arguments
-//
-int
-Cmd_ShowSnmp(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[])
-{
-  NOWARN_UNUSED(clientData);
-  /* call to processArgForCommand must appear at the beginning
-   * of each command's callback function
-   */
-  if (processArgForCommand(interp, argc, argv) != CLI_OK) {
-    return CMD_ERROR;
-  }
-
-  if (processHelpCommand(argc, argv) == CLI_OK)
-    return CMD_OK;
-
-  Cli_Debug("Cmd_ShowSnmp\n");
-
-  return (ShowSnmp());
-}
-
-////////////////////////////////////////////////////////////////
 // Cmd_ShowSocks
 //
 // This is the callback function for the "show:socks" command.
@@ -2023,31 +1993,6 @@ ShowRemap()
   return status;
 }
 
-
-// show snmp sub-command
-int
-ShowSnmp()
-{
-
-  // declare and initialize variables
-
-  INKInt snmp_master_agent_enabled = 0;
-
-  // retrieve value
-
-  Cli_RecordGetInt("proxy.config.snmp.master_agent_enabled", &snmp_master_agent_enabled);
-
-  // display results
-  Cli_Printf("\n");
-
-  if (Cli_PrintEnable("SNMP Agent -- ", snmp_master_agent_enabled) == CLI_ERROR) {
-    return CLI_ERROR;
-  }
-  Cli_Printf("\n");
-
-  return CLI_OK;
-}
-
 // show socks sub-command
 int
 ShowSocks()

Modified: trafficserver/traffic/trunk/proxy/mgmt2/cli2/ShowCmd.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/cli2/ShowCmd.h?rev=998224&r1=998223&r2=998224&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/cli2/ShowCmd.h (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/cli2/ShowCmd.h Fri Sep 17 17:49:21 2010
@@ -59,7 +59,6 @@ typedef enum
   CMD_SHOW_PARENTS,
   CMD_SHOW_PARENT_RULES,
   CMD_SHOW_REMAP,
-  CMD_SHOW_SNMP,
   CMD_SHOW_SOCKS,
   CMD_SHOW_SOCKS_RULES,
   CMD_SHOW_PORT_TUNNELS,
@@ -116,7 +115,6 @@ int Cmd_ShowFilter(ClientData clientData
 int Cmd_ShowParents(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[]);
 int CmdArgs_ShowParents();
 int Cmd_ShowRemap(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[]);
-int Cmd_ShowSnmp(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[]);
 int Cmd_ShowSocks(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[]);
 int CmdArgs_ShowSocks();
 int Cmd_ShowPortTunnels(ClientData clientData, Tcl_Interp * interp, int argc, const char *argv[]);
@@ -210,9 +208,6 @@ int ShowParentRules();
 // show remap sub-command
 int ShowRemap();
 
-// show snmp sub-command
-int ShowSnmp();
-
 // show socks sub-command
 int ShowSocks();
 

Modified: trafficserver/traffic/trunk/proxy/mgmt2/cli2/cli_detailed_command_list.txt
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/cli2/cli_detailed_command_list.txt?rev=998224&r1=998223&r2=998224&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/cli2/cli_detailed_command_list.txt (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/cli2/cli_detailed_command_list.txt Fri Sep 17 17:49:21 2010
@@ -596,16 +596,6 @@ remap			Remap Rules
   (Display rules from remap.config)
   ts>
 
-snmp			SNMP Configuration
-			(on/off)
-  syntax: show:snmp
-  args:   none
-  behavior:  Display SNMP Configuration.
-
-  ts> show:snmp
-  SNMP Agent -- on    (proxy.config.snmp.master_agent_enabled)
-  ts>
-
 socks			SOCKS Configuration
 			(on/off, stats)
   syntax: show:socks [ rules ]
@@ -1447,27 +1437,6 @@ ports			Ports used by Traffic Server
           <socks-server>    (proxy.config.socks.socks_server_port) single
           <icp>             (proxy.config.icp.icp_port) single
 
-snmp			SNMP Configuration
-			(on/off)
-  syntax: config:snmp status <on | off>
-  args:   <on | off>  (proxy.config.snmp.master_agent_enabled)
-
-virtual-ip		Virtual IP Address Configuration
-
-  syntax: config:virtual-ip status <on | off>
-			    add ip <ip-address> device <device> sub-intf <sub-interface>
-	                    delete <ip number>
-
-
-  args:
-	<on | off>	(proxy.config.vmap.enabled)
-        add             (add entry to vmap.config)
-
-  ts# config:virtual-ip status on
-  ts#
-  ts# config:virtual-ip add ip 192.168.1.12 device eth2 sub-intf 28
-  ts$
-
 socks			SOCKS Configuration
   syntax: config:socks status <on | off> version <int> default-servers <string> 
                        accept <on | off> accept-port <port> 

Modified: trafficserver/traffic/trunk/proxy/mgmt2/cli2/cli_feature_spec.txt
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/cli2/cli_feature_spec.txt?rev=998224&r1=998223&r2=998224&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/cli2/cli_feature_spec.txt (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/cli2/cli_feature_spec.txt Fri Sep 17 17:49:21 2010
@@ -99,7 +99,6 @@ show:ssl                     SSL configu
 show:filter                  Filter configuration
 show:parent                  Parent configuration
 show:remap                   Remap configuration
-show:snmp                    SNMP configuration
 show:socks                   SOCKS configuration
 show:port-tunnels            Port tunnels configuration
 show:scheduled-update        Scheduled update configuration
@@ -134,8 +133,6 @@ config:parent rules <url>    
 
 config:remap <url>              Update remap configuration file <url>
     
-config:snmp <on|off>    
-    
 config:clock date <mm/dd/yyyy>          
 config:clock time <hh:mm:ss>
 config:clock timezone <number from list>       

Modified: trafficserver/traffic/trunk/proxy/mgmt2/cli2/script_configs.sh
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/cli2/script_configs.sh?rev=998224&r1=998223&r2=998224&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/cli2/script_configs.sh (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/cli2/script_configs.sh Fri Sep 17 17:49:21 2010
@@ -62,7 +62,7 @@ export TS_CONFIG_SECONDARY_MTPT="/mnt/ts
 
 export SYSTEM_CONFIG_FILES="/etc/resolv.conf /etc/hosts ${NETWORK_P2FILE} ${NETWORK_PARMSFILE}"
 
-export TS_CONFIG_FILES="logs.config storage.config socks.config proxy.pac lm.config vaddrs.config cache.config icp.config mgmt_allow.config ip_allow.config parent.config filter.config remap.config snmpd.cnf snmpinfo.dat mgr.cnf update.config ${MAIN_CONFIG_FILE}"
+export TS_CONFIG_FILES="logs.config storage.config socks.config proxy.pac lm.config vaddrs.config cache.config icp.config mgmt_allow.config ip_allow.config parent.config filter.config remap.config mgr.cnf update.config ${MAIN_CONFIG_FILE}"
 
 
 export FLOPPY_DEVICE="/dev/fd0"

Modified: trafficserver/traffic/trunk/proxy/mgmt2/cli2/script_configs.tcl
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/cli2/script_configs.tcl?rev=998224&r1=998223&r2=998224&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/cli2/script_configs.tcl (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/cli2/script_configs.tcl Fri Sep 17 17:49:21 2010
@@ -62,7 +62,7 @@ export TS_CONFIG_SECONDARY_MTPT="/mnt/ts
 
 export SYSTEM_CONFIG_FILES="/etc/resolv.conf /etc/hosts ${NETWORK_P2FILE} ${NETWORK_PARMSFILE}"
 
-export TS_CONFIG_FILES="logs.config storage.config socks.config proxy.pac lm.config vaddrs.config cache.config icp.config mgmt_allow.config ip_allow.config parent.config filter.config remap.config snmpd.cnf snmpinfo.dat mgr.cnf update.config ${MAIN_CONFIG_FILE}"
+export TS_CONFIG_FILES="logs.config storage.config socks.config proxy.pac lm.config vaddrs.config cache.config icp.config mgmt_allow.config ip_allow.config parent.config filter.config remap.config mgr.cnf update.config ${MAIN_CONFIG_FILE}"
 
 
 export FLOPPY_DEVICE="/dev/fd0"

Modified: trafficserver/traffic/trunk/proxy/mgmt2/tools/ConfigAPI.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/tools/ConfigAPI.cc?rev=998224&r1=998223&r2=998224&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/tools/ConfigAPI.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/tools/ConfigAPI.cc Fri Sep 17 17:49:21 2010
@@ -689,36 +689,6 @@ Config_SaveVersion(char *file)
   return 0;
 }
 
-
-#if defined(linux)
-int
-Config_SNMPSetUp(char *sys_location, char *sys_contact, char *sys_name, char *authtrapenable, char *trap_community,
-                 char *trap_host)
-{
-  if ((sys_location == NULL) || (sys_contact == NULL) || (sys_name == NULL) || (authtrapenable == NULL) ||
-      (trap_community == NULL) || (trap_host == NULL)) {
-    DPRINTF(("Config_SNMPSetUp: %s %s %s %s %s %s\n", sys_location, sys_contact, sys_name, authtrapenable,
-             trap_community, trap_host));
-    return -1;
-  }
-  return Net_SNMPSetUp(sys_location, sys_contact, sys_name, authtrapenable, trap_community, trap_host);
-}
-
-int
-Config_SNMPGetInfo(char *sys_location, size_t sys_location_len, char *sys_contact, size_t sys_contact_len,
-                   char *sys_name, size_t sys_name_len, char *authtrapenable, size_t authtrapenable_len,
-                   char *trap_community, size_t trap_community_len, char *trap_host, size_t trap_host_len)
-{
-  int status;
-  status =
-    Net_SNMPGetInfo(sys_location, sys_location_len, sys_contact, sys_contact_len, sys_name, sys_name_len,
-                    authtrapenable, authtrapenable_len, trap_community, trap_community_len, trap_host, trap_host_len);
-  DPRINTF(("Config_SNMPGetInfo: %s %s %s %s %s %s\n", sys_location, sys_contact, sys_name, authtrapenable,
-           trap_community, trap_host));
-  return status;
-}
-#endif /* linux */
-
 int
 Config_GetNTP_Status(char *status, size_t status_len)
 {
@@ -912,28 +882,6 @@ Config_RestoreNetConfig(char *file)
       xfree(TagValue);
     }
 
-#if defined(linux)
-    char *sys_location = netXml.getXmlTagValue("SNMPSysLocation");
-    char *sys_contact = netXml.getXmlTagValue("SNMPSysContact");
-    char *sys_name = netXml.getXmlTagValue("SNMPSysName");
-    char *authtrapenable = netXml.getXmlTagValue("SNMPauthtrapenable");
-    char *trap_community = netXml.getXmlTagValue("SNMPTrapCommunity");
-    char *trap_host = netXml.getXmlTagValue("SNMPTrapHost");
-    Net_SNMPSetUp(sys_location, sys_contact, sys_name, authtrapenable, trap_community, trap_host);
-    if (sys_location != NULL)
-      xfree(sys_location);
-    if (sys_contact != NULL)
-      xfree(sys_contact);
-    if (sys_name != NULL)
-      xfree(sys_name);
-    if (authtrapenable != NULL)
-      xfree(authtrapenable);
-    if (trap_community != NULL)
-      xfree(trap_community);
-    if (trap_host != NULL)
-      xfree(trap_host);
-#endif /* linux */
-
     // Get Admin GUI encrypted password.
     char *e_gui_passwd;
     INKActionNeedT action_need, top_action_req = INK_ACTION_UNDEFINED;
@@ -1179,54 +1127,6 @@ Config_SaveNetConfig(char *file)
     child->AppendChild(NTPServers);
   }
 
-#if defined(linux)
-  char sys_location[256];
-  char sys_contact[256];
-  char sys_name[256];
-  char authtrapenable[256];
-  char trap_community[256];
-  char trap_host[256];
-  Net_SNMPGetInfo(sys_location, sizeof(sys_location), sys_contact, sizeof(sys_contact), sys_name, sizeof(sys_name),
-                  authtrapenable, sizeof(authtrapenable), trap_community, sizeof(trap_community), trap_host,
-                  sizeof(trap_host));
-  if (sys_location != NULL) {
-    XMLNode *SNMPinfo = new XMLNode;
-    SNMPinfo->setNodeName("SNMPSysLocation");
-    SNMPinfo->setNodeValue(sys_location);
-    child->AppendChild(SNMPinfo);
-  }
-  if (sys_contact != NULL) {
-    XMLNode *SNMPinfo = new XMLNode;
-    SNMPinfo->setNodeName("SNMPSysContact");
-    SNMPinfo->setNodeValue(sys_contact);
-    child->AppendChild(SNMPinfo);
-  }
-  if (sys_location != NULL) {
-    XMLNode *SNMPinfo = new XMLNode;
-    SNMPinfo->setNodeName("SNMPSysName");
-    SNMPinfo->setNodeValue(sys_name);
-    child->AppendChild(SNMPinfo);
-  }
-  if (sys_location != NULL) {
-    XMLNode *SNMPinfo = new XMLNode;
-    SNMPinfo->setNodeName("SNMPauthtrapenable");
-    SNMPinfo->setNodeValue(authtrapenable);
-    child->AppendChild(SNMPinfo);
-  }
-  if (sys_location != NULL) {
-    XMLNode *SNMPinfo = new XMLNode;
-    SNMPinfo->setNodeName("SNMPTrapCommunity");
-    SNMPinfo->setNodeValue(trap_community);
-    child->AppendChild(SNMPinfo);
-  }
-  if (sys_location != NULL) {
-    XMLNode *SNMPinfo = new XMLNode;
-    SNMPinfo->setNodeName("SNMPTrapHost");
-    SNMPinfo->setNodeValue(trap_host);
-    child->AppendChild(SNMPinfo);
-  }
-#endif /* linux */
-
   XMLNode *child1 = new XMLNode;
   char *parentAttributes1[3];
   len = sizeof("type") + 1;

Modified: trafficserver/traffic/trunk/proxy/mgmt2/tools/ConfigAPI.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/tools/ConfigAPI.h?rev=998224&r1=998223&r2=998224&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/tools/ConfigAPI.h (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/tools/ConfigAPI.h Fri Sep 17 17:49:21 2010
@@ -85,11 +85,6 @@ extern int Config_GetXmlTagValue(char *X
 extern int Config_SetSMTP_Server(char *server);
 extern int Config_GetSMTP_Server(char *server);
 extern int Config_FloppyNetRestore();
-extern int Config_SNMPSetUp(char *sys_location, char *sys_contact, char *sys_name, char *authtrapenable,
-                            char *trap_community, char *trap_host);
-extern int Config_SNMPGetInfo(char *sys_location, size_t sys_location_len, char *sys_contact, size_t sys_contact_len,
-                              char *sys_name, size_t sys_name_len, char *authtrapenable, size_t authtrapenable_len,
-                              char *trap_community, size_t trap_community_len, char *trap_host, size_t trap_host_len);
 extern int Config_User_Root(int *old_euid);
 extern int Config_User_Inktomi(int euid);
 extern int Config_Grp_Root(int *old_egid);

Modified: trafficserver/traffic/trunk/proxy/mgmt2/tools/SysAPI.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/tools/SysAPI.cc?rev=998224&r1=998223&r2=998224&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/tools/SysAPI.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/tools/SysAPI.cc Fri Sep 17 17:49:21 2010
@@ -53,7 +53,6 @@
 #define NETCONFIG_DNS       3
 #define NETCONFIG_INTF_UP   4
 #define NETCONFIG_INTF_DOWN 5
-#define NETCONFIG_SNMP_UP   7
 #define NETCONFIG_INTF_DISABLE 8
 
 #define TIMECONFIG_ALL	    0
@@ -1361,314 +1360,6 @@ Net_GetSMTP_Server(char *server)
 }
 
 #define MV_BINARY "/bin/mv"
-#define SNMP_PATH "/etc/snmp/snmpd.conf"
-#define TS_SNMP_PATH "snmpd.cnf"
-
-
-//main SNMP setup funciton
-int
-setSNMP(char *sys_location, char *sys_contact, char *sys_name, char *authtrapenable, char *trap_community,
-        char *trap_host)
-{
-  char snmp_path[1024], ts_snmp_path[1024], snmp_path_new[1024], ts_snmp_path_new[1024], buf[1024];
-  char *tmp, tmp1[1024];
-  FILE *fp, *fp1, *fp_ts, *fp1_ts, *snmppass_fp, *snmppass_fp1;
-  pid_t pid;
-  int status;
-  const char *mv_binary = MV_BINARY;
-
-  bool sys_location_flag = false;
-  bool sys_contact_flag = false;
-  bool sys_name_flag = false;
-  bool authtrapenable_flag = false;
-  bool trap_community_flag = false;
-  bool trap_host_flag = false;
-
-  DPRINTF(("setSNMP(): sys_location: %s, sys_contact: %s, sys_name: %s, authtrapenable: %s, trap_community: %s, trap_host: %s\n", sys_location, sys_contact, sys_name, authtrapenable, trap_community, trap_host));
-
-  //first open the snmp files
-  snprintf(snmp_path, sizeof(snmp_path), "%s", SNMP_PATH);
-  if ((fp = fopen(snmp_path, "r")) == NULL && (fp = fopen(snmp_path, "a+")) == NULL) {
-    DPRINTF(("[SysAPI] failed to open snmp configuration file\n"));
-    return 1;
-  }
-
-  Layout::relative_to(ts_snmp_path, sizeof(ts_snmp_path),
-                      Layout::get()->sysconfdir, TS_SNMP_PATH);
-  if ((fp_ts = fopen(ts_snmp_path, "r")) == NULL && (fp_ts = fopen(ts_snmp_path, "a+")) == NULL) {
-    DPRINTF(("[SysAPI] failed to open ts snmp configuration file\n"));
-    fclose(fp);
-    return 1;
-  }
-  snprintf(snmp_path_new, sizeof(snmp_path_new), "%s.new", SNMP_PATH);
-  if ((fp1 = fopen(snmp_path_new, "w")) == NULL) {
-    DPRINTF(("[SysAPI] failed to open new snmp configuration file\n"));
-    return 1;
-  }
-  snprintf(ts_snmp_path_new, sizeof(ts_snmp_path_new), "%s.new", ts_snmp_path);
-  if ((fp1_ts = fopen(ts_snmp_path_new, "w")) == NULL) {
-    DPRINTF(("[SysAPI] failed to open new ts snmp configuration file\n"));
-    return 1;
-  }
-  //first handle the Linux snmp
-  buf[0] = 0;                   /* lv: == strcpy(buf, ""); */
-  NOWARN_UNUSED_RETURN(fgets(buf, sizeof(buf), fp));
-
-  while (!feof(fp)) {
-    if (!isLineCommented(buf)) {
-      if ((strncasecmp(buf, "syslocation", 11) == 0) && (sys_location != NULL)) {
-        fprintf(fp1, "syslocation %s\n", sys_location);
-        sys_location_flag = true;
-      } else if ((strncasecmp(buf, "syscontact", 10) == 0) && (sys_contact != NULL)) {
-        fprintf(fp1, "syscontact %s\n", sys_contact);
-        sys_contact_flag = true;
-      } else if ((strncasecmp(buf, "sysName", 7) == 0) && (sys_name != NULL)) {
-        fprintf(fp1, "sysname %s\n", sys_name);
-        sys_name_flag = true;
-      } else if ((strncasecmp(buf, "authtrapenable", 14) == 0) && (authtrapenable != NULL)) {
-        fprintf(fp1, "authtrapenable %s\n", authtrapenable);
-        authtrapenable_flag = true;
-      } else if ((strncasecmp(buf, "com2sec", 7) == 0) && (trap_community != NULL)) {
-        fprintf(fp1, "com2sec notConfigUser default %s\n", trap_community);
-        trap_community_flag = true;
-      } else if ((strncasecmp(buf, "trapsink", 8) == 0) && (trap_host != NULL)) {
-        fprintf(fp1, "trapsink %s\n", trap_host);
-        trap_host_flag = true;
-      } else                    // leave the old value as it is
-        fputs(buf, fp1);
-    } else {                    //if isLineCommented
-      fputs(buf, fp1);          //only in case of a comment
-    }
-    NOWARN_UNUSED_RETURN(fgets(buf, sizeof(buf), fp));
-  }
-
-  //now check which of the options is not set, and set it...
-  if ((!sys_location_flag) && (sys_location != NULL))
-    fprintf(fp1, "syslocation %s\n", sys_location);
-  if ((!sys_contact_flag) && sys_contact != NULL)
-    fprintf(fp1, "syscontact %s\n", sys_contact);
-  if ((!sys_name_flag) && sys_name != NULL)
-    fprintf(fp1, "sysname %s\n", sys_name);
-  if ((!authtrapenable_flag) && (authtrapenable != NULL))
-    fprintf(fp1, "authtrapenable %s\n", authtrapenable);
-  if ((!trap_community_flag) && (trap_community != NULL))
-    fprintf(fp1, "com2sec notConfigUser default %s\n", trap_community);
-  if ((!trap_host_flag) && (trap_host != NULL))
-    fprintf(fp1, "trapsink %s\n", trap_host);
-  fclose(fp);
-  fclose(fp1);
-
-  //now handle TS snmp
-  buf[0] = 0;
-  NOWARN_UNUSED_RETURN(fgets(buf, sizeof(buf), fp_ts));
-  while (!feof(fp_ts)) {
-    if (!isLineCommented(buf)) {
-      if ((strncasecmp(buf, "sysLocation", 11) == 0) && (sys_location != NULL)) {
-        fprintf(fp1_ts, "sysLocation %s\n", sys_location);
-        sys_location_flag = true;
-      } else if ((strncasecmp(buf, "sysContact", 10) == 0) && (sys_contact != NULL)) {
-        fprintf(fp1_ts, "sysContact %s\n", sys_contact);
-        sys_contact_flag = true;
-      } else if ((strncasecmp(buf, "sysName", 7) == 0) && (sys_name != NULL)) {
-        fprintf(fp1_ts, "sysName %s\n", sys_name);
-        sys_name_flag = true;
-      } else if ((strncasecmp(buf, "snmpEnableAuthenTraps", 21) == 0) && (authtrapenable != NULL)) {
-        fprintf(fp1_ts, "snmpEnableAuthenTraps %s\n", authtrapenable);
-        authtrapenable_flag = true;
-      } else if ((strncasecmp(buf, "snmpCommunityEntry", 18) == 0) && (trap_community != NULL)) {
-        fprintf(fp1_ts, "snmpCommunityEntry t0000000 %s public localSnmpID - - nonVolatile\n", trap_community);
-        trap_community_flag = true;
-      } else if ((strncasecmp(buf, "snmpTargetAddrEntry", 19) == 0) && (trap_host != NULL)) {
-        tmp1[0] = 0;
-        int i = 0;
-        tmp = strtok(buf, "  ");
-        strncat(tmp1, tmp, (sizeof(tmp1) - strlen(tmp1) - 1));
-        strncat(tmp1, " ", (sizeof(tmp1) - strlen(tmp1) - 1));
-        while ((tmp = strtok(NULL, "  ")) != NULL) {
-          i++;
-          if (i != 3) {
-            strncat(tmp1, tmp, (sizeof(tmp1) - strlen(tmp1) - 1));
-            strncat(tmp1, " ", (sizeof(tmp1) - strlen(tmp1) - 1));
-          } else {
-            strncat(tmp1, trap_host, (sizeof(tmp1) - strlen(tmp1) - 1));
-            strncat(tmp1, ":0 ", (sizeof(tmp1) - strlen(tmp1) - 1));
-          }
-        }
-        fprintf(fp1_ts, "%s", tmp1);
-        trap_host_flag = true;
-      } else                    // leave the old value as it is
-        fputs(buf, fp1_ts);
-    } else {                    //if isLineCommented
-      fputs(buf, fp1_ts);       //only in case of a comment
-    }
-    NOWARN_UNUSED_RETURN(fgets(buf, sizeof(buf), fp_ts));
-  }
-
-  //now check which of the options is not set, and set it...
-  if ((!sys_location_flag) && (sys_location != NULL))
-    fprintf(fp1_ts, "sysLocation %s\n", sys_location);
-  if ((!sys_contact_flag) && sys_contact != NULL)
-    fprintf(fp1_ts, "sysContact %s\n", sys_contact);
-  if ((!sys_name_flag) && sys_name != NULL)
-    fprintf(fp1_ts, "sysName %s\n", sys_name);
-  if ((!authtrapenable_flag) && (authtrapenable != NULL))
-    fprintf(fp1_ts, "snmpEnableAuthenTraps %s\n", authtrapenable);
-  if ((!trap_community_flag) && (trap_community != NULL))
-    fprintf(fp1_ts, "snmpCommunityEntry t0000000 %s public localSnmpID - - nonVolatile\n ", trap_community);
-  //if ((!trap_host_flag) &&(trap_host!=NULL)) - This can't be added as it is ID dependant
-  fclose(fp_ts);
-  fclose(fp1_ts);
-
-  if ((pid = fork()) < 0) {
-    exit(1);
-  } else if (pid > 0) {
-    wait(&status);
-    {
-      // Determine wheel's GID.
-      struct group *gr;
-      int wheel_gid = 0;
-      setgrent();
-      while ((gr = getgrent()) != NULL) {
-        if (!strcasecmp(gr->gr_name, "wheel")) {
-          wheel_gid = gr->gr_gid;
-          break;
-        }
-      }
-      endgrent();
-      chmod(snmp_path, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH);
-      // cast type in order to get rid of compiling error. disable coverity check here
-      // coverity[cast_to_qualified_type]
-      if (chown(snmp_path, (uid_t) -1, wheel_gid) == -1) {
-        DPRINTF(("[SysAPI] can not chown new ts_snmp cfg file\n"));
-      }
-    }
-  } else {
-    int res;
-    res = execl(mv_binary, "mv", snmp_path_new, snmp_path, (char*)NULL);
-    if (res != 0) {
-      DPRINTF(("[SysAPI] mv of new snmp cfg file failed\n"));
-    }
-    _exit(res);
-  }
-
-  if ((pid = fork()) < 0) {
-    exit(1);
-  } else if (pid > 0) {
-    wait(&status);
-  } else {
-    int res;
-    res = execl(mv_binary, "mv", ts_snmp_path_new, ts_snmp_path, (char*)NULL);
-    if (res != 0) {
-      DPRINTF(("[SysAPI] mv of new ts_snmp cfg file failed\n"));
-    }
-    _exit(res);
-  }
-
-  //now we need to change snmppass.sh or the community strings won't match
-
-  char community_string[1024], snmp_pass[1024], snmp_pass_new[1024];
-  const char *community1 = "result=`$COMMAND $VERSION -O fn -p $PORT localhost";
-  const char *community2 = "$OID.0`;";
-
-  if (trap_community != NULL) {
-    snprintf(community_string, sizeof(community_string), "%s %s %s\n", community1, trap_community, community2);
-
-    //now open the file for modification.
-    Layout::relative_to(snmp_pass, sizeof(snmp_pass),
-                        Layout::get()->bindir, "snmppass.sh");
-    if ((snmppass_fp = fopen(snmp_pass, "r")) == NULL) {
-      if ((fp = fopen(snmp_pass, "a+")) == NULL) {
-        DPRINTF(("[SysAPI] failed to open ts snmp script file\n"));
-        return 1;
-      }
-      fclose(fp);
-    }
-    snprintf(snmp_pass_new, sizeof(snmp_pass_new), "%s.new", snmp_pass);
-    if ((snmppass_fp1 = fopen(snmp_pass_new, "w")) == NULL) {
-      DPRINTF(("[SysAPI] failed to open new snmp script file\n"));
-      return 1;
-    }
-
-    buf[0] = 0;
-    NOWARN_UNUSED_RETURN(fgets(buf, 1024, snmppass_fp));
-    while (!feof(snmppass_fp)) {
-      if (!isLineCommented(buf)) {
-        if (strncasecmp(buf, "result=", 7) == 0) {
-          fprintf(snmppass_fp1, "%s\n", community_string);
-        } else                  // leave the old value as it is
-          fputs(buf, snmppass_fp1);
-      } else {                  //if isLineCommented
-        fputs(buf, snmppass_fp1);       //only in case of a comment
-      }
-      NOWARN_UNUSED_RETURN(fgets(buf, 1024, snmppass_fp));
-    }
-    fclose(snmppass_fp);
-    fclose(snmppass_fp1);
-
-
-    if ((pid = fork()) < 0) {
-      exit(1);
-    } else if (pid > 0) {
-      wait(&status);
-    } else {
-      int res;
-      res = execl(mv_binary, "mv", snmp_pass_new, snmp_pass, (char*)NULL);
-      if (res != 0) {
-        DPRINTF(("[SysAPI] mv of new snmpass.sh file failed\n"));
-      }
-      _exit(res);
-    }
-    //now change the file permissions BZ50331
-    int flag_status;
-    flag_status = chmod(snmp_pass, S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IWGRP | S_IXGRP | S_IROTH | S_IXOTH);
-    if (flag_status)
-      DPRINTF(("[SYSAPI]: Failed to change permissions of snmpass.sh\n"));
-  }
-
-  return 0;
-}
-
-
-int
-Net_SNMPSetUp(char *sys_location, char *sys_contact, char *sys_name, char *authtrapenable, char *trap_community,
-              char *trap_host)
-{
-  int status;
-  pid_t pid;
-
-  DPRINTF(("Net_SNMPSetUp: sys_location: %s, sys_contact: %s, sys_name: %s, authtrapenable: %s, trap_community: %s, trap_host: %s\n", sys_location, sys_contact, sys_name, authtrapenable, trap_community, trap_host));
-
-  status = setSNMP(sys_location, sys_contact, sys_name, authtrapenable, trap_community, trap_host);
-  if (status) {
-    DPRINTF(("Net_SNMPSetUp: NetConfig_Action returned %d\n", status));
-    return status;
-  }
-  //now we need to stop and start snmp daemons. We assume encapsulation so we can use TS snmp script
-  if ((pid = fork()) < 0) {
-    exit(1);
-  } else if (pid > 0) {
-    //wait(&status);
-  } else {
-    int res;
-
-    char command_path[512];
-
-    snprintf(command_path, sizeof(command_path),
-             "%s/stop_snmp && %s/start_snmp",
-             Layout::get()->bindir, Layout::get()->bindir);
-
-    sleep(30);
-    char *argv[] = { NULL };
-    res = execv(command_path, argv);
-
-    if (res != 0) {
-      DPRINTF(("[SysAPI] failed to execute stop_snmp && start_snmp\n"));
-    }
-    _exit(res);
-  }
-
-  return status;
-}
 
 //location - 1 is always the location of the named parameter in the buffer
 int
@@ -1691,7 +1382,6 @@ Get_Value(char *buffer, size_t buffer_le
       *ptr = '\0';
     return 0;
   }
-  // Fix for bz50331 - read in quotes from SNMP files
   while ((tmp_buffer = strtok(NULL, " ")) != NULL) {
     if (tmp_buffer[0] == '"') {
       ink_strncpy(buffer, tmp_buffer, buffer_len);
@@ -1714,69 +1404,6 @@ Get_Value(char *buffer, size_t buffer_le
 }
 
 
-// we are assuming ts snmp configuration is identical to the Linux one, therefore, we will retrieve the info from TS snmp config file
-int
-Net_SNMPGetInfo(char *sys_location, size_t sys_location_len, char *sys_contact, size_t sys_contact_len, char *sys_name,
-                size_t sys_name_len, char *authtrapenable, size_t authtrapenable_len, char *trap_community,
-                size_t trap_community_len, char *trap_host, size_t trap_host_len)
-{
-  char *snmp_config, buf[1024];
-  FILE *fp;
-  int status;
-
-  snmp_config = Layout::relative_to(Layout::get()->sysconfdir, "snmpd.conf");
-  if ((fp = fopen(snmp_config, "r")) == NULL && (fp = fopen(snmp_config, "a+")) == NULL) {
-    DPRINTF(("[SysAPI] failed to open ts snmp script file %s\n", snmp_config));
-    xfree(snmp_config);
-    return 1;
-  }
-  xfree(snmp_config);
-
-  NOWARN_UNUSED_RETURN(fgets(buf, 1024, fp));
-  while (!feof(fp)) {
-    if (!isLineCommented(buf)) {
-      if (strncasecmp(buf, "sysLocation", 11) == 0) {
-        status = Get_Value(sys_location, sys_location_len, buf, 2);
-        if (status) {           //this means we didn't find the value - set it to NULL
-          sys_location[0] = '\0';
-        }
-      } else if (strncasecmp(buf, "syscontact", 10) == 0) {
-        status = Get_Value(sys_contact, sys_contact_len, buf, 2);
-        if (status) {
-          sys_contact[0] = '\0';
-        }
-      } else if (strncasecmp(buf, "sysName", 7) == 0) {
-        status = Get_Value(sys_name, sys_name_len, buf, 2);
-        if (status) {
-          sys_name[0] = '\0';
-        }
-      } else if (strncasecmp(buf, "snmpEnableAuthenTraps", 21) == 0) {
-        status = Get_Value(authtrapenable, authtrapenable_len, buf, 2);
-        if (status) {
-          authtrapenable[0] = '\0';
-        }
-      } else if (strncasecmp(buf, "snmpCommunityEntry", 18) == 0) {
-        status = Get_Value(trap_community, trap_community_len, buf, 3);
-        if (status) {
-          trap_community[0] = '\0';
-        }
-      } else if (strncasecmp(buf, "snmpTargetAddrEntry", 19) == 0) {
-        status = Get_Value(trap_host, trap_host_len, buf, 4);
-        if (status) {
-          trap_host[0] = '\0';
-        } else {
-          char *trap_temp = strtok(trap_host, ":");
-          ink_strncpy(trap_host, trap_temp, trap_host_len);
-        }
-      }
-    }
-    NOWARN_UNUSED_RETURN(fgets(buf, 1024, fp));
-  }
-
-  fclose(fp);
-  return 0;
-}
-
 #endif /* defined(linux) || defined(freebsd) || defined(darwin) */
 
 #if defined(solaris)

Modified: trafficserver/traffic/trunk/proxy/mgmt2/tools/SysAPI.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/tools/SysAPI.h?rev=998224&r1=998223&r2=998224&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/tools/SysAPI.h (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/tools/SysAPI.h Fri Sep 17 17:49:21 2010
@@ -76,11 +76,6 @@ extern int Time_GetNTP_Status(char *stat
 extern int Time_SetNTP_Off(void);
 extern int Net_GetSMTP_Server(char *server);
 extern int Net_SetSMTP_Server(char *server);
-extern int Net_SNMPSetUp(char *sys_location, char *sys_contact, char *sys_name, char *authtrapenable,
-                         char *trap_community, char *trap_host);
-extern int Net_SNMPGetInfo(char *sys_location, size_t sys_location_len, char *sys_contact, size_t sys_contact_len,
-                           char *sys_name, size_t sys_name_len, char *authtrapenable, size_t authtrapenable_len,
-                           char *trap_community, size_t trap_community_len, char *trap_host, size_t trap_host_len);
 extern int Sys_User_Root(int *old_euid);
 extern int Sys_User_Inktomi(int euid);
 extern int Sys_Grp_Root(int *old_egid);

Modified: trafficserver/traffic/trunk/proxy/mgmt2/utils/WebMgmtUtils.h
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/utils/WebMgmtUtils.h?rev=998224&r1=998223&r2=998224&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/utils/WebMgmtUtils.h (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/utils/WebMgmtUtils.h Fri Sep 17 17:49:21 2010
@@ -110,11 +110,12 @@ int processSpawn(const char *args[],
 void computeXactMax();
 void appendDefaultDomain(char *hostname, int bufLength);
 
-// Some scaling constants for SNMP
+// Some scaling constants
 #define BYTES_TO_MB_SCALE (1/(1024*1024.0))
 #define MBIT_TO_KBIT_SCALE (1000.0)
 #define SECOND_TO_MILLISECOND_SCALE (1000.0)
 #define PCT_TO_INTPCT_SCALE (100.0)
+
 void AgInt_generic_scale(char *processVar, char *nodeVar, double factor);
 void AgFloat_generic_scale_to_int(const char *processVar, const char *nodeVar, double factor);
 

Modified: trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttpRender.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttpRender.cc?rev=998224&r1=998223&r2=998224&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttpRender.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/web2/WebHttpRender.cc Fri Sep 17 17:49:21 2010
@@ -2771,16 +2771,9 @@ handle_network_object(WebHttpContext * w
   return WEB_HTTP_ERR_OKAY;
 }
 
-
-
-
-//handle_snmp
-
-
 //-------------------------------------------------------------------------
 // WebHttpRenderInit
 //-------------------------------------------------------------------------
-
 void
 WebHttpRenderInit()
 {

Modified: trafficserver/traffic/trunk/proxy/mgmt2/web2/WebOverview.cc
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/proxy/mgmt2/web2/WebOverview.cc?rev=998224&r1=998223&r2=998224&view=diff
==============================================================================
--- trafficserver/traffic/trunk/proxy/mgmt2/web2/WebOverview.cc (original)
+++ trafficserver/traffic/trunk/proxy/mgmt2/web2/WebOverview.cc Fri Sep 17 17:49:21 2010
@@ -2234,7 +2234,6 @@ overviewPage::doClusterAg()
   // FIXME
   clusterAgFloat("proxy.cluster.user_agent_xacts_per_second", "proxy.node.user_agent_xacts_per_second");
 
-  // This is here for benefit of SNMP.
   AgFloat_generic_scale_to_int("proxy.cluster.client_throughput_out",
                                "proxy.cluster.client_throughput_out_kbit", MBIT_TO_KBIT_SCALE);
   AgFloat_generic_scale_to_int("proxy.cluster.http.cache_hit_ratio",

Modified: trafficserver/traffic/trunk/test/plugin/test-mgmt/test-mgmt.c
URL: http://svn.apache.org/viewvc/trafficserver/traffic/trunk/test/plugin/test-mgmt/test-mgmt.c?rev=998224&r1=998223&r2=998224&view=diff
==============================================================================
--- trafficserver/traffic/trunk/test/plugin/test-mgmt/test-mgmt.c (original)
+++ trafficserver/traffic/trunk/test/plugin/test-mgmt/test-mgmt.c Fri Sep 17 17:49:21 2010
@@ -267,7 +267,6 @@ const char *intVariables[] = {
   "proxy.config.update.retry_count",
   "proxy.config.update.retry_interval",
   "proxy.config.update.concurrent_updates",
-  "proxy.config.snmp.master_agent_enabled",
   "proxy.config.diags.debug.enabled",
   "proxy.config.diags.action.enabled",
   "proxy.config.diags.show_location",