Esempio n. 1
0
    def obtainFiles(self):
        date = self.date
        
        # Used for xferlog
        (dummy, month, day) = dateLib.getISODateParts(date)
        if day[0] == '0':
            day = ' ' +  day[1]
        monthAbbrev = dateLib.getMonthAbbrev(month)

        LOG = '/apps/pds/log/'
        for machine in self.machines:
            self.manager.createDir(PXPaths.LAT_TMP +  machine + '_' + self.random)
            for source in self.sources:
                command = 'scp -q %s:%s %s' % (machine, LOG + source + '.' + date, PXPaths.LAT_TMP + machine + '_' + self.random)
                (status, output) = commands.getstatusoutput(command)

            command = 'scp -q %s:%s %s' % (machine, LOG + self.client + '.' + date, PXPaths.LAT_TMP + machine + '_' + self.random)
            (status, output) = commands.getstatusoutput(command)

            # xferlog data
            if self.xstats:
                command = "ssh %s grep -h -e \"'%s %s'\" /var/log/xferlog /var/log/xferlog.?" % (machine, monthAbbrev, day)
                (status, output) = commands.getstatusoutput(command)
                xferlog = open(PXPaths.LAT_TMP + machine + '_' + self.random + '/xferlog_paplat', 'w')
                xferlog.write(output)
                xferlog.close()
Esempio n. 2
0
    def obtainFiles(self):

        # Used for xferlog
        (dummy, month, day) = dateLib.getISODateParts(self.date)
        if day[0] == '0':
            day = ' ' + day[1]
        monthAbbrev = dateLib.getMonthAbbrev(month)

        for machine in self.machines:
            self.manager.createDir(PXPaths.LAT_TMP + machine + '_' +
                                   self.random)

            if self.sources[0] == '__ALL__':
                command = "ssh %s grep -h -e \"'%s.*INFO.*Ingested'\" %s/rx*" % (
                    machine, self.dateDashed, PXPaths.LOG)
                #print command
                (status, output) = commands.getstatusoutput(command)
                allSources = open(
                    PXPaths.LAT_TMP + machine + '_' + self.random +
                    '/rx_all.log', 'w')
                allSources.write(output)
                allSources.close()
            else:
                for source in self.sources:
                    command = "ssh %s grep -h -e \"'%s.*INFO.*Ingested'\" %s/rx_%s*" % (
                        machine, self.dateDashed, PXPaths.LOG, source)
                    (status, output) = commands.getstatusoutput(command)
                    sourceFile = open(
                        PXPaths.LAT_TMP + machine + '_' + self.random +
                        '/rx_' + source, 'w')
                    sourceFile.write(output)
                    sourceFile.close()

                    #command = 'scp -q %s:%s %s' % (machine, PXPaths.LOG + 'rx_' + source + '*', PXPaths.LAT_TMP + machine + '_' + self.random)
                    #(status, output) = commands.getstatusoutput(command)

            # xferlog data
            if self.xstats:
                command = "ssh %s grep -h -e \"'%s %s'\" /var/log/wu-ftpd/xferlog" % (
                    machine, monthAbbrev, day)
                (status, output) = commands.getstatusoutput(command)
                xferlog = open(
                    PXPaths.LAT_TMP + machine + '_' + self.random +
                    '/xferlog_paplat', 'w')
                xferlog.write(output)
                xferlog.close()

            command = 'scp -q %s:%s %s' % (
                machine, PXPaths.LOG + 'tx_' + self.client + '.*',
                PXPaths.LAT_TMP + machine + '_' + self.random)
            (status, output) = commands.getstatusoutput(command)
Esempio n. 3
0
    def obtainFiles(self):

        # Used for xferlog
        (dummy, month, day) = dateLib.getISODateParts(self.date)
        if day[0] == "0":
            day = " " + day[1]
        monthAbbrev = dateLib.getMonthAbbrev(month)

        for machine in self.machines:
            self.manager.createDir(PXPaths.LAT_TMP + machine + "_" + self.random)

            if self.sources[0] == "__ALL__":
                command = "ssh %s grep -h -e \"'%s.*INFO.*Ingested'\" %s/rx*" % (machine, self.dateDashed, PXPaths.LOG)
                # print command
                (status, output) = commands.getstatusoutput(command)
                allSources = open(PXPaths.LAT_TMP + machine + "_" + self.random + "/rx_all.log", "w")
                allSources.write(output)
                allSources.close()
            else:
                for source in self.sources:
                    command = "ssh %s grep -h -e \"'%s.*INFO.*Ingested'\" %s/rx_%s*" % (
                        machine,
                        self.dateDashed,
                        PXPaths.LOG,
                        source,
                    )
                    (status, output) = commands.getstatusoutput(command)
                    sourceFile = open(PXPaths.LAT_TMP + machine + "_" + self.random + "/rx_" + source, "w")
                    sourceFile.write(output)
                    sourceFile.close()

                    # command = 'scp -q %s:%s %s' % (machine, PXPaths.LOG + 'rx_' + source + '*', PXPaths.LAT_TMP + machine + '_' + self.random)
                    # (status, output) = commands.getstatusoutput(command)

            # xferlog data
            if self.xstats:
                command = "ssh %s grep -h -e \"'%s %s'\" /var/log/wu-ftpd/xferlog" % (machine, monthAbbrev, day)
                (status, output) = commands.getstatusoutput(command)
                xferlog = open(PXPaths.LAT_TMP + machine + "_" + self.random + "/xferlog_paplat", "w")
                xferlog.write(output)
                xferlog.close()

            command = "scp -q %s:%s %s" % (
                machine,
                PXPaths.LOG + "tx_" + self.client + ".*",
                PXPaths.LAT_TMP + machine + "_" + self.random,
            )
            (status, output) = commands.getstatusoutput(command)