Index: /branches/rel_apv_10_7/usr/click/bin/debug_monitor/monitor.sh
===================================================================
--- /branches/rel_apv_10_7/usr/click/bin/debug_monitor/monitor.sh	(revision 38689)
+++ /branches/rel_apv_10_7/usr/click/bin/debug_monitor/monitor.sh	(working copy)
@@ -267,6 +267,8 @@
         echo "/ca/bin/backend -c \"show statistics system\"" >> $output_file
         /ca/bin/backend -c "show statistics system"`echo -e "\\0374"` | sed "s/`echo -e \\"\\0374\\"`//g" >> $output_file
         echo -e "\n" >> $output_file 
+# insert data into database of system interface
+    /usr/local/bin/python /ca/webui/htdocs/new/src/hive/monitor_log/write_monitor_to_db.py systeminterface
 
 #tcp statistics info
 	timestamp_gen $output_file
Index: /branches/rel_apv_10_7/usr/click/webui/htdocs/new/src/hive/monitor_log/write_monitor_to_db.py
===================================================================
--- /branches/rel_apv_10_7/usr/click/webui/htdocs/new/src/hive/monitor_log/write_monitor_to_db.py	(revision 38689)
+++ /branches/rel_apv_10_7/usr/click/webui/htdocs/new/src/hive/monitor_log/write_monitor_to_db.py	(working copy)
@@ -36,11 +36,14 @@
     'fatal_alerts': 'fatal alerts'
 }
 
+C_PATH_SYSTEM_INTERFACE_DB   = "/var/crash/graphdb/"
+C_DB_SYSTEM_INTERFACE_STATUS = "SystemInterface"
+
 def main():
     if len(sys.argv) < 1:
         exit(1)
     type = sys.argv[1]
-    if type not in ['tcpstatus', 'tcpsyndrop', 'sslstatus']:
+    if type not in ['tcpstatus', 'tcpsyndrop', 'sslstatus', 'systeminterface']:
         exit(1)
     if type == "tcpstatus":
         inset_db_tcp_status()
@@ -48,6 +51,8 @@
         insert_db_tcp_syn_drop()
     elif type == "sslstatus":
         insert_db_ssl_status()
+    elif type == "systeminterface":
+        insert_db_system_interface_status()
 
 def inset_db_tcp_status():
     if not os.path.exists(C_PATH_TCP_STATUS_DB):
@@ -169,6 +174,123 @@
         print(ex)
     conn.commit()
     conn.close()
