Jelajahi Sumber

AMBARI-6913. A lot of Ganglia metrics are absent on UI on Centos 5.9 (aonishuk)

Andrew Onishuk 11 tahun lalu
induk
melakukan
0116db8d5e

+ 9 - 1
ambari-server/src/main/resources/stacks/HDP/2.0.6/services/GANGLIA/package/templates/rrd.py.j2

@@ -18,6 +18,9 @@ See the License for the specific language governing permissions and
 limitations under the License.
 '''
 
+# NOTE: This script is executed by Python 2.4 on Centos 5. 
+# Make sure your changes are compatible.
+
 import cgi
 import glob
 import os
@@ -109,7 +112,12 @@ def collectStatMetrics(clusterName, hostName, metricName, files, cf, start, end,
     if timestamp is None and stepsize is None and concreteMetricName is None:
       timestamp = rrdMetric[0][0]
       stepsize = rrdMetric[0][2]
-      suffix = metricStat if not isRate else '_rate.' + metricStat
+      
+      if not isRate:
+        suffix = metricStat
+      else:
+        suffix = '_rate.' + metricStat
+      
       concreteMetricName = file.split(os.sep).pop().replace('rrd', suffix)
 
     metricValues = rrdMetric[2]