Esempio n. 1
0
## Authors: Emily Sarneso <*****@*****.**>
## ------------------------------------------------------------------------
## See license information in LICENSE-OPENSOURCE.txt
## ------------------------------------------------------------------------

import sys
import pyfixbuf

# Test that the argument number is correct
if (len(sys.argv) != 4):
    print "Must supply a hostname, port, and transport protocol."
    print "Usage: sample_net_exporter.py hostname port transport"
    sys.exit()

#create the information model with the standard IPFIX elements
infomodel = pyfixbuf.InfoModel()

# add YAF's HTTP IPFIX elements for a sub template
infomodel.add_element_list(pyfixbuf.YAF_HTTP_LIST)

# create the "outer" template
tmpl = pyfixbuf.Template(infomodel)

# create a template that will be exported in the STML
sub_tmpl = pyfixbuf.Template(infomodel)

# create a template that will be exported in the STL
stl_tmpl = pyfixbuf.Template(infomodel)

# add elements we want in our "outer" template
export_list = [
Esempio n. 2
0
## See license information in LICENSE-OPENSOURCE.txt

import sys
import pyfixbuf as p
from netsa.data.times import *

# Test that the argument number is correct

if (len(sys.argv) != 3):
    print "Must supply an IPFIX file to read and a text file to write."
    print "Usage: sample_collector.py file.ipfix file.txt"
    sys.exit()

# Create an InfoModel

infomodel = p.InfoModel()

# Add basic YAF & stats elements to the infomodel

infomodel.add_element_list(p.YAF_LIST)
infomodel.add_element_list(p.YAF_STATS_LIST)
infomodel.add_element_list(p.YAF_DNS_LIST)
infomodel.add_element_list(p.YAF_HTTP_LIST)

# Create a Template

tmpl = p.Template(infomodel)

# Create a Stats Template

stats_tmpl = p.Template(infomodel)