+
+def insert_db_system_interface_status():    
+    if not os.path.exists(C_PATH_TCP_STATUS_DB):
+        os.mkdir(C_PATH_TCP_STATUS_DB)
+
+    cmd = '/ca/bin/backend -c "show interface"'
+    cmd = cmd.encode('utf-8') + chr(252)
+    (status, output) = commands.getstatusoutput(cmd)
+    if status != 0:
+        exit(1)
+
+    # Initialize data storage
+    each_data = {}
+
+    if output:
+        # Regular expression to match each port
+        port_pattern = r"(port\d+)\(port\d+\):"
+        ports_data = re.split(port_pattern, output)
+
+        # Patterns to extract required information
+        Frames_In       = r"Input queue:\s*\d+\/\d+\s*\(size\/max\)\n\s*total:\s*\d+\s*packets,\s*good:\s*(\d+)\s*packets"
+        Frames_Out      = r"Output queue:\s*\d+\/\d+\s*\(size\/max\)\n\s*total:\s*\d+\s*packets,\s*good:\s*(\d+)\s*packets" 
+        Bytes_In        = r"Input queue:\s*\d+\/\d+\s*\(size\/max\)\n\s*total:\s*\d+\s*packets,\s*good:\s*\d+\s*packets,\s*(\d+)\s*bytes"
+        Bytes_Out       = r"Output queue:\s*\d+\/\d+\s*\(size\/max\)\n\s*total:\s*\d+\s*packets,\s*good:\s*\d+\s*packets,\s*(\d+)\s*bytes"
+        Bit_Rate_In     = r"input rate (\d+) bits\/sec"
+        Packet_Rate_In  = r"input rate \d+ bits\/sec,\s*(\d+)\spackets\/sec"
+        Bit_Rate_Out    = r"output rate (\d+) bits\/sec"
+        Packet_Rate_Out = r"output rate \d+ bits\/sec,\s*(\d+)\spackets\/sec"
+
+        # Iterate through ports_data
+        for i in range(1, len(ports_data), 2):
+            port_name = ports_data[i].strip()  # e.g., 'port1'
+            port_details = ports_data[i + 1]   # Corresponding port details
+
+            # Initialize a list to store data for the current port
+            port_info = {}
+
+            # Extracting required data using regex
+            FramesIn        = re.search(Frames_In, port_details)
+            FramesOut       = re.search(Frames_Out, port_details)
+            BytesIn         = re.search(Bytes_In, port_details)
+            BytesOut        = re.search(Bytes_Out, port_details)
+            BitRateIn       = re.search(Bit_Rate_In, port_details)
+            PacketRateIn    = re.search(Packet_Rate_In, port_details)
+            BitRateOut      = re.search(Bit_Rate_Out, port_details)
+            PacketRateOut   = re.search(Packet_Rate_Out, port_details)
+
+            # Store the extracted data in the port_info dictionary
+            port_info['FramesIn']       = FramesIn.group(1) if FramesIn else None
+            port_info['FramesOut']      = FramesOut.group(1) if FramesOut else None
+            port_info['BytesIn']        = BytesIn.group(1) if BytesIn else None
+            port_info['BytesOut']       = BytesOut.group(1) if BytesOut else None
+            port_info['BitRateIn']      = BitRateIn.group(1) if BitRateIn else None
+            port_info['PacketRateIn']   = PacketRateIn.group(1) if PacketRateIn else None
+            port_info['BitRateOut']     = BitRateOut.group(1) if BitRateOut else None
+            port_info['PacketRateOut']  = PacketRateOut.group(1) if PacketRateOut else None
+
+            # Store the port info in the main data dictionary
+            each_data[port_name] = port_info
+    
+    db_name = C_PATH_SYSTEM_INTERFACE_DB + get_date_for_db_name()
+    conn = sqlite3.connect(db_name)
+    db = conn.cursor()
+
+    try:
+        now = int(time.time())
+        if len(each_data):                              # Ensure 'each_data' has entries
+            for port, port_info in each_data.items():   # Insert the port information into the database
+                print("Port: {}".format(port))
+                print("  Frames In: {}".format(port_info.get('FramesIn', 'N/A')))
+                print("  Frames Out: {}".format(port_info.get('FramesOut', 'N/A')))
+                print("  Bytes In: {}".format(port_info.get('BytesIn', 'N/A')))
+                print("  Bytes Out: {}".format(port_info.get('BytesOut', 'N/A')))
+                print("  Bit Rate In: {}".format(port_info.get('BitRateIn', 'N/A')))
+                print("  Packet Rate In: {}".format(port_info.get('PacketRateIn', 'N/A')))
+                print("  Bit Rate Out: {}".format(port_info.get('BitRateOut', 'N/A')))
+                print("  Packet Rate Out: {}".format(port_info.get('PacketRateOut', 'N/A')))
+                print()
+
+                db.execute(" ".join(['INSERT INTO %s (' % C_DB_SYSTEM_INTERFACE_STATUS,
+                        'pk,',
+                        'time,', 
+                        'framesIn,', 
+                        'framesOut,', 
+                        'bytesIn,', 
+                        'bytesOut,',
+                        'throughput_in_bits,', 
+                        'throughput_in_packets,', 
+                        'throughput_out_bits,', 
+                        'throughput_out_packets',
+                        ') VALUES (',
+                        '?,',
+                        '?,',
+                        '?,',
+                        '?,',
+                        '?,',
+                        '?,',
+                        '?,',
+                        '?,',
+                        '?,',
+                        '?)']), 
+                        ("{\"name\": \"%s\"}" % port,
+                        now,
+                        port_info.get('FramesIn', 0),
+                        port_info.get('FramesOut', 0),
+                        port_info.get('BytesIn', 0),
+                        port_info.get('BytesOut', 0),
+                        port_info.get('BitRateIn', 0),
+                        port_info.get('PacketRateIn', 0),
+                        port_info.get('BitRateOut', 0),
+                        port_info.get('PacketRateOut', 0)))
+                        
+    except Exception as ex:
+        print("Cannot insert data into db %s" % C_DB_SYSTEM_INTERFACE_STATUS)
+        print(ex)
+    conn.commit()
+    conn.close()
 
 def insert_db_tcp_syn_drop():
     if not os.path.exists(C_PATH_TCP_SYN_DROP_DB):
