"network": interface.network(i), "active host number": interface.numHosts(i), }, ) # =============================== # IP Statistics Widget Data # =============================== if widgetId.lower() == "ipstats": # pie chart is a serie of key-value pairs widget.setProperties(interface.ipStats(i)) # =============================== # TCP Statistics Widget Data # =============================== if widgetId.lower() == "tcpstats": # pie chart is a serie of key-value pairs widget.setProperties(interface.tcpStats(i)) # =============================== # UDP Statistics Widget Data # =============================== if widgetId.lower() == "udpstats": # pie chart is a serie of key-value pairs widget.setProperties(interface.udpStats(i)) # =============================== # ICMP Statistics Widget Data # =============================== if widgetId.lower() == "icmpstats": # pie chart is a serie of key-value pairs widget.setProperties(interface.icmpStats(i)) # =============================== # Protocol Bytes Widget Data # ===============================
'IPv6 address': interface.ipv6(i), 'network': interface.network(i), 'active host number': interface.numHosts(i) }) # =============================== # IP Statistics Widget Data # =============================== if (widgetId.lower() == "ipstats"): # pie chart is a serie of key-value pairs widget.setProperties(interface.ipStats(i)) # =============================== # TCP Statistics Widget Data # =============================== if (widgetId.lower() == "tcpstats"): # pie chart is a serie of key-value pairs widget.setProperties(interface.tcpStats(i)) # =============================== # UDP Statistics Widget Data # =============================== if (widgetId.lower() == "udpstats"): # pie chart is a serie of key-value pairs widget.setProperties(interface.udpStats(i)) # =============================== # ICMP Statistics Widget Data # =============================== if (widgetId.lower() == "icmpstats"): # pie chart is a serie of key-value pairs widget.setProperties(interface.icmpStats(i)) # =============================== # Protocol Bytes Widget Data # ===============================
addr = {} addr['ipv4'] = interface.ipv4(i) addr['network'] = interface.network(i) addr['numHosts'] = interface.numHosts(i) addr['ipv6'] = interface.ipv6(i) info['address'] = addr if ((len(mode) == 0) or not (mode == "list")): stats = {} stats['pktsStats'] = interface.pktsStats(i) stats['bytesStats'] = interface.bytesStats(i) stats['throughputStats'] = interface.throughputStats(i) ip = {} ip['tcp'] = interface.tcpStats(i) ip['udp'] = interface.udpStats(i) ip['icmp'] = interface.icmpStats(i) ip['ip'] = interface.ipStats(i) stats['securityPkts'] = interface.securityPkts(i) stats['netflowStats'] = interface.netflowStats(i) stats['sflowStats'] = interface.sflowStats(i) stats['cpacketStats'] = interface.cpacketStats(i) stats['ip'] = ip info['stats'] = stats rsp[interface.uniqueName(i)] = info except Exception as inst: print type(inst) # the exception instance
if_traffic.append({ "metadata": { "type": "piechart", "title": "CPackets Statistics", "unit": "bytes", "mode": "counter", "total": total }, "data": rs }) rsp[interface.uniqueName(i)]['protocols'] = if_traffic if (len(topic) == 0 or topic.lower() == "ip"): # IP packets and breadcrumb rs = interface.tcpStats(i) total = rs.pop('total', sum(rs.values())) ip_tcp = { "metadata": { "type": "piechart", "title": "TCP Statistics", "unit": "bytes", "mode": "counter", "total": total }, "data": rs } rs = interface.udpStats(i) total = rs.pop('total', sum(rs.values())) ip_udp = {
addr = {} addr['ipv4'] = interface.ipv4(i) addr['network'] = interface.network(i) addr['numHosts'] = interface.numHosts(i) addr['ipv6'] = interface.ipv6(i) info['address'] = addr if((len(mode) == 0) or not(mode == "list")): stats = {} stats['pktsStats'] = interface.pktsStats(i) stats['bytesStats'] = interface.bytesStats(i) stats['throughputStats'] = interface.throughputStats(i) ip = {} ip['tcp'] = interface.tcpStats(i) ip['udp'] = interface.udpStats(i) ip['icmp'] = interface.icmpStats(i) ip['ip'] = interface.ipStats(i) stats['securityPkts'] = interface.securityPkts(i) stats['netflowStats'] = interface.netflowStats(i) stats['sflowStats'] = interface.sflowStats(i) stats['cpacketStats'] = interface.cpacketStats(i) stats['ip'] = ip info['stats'] = stats rsp[interface.uniqueName(i)] = info except Exception as inst: print type(inst) # the exception instance
rs = interface.sflowStats(i) if(len(rs) > 0): total = rs.pop('total',sum(rs.values())) if_traffic.append({"metadata": {"type":"piechart", "title":"SFlow Statistics", "unit": "bytes", "mode" : "counter", "total": total}, "data":rs}) rs = interface.cpacketStats(i) if(len(rs) > 0): total = rs.pop('total',sum(rs.values())) if_traffic.append({"metadata": {"type":"piechart", "title":"CPackets Statistics", "unit": "bytes", "mode" : "counter", "total": total}, "data":rs}) rsp[interface.uniqueName(i)]['protocols'] = if_traffic if (len(topic) == 0 or topic.lower() == "ip"): # IP packets and breadcrumb rs = interface.tcpStats(i) total = rs.pop('total',sum(rs.values())) ip_tcp = { "metadata": { "type":"piechart", "title":"TCP Statistics", "unit": "bytes", "mode" : "counter", "total": total }, "data" : rs } rs = interface.udpStats(i) total = rs.pop('total',sum(rs.values())) ip_udp = { "metadata": { "type":"piechart", "title":"UDP Statistics", "unit": "bytes", "mode" : "counter", "total": total}, "data" : rs } rs = interface.icmpStats(i) total = rs.pop('total',sum(rs.values())) ip_icmp = { "metadata": { "type":"piechart", "title":"ICMP Statistics", "unit": "bytes", "mode" : "counter", "total": total}, "data" : rs } rs = interface.ipStats(i) total = rs.pop('total',sum(rs.values())) ip_v4v6 = { "metadata": { "type":"piechart", "title":"IP Statistics", "unit": "bytes", "mode" : "counter", "total": total}, "data" : rs }