def execute(self, options, subargs): if not options.accountId: self.parser.error("accountId is required") account = Account.get(options.accountId) if account is None or len(account) == 0: print "account does not exist in db" return try: task = ( DBNode() .session.query(DMSToolTask) .filter(DMSToolTask.accountId == options.accountId) .filter(DMSToolTask.task_name == "tcpdump") .one() ) except NoResultFound, e: map = {} map["firewall"] = options.firewall_interface map["ipsecvpn"] = options.ipsecvpn_interface map["dns"] = options.dns_interface map["vrouter"] = options.vrouter_interface TcpdumpExecutor(account).start(map) task = DMSToolTask() task.task_name = "tcpdump" task.accountId = options.accountId DBNode().session.add(task) DBNode().session.commit()
def execute(self, options, subargs): if not options.accountId: self.parser.error("accountId is required") account = Account.get(options.accountId) if account is None or len(account) == 0: print "account does not exist in db" return print TcpdumpExecutor(account).status()
def execute(self,options,subargs): if not options.accountId: self.parser.error("accountid is required...") account = Account.get(options.accountId) if account!= None: print_tabulate(Node,account[0].listnodes()) else: print "Error: accountid is not exisit"
def execute(self, options, subargs): if not options.accountId: self.parser.error("accountid is required...") account = Account.get(options.accountId) if account != None: print_tabulate(Node, account[0].listnodes()) else: print "Error: accountid is not exisit"
def execute(self,options,subargs): if not options.accountId: self.parser.error("accountId is required") account = Account.get(options.accountId) if account is None or len(account) == 0: print "account does not exist in db" return try: task = DBNode().session.query(DMSToolTask).filter(DMSToolTask.accountId == options.accountId).filter(DMSToolTask.task_name== "tcpdump").one() except NoResultFound,e: print "Info: no tcpdump task need to stop on this accounit"
def execute(self, options, subargs): if not options.accountId: self.parser.error("accountId is required") account = Account.get(options.accountId) if account is None or len(account) == 0: print "account does not exist in db" return try: task = DBNode().session.query(DMSToolTask).filter( DMSToolTask.accountId == options.accountId).filter( DMSToolTask.task_name == "tcpdump").one() except NoResultFound, e: print "Info: no tcpdump task need to stop on this accounit"
def execute(self, options, subargs): if not options.accountId: self.parser.error("accountId is required") account = Account.get(options.accountId) if account is None or len(account) == 0: print "account does not exist in db" return try: task = DBNode().session.query(DMSToolTask).filter( DMSToolTask.accountId == options.accountId).filter( DMSToolTask.task_name == "tcpdump").one() except NoResultFound, e: map = {} map["firewall"] = options.firewall_interface map["ipsecvpn"] = options.ipsecvpn_interface map["dns"] = options.dns_interface map["vrouter"] = options.vrouter_interface TcpdumpExecutor(account).start(map) task = DMSToolTask() task.task_name = "tcpdump" task.accountId = options.accountId DBNode().session.add(task) DBNode().session.commit()
def execute(self,options,subargs): if options.accountId == "all": print_tabulate(Account,Account.list()) else: print_tabulate(Account,Account.get(options.accountId))
def execute(self, options, subargs): if options.accountId == "all": print_tabulate(Account, Account.list()) else: print_tabulate(Account, Account.get(options.accountId))