Beispiel #1
0
    def checkIfSpamAssassinInstalled():
        try:

            path = "/etc/mail/spamassassin/local.cf"

            command = "sudo cat " + path
            output = ProcessUtilities.outputExecutioner(command)

            if output.find('No such') > -1:
                return 0
            else:
                return 1

        except BaseException, msg:
            logging.CyberCPLogFileWriter.writeToFile(
                str(msg) + "  [checkIfSpamAssassinInstalled]")
            return 0
Beispiel #2
0
    def fetchPHPDetails(virtualHost):
        if ProcessUtilities.decideServer() == ProcessUtilities.OLS:
            try:
                path = installUtilities.Server_root_path + "/conf/vhosts/" + virtualHost + "/vhost.conf"

                command = "sudo cat " + path
                datas = ProcessUtilities.outputExecutioner(command).split("\n")

                dataToReturn = {}

                for items in datas:
                    if items.find("maxConns") > -1:
                        data = items.split()
                        dataToReturn['maxConns'] = data[1]

                    if items.find("initTimeout") > -1:
                        data = items.split()
                        dataToReturn['initTimeout'] = data[1]

                    if items.find("persistConn") > -1:
                        data = items.split()
                        dataToReturn['persistConn'] = data[1]

                    if items.find("memSoftLimit") > -1:
                        data = items.split()
                        dataToReturn['memSoftLimit'] = data[1]

                    if items.find("memHardLimit") > -1:
                        data = items.split()
                        dataToReturn['memHardLimit'] = data[1]

                    if items.find("procSoftLimit") > -1:
                        data = items.split()
                        dataToReturn['procSoftLimit'] = data[1]

                    if items.find("procHardLimit") > -1:
                        data = items.split()
                        dataToReturn['procHardLimit'] = data[1]

                return dataToReturn
            except BaseException, msg:
                logging.CyberCPLogFileWriter.writeToFile(
                    str(msg) + " [fetchPHPDetails]")
                return 0
Beispiel #3
0
    def fetchTuningDetails():
        if ProcessUtilities.decideServer() == ProcessUtilities.OLS:
            try:
                dataToReturn = {}
                command = "sudo cat /usr/local/lsws/conf/httpd_config.conf"
                datas = ProcessUtilities.outputExecutioner(command).split("\n")

                for items in datas:
                    if items.find("maxConnections") > -1:
                        data = items.split()
                        dataToReturn['maxConnections'] = data[1]

                    if items.find("maxSSLConnections") > -1:
                        data = items.split()
                        dataToReturn['maxSSLConnections'] = data[1]

                    if items.find("connTimeout") > -1:
                        data = items.split()
                        dataToReturn['connTimeout'] = data[1]

                    if items.find("maxConnections") > -1:
                        data = items.split()
                        dataToReturn['maxConnections'] = data[1]

                    if items.find("keepAliveTimeout") > -1:
                        data = items.split()
                        dataToReturn['keepAliveTimeout'] = data[1]

                    if items.find("totalInMemCacheSize") > -1:
                        data = items.split()
                        dataToReturn['totalInMemCacheSize'] = data[1]

                    if items.find("enableGzipCompress") > -1:
                        data = items.split()
                        dataToReturn['enableGzipCompress'] = data[1]

                return dataToReturn
            except BaseException, msg:
                logging.CyberCPLogFileWriter.writeToFile(
                    str(msg) + " [fetchTuningDetails]")
                return 0
Beispiel #4
0
                    if items.find("enableGzipCompress") > -1:
                        data = items.split()
                        dataToReturn['enableGzipCompress'] = data[1]

                return dataToReturn
            except BaseException, msg:
                logging.CyberCPLogFileWriter.writeToFile(
                    str(msg) + " [fetchTuningDetails]")
                return 0
        else:
            try:
                dataToReturn = {}

                command = "sudo cat /usr/local/lsws/conf/httpd_config.xml"
                datas = ProcessUtilities.outputExecutioner(command)
                comTree = ElementTree.fromstring(datas)
                tuningData = comTree.find('tuning')

                dataToReturn['maxConnections'] = tuningData.find(
                    'maxConnections').text
                dataToReturn['maxSSLConnections'] = tuningData.find(
                    'maxSSLConnections').text
                dataToReturn['connTimeout'] = tuningData.find(
                    'connTimeout').text
                dataToReturn['keepAliveTimeout'] = tuningData.find(
                    'keepAliveTimeout').text
                dataToReturn['totalInMemCacheSize'] = tuningData.find(
                    'totalInMemCacheSize').text
                dataToReturn['enableGzipCompress'] = tuningData.find(
                    'enableGzipCompress').text