Example #1
0
def snaplist0():
    seqlist = readdbs.getSeqlist()
    agentid = int(seqlist[0]['agentid'])
    packstruct = PackOper(agentid)
    packstruct.send_DBS_SNAPLIST_REQ(0)
    snap = packstruct.recv_DBS_SNAPLIST_ACK()
    return render_template('snaplist.html', title=u"快照管理", seqlist=seqlist, snaplist=snap, flag=0, agentid=agentid)
Example #2
0
def addSequence():
    seqlist = readdbs.getSeqlist()
    if request.method == 'POST':
        form = request.form
        mac = form.get('mac')
        ip = form.get('ip')
        serial = form.get('serial')
        seqinfo = dict(mac=mac, agentid=str(string.atoi(seqlist[-1]['agentid'])+1), ip=ip, serial=serial)
        (flag, seqlist) = readdbs.addSequence(seqinfo)
        log = Logger()
        log.logout('INFO', "Add Sequence Successed - "+ip)
    return render_template('Sequence.html', title=u"客户端管理", sequenceinfo=seqlist, flag=flag)
Example #3
0
def changeMac():
    log = Logger()
    if request.method == "POST":
        form = request.form
        ip = form.get('ip')
        newmac = form.get('newmac')
        (flag, seqlist) = readdbs.changemac(ip, newmac)
        log.logout('INFO', "["+ip+"] 's MAC Address changed Successful")
    else:
        seqlist = readdbs.getSeqlist()
        flag = -1
        log.logout('ERROR', "Mac Address changed FAILED")
    return render_template('MacAdr.html', title=u"修改MAC地址", seqlist=seqlist, flag=flag)
Example #4
0
def createsnap(agentid):
    seqlist = readdbs.getSeqlist()
    packstruct = PackOper(int(agentid))
    packstruct.send_DBS_SNAPLIST_REQ(0)
    snap = packstruct.recv_DBS_SNAPLIST_ACK()
    flag = -1
    log = Logger()
    if request.method == 'POST':
        form = request.form
        info = form.get('info')
        if len(info) < 32:
            packstruct = PackOper(int(agentid))
            packstruct.send_DBS_CREATE_SNAP(0, str(info))
            id = packstruct.recv_DBS_CREATE_SNAP()
            flag = 1
            log.logout('INFO', "Create Snapshot Success - ID is "+str(id))
        else:
            log.logout("ERROR", "Create Snap Failed - Snapshot Description too LONG")
    return render_template('snaplist.html', title=u"快照管理", seqlist=seqlist, snaplist=snap, flag=flag, agentid=agentid)
Example #5
0
def sequence():
    seqlist = readdbs.getSeqlist()
    return render_template('Sequence.html', title=u"客户端管理", sequenceinfo=seqlist)
Example #6
0
def MacAdr():
    seqlist = readdbs.getSeqlist()
    return render_template('MacAdr.html', title=u"修改MAC地址", seqlist=seqlist, flag=0)