Index: /branches/rel_avx_2_7_5/src/backend/sys_cmd.c
===================================================================
--- /branches/rel_avx_2_7_5/src/backend/sys_cmd.c	(revision 9152)
+++ /branches/rel_avx_2_7_5/src/backend/sys_cmd.c	(working copy)
@@ -1421,6 +1421,41 @@
 	}
     return 0;
 }
+int
+battery_status_warn()
+{
+	FILE *stream = NULL;
+        char cmd[128] = {0};
+        char buf[256] = {0};
+        char unit[50] = {0};
+        char status[50] = {0};
+        char states_asserted[100] = {0};
+
+        sprintf(cmd, "ipmitool -c sensor get RTC_BATTERY VBAT 2>/dev/null");
+        stream = popen(cmd, "r");
+        if (stream == NULL) {
+                return -1;
+        }
+        while (fgets(buf, sizeof(buf), stream) != NULL) {
+                if (strstr(buf, "not found") || strstr(buf, "Locating sensor")) { continue; }
+                if (strncmp(buf, "VBAT", sizeof("VBAT")-1)==0 || strncmp(buf, "RTC_BATTERY", sizeof("RTC_BATTERY")-1)==0)
+              {
+                     sscanf(buf,"%*49[^,],%*49[^,],%49[^,],%49[^,],%99[^\n]", unit, status, states_asserted);
+              }
+        }
+
+       pclose(stream);
+       if (strncmp(unit, "Volts", sizeof("Volts")-1)==0) {
+               if (strncmp(status, "ok", 2) != 0) {
+                     printf("Battery is %s\n", status);
+               }
+       } else {
+               if (strstr(states_asserted, "Low") || strstr(states_asserted, "Fail")) {
+                     printf("Battery is %s\n", states_asserted);
+               }
+       }
+       return 0;
+}
 
 int
 show_system_warn(void)
@@ -1489,6 +1524,7 @@
 			}
 		}		
     }
+        battery_status_warn();
 
 	if (PROPERTY_AVX_MODEL == AFM_MODEL_6850_AVX || PROPERTY_AVX_MODEL == AFM_MODEL_7850_AVX) {
 		show_X11SPL_F_warn();
Index: /branches/rel_avx_2_7_5/src/monitord/avx_monitor.c
===================================================================
--- /branches/rel_avx_2_7_5/src/monitord/avx_monitor.c	(revision 9151)
+++ /branches/rel_avx_2_7_5/src/monitord/avx_monitor.c	(working copy)
@@ -78,6 +78,7 @@
 	int         id;   // device index
 } avx_mon_struct_t;
 
+static int battery_previous_status = 0;
 static avx_mon_struct_t avx_ms[] = {
 	{"CPU FAN1",	0,	{LOG_IDX_MONITOR_CPU_FAN_FAIL, LOG_IDX_MONITOR_CPU_FAN_FAIL_RECOVER},	1,	1},
 	{"CPU FAN2",	0,	{LOG_IDX_MONITOR_CPU_FAN_FAIL, LOG_IDX_MONITOR_CPU_FAN_FAIL_RECOVER},	1,	2},
@@ -282,6 +283,59 @@
 	
 }
 
+int
+read_battery_status()
+{
+        FILE *stream = NULL;
+        char cmd[128] = {0};
+        char buf[256] = {0};
+        char unit[50] = {0};
+	char status[50] = {0};
+	char states_asserted[100] = {0};
+
+	int current_status=0;
+        sprintf(cmd, "ipmitool -c sensor get RTC_BATTERY VBAT 2>/dev/null");
+        stream = popen(cmd, "r");
+        if (stream == NULL) {
+                syslog(LOG_ERR, "read_battery_status popen failed, errno:%d", errno);
+                return -1;
+        }
+        while (fgets(buf, sizeof(buf), stream) != NULL) {
+                if (strstr(buf,"not found") || strstr(buf,"Locating sensor")) { continue; }
+                if (strncmp(buf,"VBAT",sizeof("VBAT")-1)==0 || strncmp(buf,"RTC_BATTERY", sizeof("RTC_BATTERY")-1)==0)
+              {
+                     sscanf(buf,"%*49[^,],%*49[^,],%49[^,],%49[^,],%99[^\n]", unit, status, states_asserted);
+              }
+       }
+       pclose(stream);
+       if (unit[0] == '\0') { return -1; }
+       if (strncmp(unit, "Volts", sizeof("Volts")-1)==0) {
+               if (strncmp(status, "ok", 2) ==0) {
+	           current_status = 0;
+               } else {
+                   current_status = -1;
+               }
+	
+       } else {
+           if (strstr(states_asserted,"Low") || strstr(states_asserted,"Fail")) {
+               current_status = -1;
+           } else {
+               current_status = 0;
+           }
+      }
+
+      if (battery_previous_status == current_status) { return 0; }
+
+      battery_previous_status = current_status; 
+      if (current_status == 0) { 
+	  avx_log(LOG_IDX_MONITOR_BATTERY_LOW_RECOVER, 0); 
+      }
+      else {
+	  avx_log(LOG_IDX_MONITOR_BATTERY_LOW, 0);
+      }
+      return 0;
+}
+
 static int
 avx_helper(int fd)
 {
@@ -352,7 +406,7 @@
 				} else {
 					avx_log(avx_ms[i].logid[1], avx_ms[i].argn, avx_ms[i].id);
 				}
-			}
+			}	
 			i++;
 
 			/* there is the abnormal ,set fault led on,some hard status is unknow*/
@@ -361,7 +415,7 @@
 			}
 		}
 	}
-	
+
 	ret = 0;
 
 cleanup:
@@ -379,7 +433,7 @@
 		}
 		system(cmd);
 	}
-
+        read_battery_status();
 	fclose(fp);
 	return ret;
 }
