コード例 #1
0
ファイル: remote.py プロジェクト: codebang/dms-sa
 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()
コード例 #2
0
ファイル: remote.py プロジェクト: codebang/dms-sa
 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()
コード例 #3
0
ファイル: show.py プロジェクト: codebang/dms-sa
 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"
コード例 #4
0
ファイル: show.py プロジェクト: notlcry/dms_sa_hy
 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"
コード例 #5
0
ファイル: remote.py プロジェクト: notlcry/dms_sa_hy
 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()
コード例 #6
0
ファイル: tcpdump.py プロジェクト: codebang/dms-sa
    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"
コード例 #7
0
ファイル: remote.py プロジェクト: notlcry/dms_sa_hy
    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"
コード例 #8
0
ファイル: remote.py プロジェクト: notlcry/dms_sa_hy
 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()
コード例 #9
0
ファイル: show.py プロジェクト: codebang/dms-sa
 def execute(self,options,subargs):
     if options.accountId == "all":
         print_tabulate(Account,Account.list())
     else:
         print_tabulate(Account,Account.get(options.accountId))
コード例 #10
0
ファイル: show.py プロジェクト: notlcry/dms_sa_hy
 def execute(self, options, subargs):
     if options.accountId == "all":
         print_tabulate(Account, Account.list())
     else:
         print_tabulate(Account, Account.get(options.accountId))