Index: /branches/rel_apv_10_7/usr/src/sys/click/app/sdns/monitor.h
===================================================================
--- /branches/rel_apv_10_7/usr/src/sys/click/app/sdns/monitor.h	(revision 38127)
+++ /branches/rel_apv_10_7/usr/src/sys/click/app/sdns/monitor.h	(working copy)
@@ -14,6 +14,32 @@
 	MONITOR_TYPE_HTTPS,
 	MONITOR_TYPE_MAX
 };
+/*sdns status reasons*/
+#define UNKNOWN_CAUSE_DOWN               0
+#define CONN_FAILED_DOWN                 1
+#define CONN_TIMED_OUT_DOWN              2
+#define NETWORK_DOWN                     3
+#define NETWORK_UNREACH_DOWN             4
+#define HTTP_WRITE_FAILED_DOWN           5
+#define HTTP_READ_FAILED_DOWN            6
+#define HTTP_RESP_UNMATCH_DOWN           7
+#define HTTP_RESP_TIMED_OUT_DOWN         8
+
+#define ICMP_UNKNOWN_CAUSE_DOWN          9
+#define ICMP_CONN_FAILED_DOWN            10
+#define ICMP_CONN_TIMED_OUT_DOWN         11
+
+#define TCP_UNKNOWN_CAUSE_DOWN           12
+#define TCP_CONN_FAILED_DOWN             13
+#define TCP_CONN_TIMED_OUT_DOWN          14
+
+#define HTTP_UNKNOWN_CAUSE_DOWN          15
+#define HTTP_CONN_FAILED_DOWN            16
+#define HTTP_CONN_TIMED_OUT_DOWN         17
+
+#define HTTPS_UNKNOWN_CAUSE_DOWN         18
+#define HTTPS_CONN_FAILED_DOWN           19
+#define HTTPS_CONN_TIMED_OUT_DOWN        20
 
 /*
  * monitor instance status
@@ -200,6 +226,7 @@
 extern int all_monitor_count;
 extern int monitor_count[MONITOR_TYPE_MAX];
 extern int all_monitor_instance_count;
+extern const char *condition_description[];
 
 #define WRITE_ICMP_MONITORS_LEN	\
 	(monitor_count[MONITOR_TYPE_ICMP] * (sizeof("sdns monitor icmp \"\"\n") +	\
@@ -283,6 +310,7 @@
 	click_ip_t mi_dst_addr;
 	uint8_t mi_key[MAX_INSTANCE_KEY_LEN + 1];
 	int mi_status;
+        uint8_t cause_of_condition;
 
 	monitor_base_t *mi_monitor;
 	struct monitor_instance * mi_primary;
Index: /branches/rel_apv_10_7/usr/src/sys/click/app/sdns/monitor.c
===================================================================
--- /branches/rel_apv_10_7/usr/src/sys/click/app/sdns/monitor.c	(revision 38127)
+++ /branches/rel_apv_10_7/usr/src/sys/click/app/sdns/monitor.c	(working copy)
@@ -47,7 +47,33 @@
 	MONITORD_LOG_ERROR,
 	MONITORD_LOG_FATAL,
 };
-
+const char *condition_description[] = {
+    "Unknown cause",              /* index 0  <-> UNKNOWN_CAUSE */
+    "Connection failed",          /* index 1  <-> CONN_FAILED_DOWN */
+    "Connection timed out",       /* index 2  <-> CONN_TIMED_OUT_DOWN */
+    "Network is down",            /* index 3  <-> NETWORK_DOWN */
+    "Network is unreachable",     /* index 4  <-> NETWORK_UNREACH_DOWN */
+    "Http write failed",          /* index 5  <-> HTTP_WRITE_FAILED_DOWN */
+    "Http read failed",           /* index 6  <-> HTTP_READ_FAILED_DOWN */
+    "Http response unmatch",      /* index 7  <-> HTTP_RESP_UNMATCH_DOWN */
+    "Http response timed out",    /* index 8  <-> HTTP_RESP_TIMED_OUT_DOWN */
+
+    "ICMP Unknown cause",         /* index 9  <-> ICMP_UNKNOWN_CAUSE_DOWN */
+    "ICMP Connection failed",      /* index 10 <-> ICMP_CONN_FAILED_DOWN */
+    "ICMP Connection timed out",   /* index 11 <-> ICMP_CONN_TIMED_OUT_DOWN */
+
+    "TCP Unknown cause",          /* index 12 <-> TCP_UNKNOWN_CAUSE_DOWN */
+    "TCP Connection failed",       /* index 13 <-> TCP_CONN_FAILED_DOWN */
+    "TCP Connection timed out",    /* index 14 <-> TCP_CONN_TIMED_OUT_DOWN */
+
+    "HTTP Unknown cause",         /* index 15 <-> HTTP_UNKNOWN_CAUSE_DOWN */
+    "HTTP Connection failed",      /* index 16 <-> HTTP_CONN_FAILED_DOWN */
+    "HTTP Connection timed out",   /* index 17 <-> HTTP_CONN_TIMED_OUT_DOWN */
+
+    "HTTPS Unknown cause",        /* index 18 <-> HTTPS_UNKNOWN_CAUSE_DOWN */
+    "HTTPS Connection failed",     /* index 19 <-> HTTPS_CONN_FAILED_DOWN */
+    "HTTPS Connection timed out",  /* index 20 <-> HTTPS_CONN_TIMED_OUT_DOWN */
+};
 uint8_t compressed_char_map[256] = {
 	0, 0, 0, 0, 0, 0, 0, 0,    0, 0, 0, 0, 0, 0, 0, 0, 
 	0, 0, 0, 0, 0, 0, 0, 0,    0, 0, 0, 0, 0, 0, 0, 0, 
@@ -713,16 +739,19 @@
 			click_ntop(&mi->mi_dst_addr, ipstr, sizeof(ipstr));
 			switch (mi->mi_monitor->mb_type) {
 				case MONITOR_TYPE_ICMP:
-					sprintf(sevstr,"icmp %s", ipstr);					
-					break;
+					sprintf(sevstr,"icmp %s", ipstr);
+                                        mi->cause_of_condition = (mi_status == MI_STATUS_DOWN) ? ICMP_CONN_FAILED_DOWN : UNKNOWN_CAUSE_DOWN;				                        		break;
 				case MONITOR_TYPE_TCP:
 					sprintf(sevstr,"tcp %s[%d]", ipstr,((tcp_monitor_instance_t *)mi)->tmi_port);
+                                        mi->cause_of_condition = (mi_status == MI_STATUS_DOWN) ? TCP_CONN_FAILED_DOWN : UNKNOWN_CAUSE_DOWN;
 					break;				
 				case MONITOR_TYPE_HTTP:
 					sprintf(sevstr,"http %s[%d]", ipstr,((http_monitor_instance_t *)mi)->hmi_port);
+                                        mi->cause_of_condition = (mi_status == MI_STATUS_DOWN) ? HTTP_CONN_FAILED_DOWN : UNKNOWN_CAUSE_DOWN;
 					break;		
 				case MONITOR_TYPE_HTTPS:
 					sprintf(sevstr,"https %s[%d]", ipstr,((http_monitor_instance_t *)mi)->hmi_port);
+                                        mi->cause_of_condition = (mi_status == MI_STATUS_DOWN) ? HTTPS_CONN_FAILED_DOWN : UNKNOWN_CAUSE_DOWN;
 					break;		
 				default:
 					return -2;			
Index: /branches/rel_apv_10_7/usr/src/sys/click/app/sdns/sdns_service.c
===================================================================
--- /branches/rel_apv_10_7/usr/src/sys/click/app/sdns/sdns_service.c	(revision 38127)
+++ /branches/rel_apv_10_7/usr/src/sys/click/app/sdns/sdns_service.c	(working copy)
@@ -509,6 +509,10 @@
 		}
 		app_printf(pcb, "%-17s%-10s\n", "    Monitor:", mi->mi_monitor->mb_name);
 		app_printf(pcb, "%-17s%-10s\n", "    Status:", mi_status_to_string(mi->mi_status));
+                if (mi->mi_status == MI_STATUS_DOWN) {
+                    app_printf(pcb, "%-17s%-10s\n", "    Status Reason:", condition_description[mi->cause_of_condition]);
+                }
+
 		app_printf(pcb, "%-17s%-10s\n", "    Type:", mb_type_to_string(mi->mi_monitor->mb_type));
 		app_printf(pcb, "%-17s%-10s\n", "    Address:",
 				click_ntop(&mi->mi_dst_addr, ipstr, sizeof(ipstr)));
