Browse Source

AMBARI-19243 : Metric monitor start command failed though the process started successfully. (avijayan)

Aravindan Vijayan 8 years ago
parent
commit
eaa57846aa

+ 5 - 4
ambari-metrics/ambari-metrics-host-monitoring/conf/unix/ambari-metrics-monitor

@@ -131,7 +131,7 @@ case "$1" in
     echo "Checking for previously running Metric Monitor..."
     if [ -f ${PIDFILE} ]; then
       PID=`cat ${PIDFILE}`
-      if [ -z "`ps ax | grep -w ${PID} | grep resource_monitoring`" ]; then
+      if [ -z "`ps ax -o pid | grep -w ${PID}`" ]; then
         echo "${PIDFILE} found with no process. Removing ${PID}..."
         rm -f ${PIDFILE}
       else
@@ -151,8 +151,9 @@ case "$1" in
 
     sleep 2
 
-    echo "Verifying ${METRIC_MONITOR} process status..."
-    if [ -z "`ps ax | grep -w ${PID} | grep resource_monitoring`" ]; then
+    echo "Verifying ${METRIC_MONITOR} process status with PID : ${PID}"
+    if [ -z "`ps ax -o pid | grep -w ${PID}`" ]; then
+      echo "Output of PID check : `ps ax -o pid | grep -w ${PID}`"
       if [ -s ${OUTFILE} ]; then
         echo "ERROR: ${METRIC_MONITOR} start failed. For more details, see ${OUTFILE}:"
         echo "===================="
@@ -173,7 +174,7 @@ case "$1" in
     if [ -f ${PIDFILE} ]; then
       PID=`cat ${PIDFILE}`
       echo "Found ${METRIC_MONITOR} PID: $PID"
-      if [ -z "`ps ax | grep -w ${PID} | grep resource_monitoring`" ]; then
+      if [ -z "`ps ax -o pid | grep -w ${PID}`" ]; then
         echo "${METRIC_MONITOR} not running. Stale PID File at: $PIDFILE"
         retcode=2
       else

+ 1 - 1
ambari-metrics/ambari-metrics-host-monitoring/src/main/python/core/host_info.py

@@ -191,7 +191,7 @@ class HostInfo():
       try:
         usage = psutil.disk_usage(part.mountpoint)
       except Exception, e:
-        logger.error('Failed to read disk_usage for a mountpoint : ' + str(e))
+        logger.debug('Failed to read disk_usage for a mountpoint : ' + str(e))
         continue
 
       if part.device in devices: # Skip devices already seen.