# ===============================
 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
     # ===============================
 if widgetId.lower() == "protocolbytes":
     # pie chart is a serie of key-value pairs
     wdata = interface.bytesStats(i)
     wdata = filter_dict(wdata, lambda k, v: v > 0)
     widget.setProperties(wdata)
     widget.removeKey("total")
     # ===============================
     # Protocol Packets Widget Data
     # ===============================
 if widgetId.lower() == "protocolpackets":
     # pie chart is a serie of key-value pairs
     wdata = interface.pktsStats(i)
     wdata = filter_dict(wdata, lambda k, v: v > 0)
     widget.setProperties(wdata)
     widget.removeKey("total")
     # ===============================
     # Security Packets Widget Data
     # ===============================
Beispiel #2
0
 # ===============================
 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
 # ===============================
 if (widgetId.lower() == "protocolbytes"):
     # pie chart is a serie of key-value pairs
     wdata = interface.bytesStats(i)
     wdata = filter_dict(wdata, lambda k, v: v > 0)
     widget.setProperties(wdata)
     widget.removeKey('total')
 # ===============================
 # Protocol Packets Widget Data
 # ===============================
 if (widgetId.lower() == "protocolpackets"):
     # pie chart is a serie of key-value pairs
     wdata = interface.pktsStats(i)
     wdata = filter_dict(wdata, lambda k, v: v > 0)
     widget.setProperties(wdata)
     widget.removeKey('total')
 # ===============================
 # Security Packets Widget Data
 # ===============================
Beispiel #3
0
            info['virtual'] = interface.virtual(i)
            info['speed'] = interface.speed(i)
            info['mtu'] = interface.mtu(i)
            info['bpf'] = interface.bpf(i)

            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
Beispiel #4
0
                # Statistics of the interface traffic
                rs = interface.pktsStats(i)
                total = rs.pop('total', sum(rs.values()))
                pktsStats = {
                    "metadata": {
                        "type": "barchart",
                        "title": "Packet Statistics",
                        "unit": "packets",
                        "mode": "counter",
                        "total": total
                    },
                    "data": rs
                }

                rs = interface.bytesStats(i)
                total = rs.pop('total', sum(rs.values()))

                bytesStats = {
                    "metadata": {
                        "type": "piechart",
                        "title": "Bytes Statistics",
                        "unit": "bytes",
                        "mode": "counter",
                        "total": total
                    },
                    "data": rs
                }

                rs = interface.throughputStats(i)
                total = rs.pop('total', sum(rs.values()))
        info['virtual'] = interface.virtual(i)
        info['speed'] = interface.speed(i)
        info['mtu'] = interface.mtu(i)
        info['bpf'] = interface.bpf(i)

	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
Beispiel #6
0
				
				# Add address info to interface data
				info['interface address'] = if_addr
			
				ifdata = [{"data" : info, "metadata" : info_metadata}]
				
				rsp[interface.uniqueName(i)]['interface'] = ifdata
			
			if (len(topic) == 0 or topic.lower() == "protocols"):
				
				# Statistics of the interface traffic
				rs = interface.pktsStats(i)
				total = rs.pop('total',sum(rs.values()))
				pktsStats = { "metadata": { "type":"barchart", "title":"Packet Statistics", "unit": "packets", "mode" : "counter", "total": total }, "data" : rs }
			
				rs = interface.bytesStats(i)
				total = rs.pop('total',sum(rs.values()))

				bytesStats = { "metadata": { "type":"piechart", "title":"Bytes Statistics", "unit": "bytes", "mode" : "counter", "total": total }, "data" : rs }

				rs = interface.throughputStats(i)
				total = rs.pop('total',sum(rs.values()))
				
				adapter = {}
				adapter['actual'] = {'packets': rs.pop('actualPkts',''), 'bytes': rs.pop('actualBytes','')}
				adapter['peak'] = {'packets': rs.pop('peakPkts',''), 'bytes': rs.pop('peakBytes','')}
				adapter['last minute'] = {'packets': rs.pop('lastMinPkts',''), 'bytes': rs.pop('lastMinBytes','')}
				adapter['last 5 minutes'] = {'packets': rs.pop('lastFiveMinsPkts',''), 'bytes': rs.pop('lastFiveMinsBytes','')}
				if (len(rs) > 0): adapter['other'] = rs
				
				throughputStats = { "metadata": { "type":"groupedtable", "title":"Interface Throughput", "unit": "bps", "mode" : "gauge", "total": total }, "data" : adapter }