Exemplo n.º 1
0
 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()
Exemplo n.º 2
0
 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()
Exemplo n.º 3
0
 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"
Exemplo n.º 4
0
 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"
Exemplo n.º 5
0
 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()
Exemplo n.º 6
0
    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"
Exemplo n.º 7
0
    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"
Exemplo n.º 8
0
 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()
Exemplo n.º 9
0
 def execute(self,options,subargs):
     if options.accountId == "all":
         print_tabulate(Account,Account.list())
     else:
         print_tabulate(Account,Account.get(options.accountId))
Exemplo n.º 10
0
 def execute(self, options, subargs):
     if options.accountId == "all":
         print_tabulate(Account, Account.list())
     else:
         print_tabulate(Account, Account.get(options.accountId))