Exemplo n.º 1
0
    def rteval(self):
        ''' main function for rteval'''
        retval = 0

        # Parse initial DMI decoding errors
        dmi.ProcessWarnings()

        # if --summarize was specified then just parse the XML, print it and exit
        if self.cmd_options.summarize or self.cmd_options.rawhistogram:
            if len(self.cmd_arguments) < 1:
                raise RuntimeError, "Must specify at least one XML file with --summarize!"

            for x in self.cmd_arguments:
                if self.cmd_options.summarize:
                    self.summarize(x)
                elif self.cmd_options.rawhistogram:
                    self.show_report(x, 'rteval_histogram_raw.xsl')

            sys.exit(0)

        if os.getuid() != 0:
            print "Must be root to run rteval!"
            sys.exit(-1)

        self.debug(
            '''rteval options: 
        workdir: %s
        loaddir: %s
        reportdir: %s
        verbose: %s
        debugging: %s
        logging:  %s
        duration: %f
        sysreport: %s
        inifile:  %s''' %
            (self.workdir, self.config.srcdir, self.reportdir,
             self.config.verbose, self.config.debugging, self.config.logging,
             self.config.duration, self.config.sysreport, self.inifile))

        if not os.path.isdir(self.workdir):
            raise RuntimeError, "work directory %d does not exist" % self.workdir

        # create our report directory
        try:
            self.make_report_dir()
        except:
            print "Cannot create the report dir!"
            print "(is this an NFS filesystem with rootsquash turned on?)"
            sys.exit(-1)

        self.measure()

        # if --xmlrpc-submit | -X was given, send our report to this host
        if self.config.xmlrpc:
            retval = self.XMLRPC_Send()

        self.get_dmesg()
        self.tar_results()

        return retval
Exemplo n.º 2
0
    def __init__(self, config, logger=None):
        self.__logger = logger
        KernelInfo.__init__(self, logger=logger)
        SystemServices.__init__(self, logger=logger)
        dmi.DMIinfo.__init__(self, config, logger=logger)
        CPUtopology.__init__(self)
        OSInfo.__init__(self, logger=logger)

        # Parse initial DMI decoding errors
        dmi.ProcessWarnings()

        # Parse CPU info
        CPUtopology._parse(self)
Exemplo n.º 3
0
        except:
            print "Cannot create the report dir!"
            print "(is this an NFS filesystem with rootsquash turned on?)"
            sys.exit(-1)

        self.measure()

        # if --xmlrpc-submit | -X was given, send our report to this host
        if self.config.xmlrpc:
            retval = self.XMLRPC_Send()

        self.get_dmesg()
        self.tar_results()

        return retval


if __name__ == '__main__':
    import pwd, grp

    try:
        # Parse initial DMI decoding errors
        dmi.ProcessWarnings()

        rteval = RtEval(sys.argv[1:])
        ec = rteval.rteval()
        rteval.debug("exiting with exit code: %d" % ec)
        sys.exit(ec)
    except KeyboardInterrupt:
        sys.exit(0)