Ejemplo n.º 1
0
def CeleryStoringTask(fileToStore, nameToStore, descToStore, endeToStore, locToStore, ownerToStore, startToStore):
    
    erg = pcapParser.storeFileIntoDataBase(UPLOAD_FOLDER + "/" + fileToStore, nameToStore)

    description_collection.insert_one({"Description": descToStore, "Ende": endeToStore, "Location": locToStore, "Name": nameToStore, "Owner": ownerToStore, "Start": startToStore})

    queryHelper.makeIndizes(database, nameToStore)
Ejemplo n.º 2
0
def storeFiles():

    if request.method == 'POST':
        fileToStore = str(request.form['file'])
        nameToStore = str(request.form['Name'])
        ownerToStore = str(request.form['Owner'])
        descToStore = str(request.form['Description'])
        startToStore = str(request.form['Start'])
        endeToStore = str(request.form['Ende'])
        locToStore = str(request.form['Location'])
        
        if not nameToStore:
            nameToStore = fileToStore[:len(fileToStore)-5]

        erg = pcapParser.storeFileIntoDataBase(UPLOAD_FOLDER + "/" + fileToStore, nameToStore)

        description_collection.insert_one({"Description": descToStore, "Ende": endeToStore, "Location": locToStore, "Name": nameToStore, "Owner": ownerToStore, "Start": startToStore})

        queryHelper.makeIndizes(database, nameToStore)

        stats = []
        stats.append(["Anzahl benoetigter Pakete", erg['pak']])
        stats.append(["Benoetigte Laufzeit", erg['run']])

        return render_template("backend/Success.html", action = "stored", itemType = "File as Collection", itemName = fileToStore, stats = stats)

    files = helper.fileNamesinUploads(UPLOAD_FOLDER)

    return render_template("backend/storeFiles.html", files = files)
Ejemplo n.º 3
0
def CeleryMonitoringTaskRemote(interface, counter, timer, collectionNameToUse, address, port, user, iface):

    requestTask = pcapParser.liveMonitoringRemote(interface, int(counter), int(timer), collectionNameToUse, address, port, user, iface)

    queryHelper.makeIndizes(database, collectionNameToUse)
Ejemplo n.º 4
0
def CeleryMonitoringTask(interface, counter, timer, collectionNameToUse):
    
    requestTask = pcapParser.liveMonitoring(interface, int(counter), int(timer), collectionNameToUse)
    
    queryHelper.makeIndizes(database, collectionNameToUse)