Esempio n. 1
0
    def __init__(self, port = 80, hostname = 'localhost', gmetric = None, config = None):
        if port is None:
            self.port = 80
        else:
            self.port = port
        
        logFileName = 'gmetric-apache-' + hostname + '-' + str(self.port) + '.log'

        Gmetric.__init__(self, logFileName, gmetric, config)

        if hostname is not None:
            self.hostname = hostname
Esempio n. 2
0
    def __init__(self, mysql_username, mysql_password, mysql_hostname = 'localhost', mysql_port = None, gmetric = None, config = None):
        if mysql_port is None:
            self.mysqlPort = 3306
        else:
            self.mysqlPort = mysql_port

        logFileName = 'gmetric-mysql-' + mysql_hostname + '-' + str(self.mysqlPort) + '.log'

        Gmetric.__init__(self, logFileName, gmetric, config)

        if mysql_hostname is not None:
            self.mysql_hostname = mysql_hostname
    
        self.connection = MySQLdb.connect (host = self.mysql_hostname, port = self.mysqlPort, user = mysql_username, passwd = mysql_password)