Ejemplo n.º 1
0
 def status(self):
     """Status of services"""
     services = []
     if self.app.pargs.nginx:
         Log.debug(self, "nginx service status")
         services = services + ['nginx']
     if self.app.pargs.php:
         Log.debug(self, "php5-fpm service status")
         services = services + ['php5-fpm']
     if self.app.pargs.mysql:
         if EEVariables.ee_mysql_host is "localhost":
             Log.debug(self, "mysql service status")
             services = services + ['mysql']
         else:
             Log.warn(self, "Remote MySQL found, "
                      "unable to get MySQL service status")
     if self.app.pargs.postfix:
         services = services + ['postfix']
         Log.debug(self, "postfix service status")
     if self.app.pargs.memcache:
         Log.debug(self, "memcached service status")
         services = services + ['memcached']
     if self.app.pargs.dovecot:
         Log.debug(self, "dovecot service status")
         services = services + ['dovecot']
     if not services and EEVariables.ee_mysql_host is "localhost":
         services = services + ['nginx', 'php5-fpm', 'mysql', 'postfix']
         Log.debug(self, "nginx,php5-fpm,mysql,postfix services status")
     elif not services:
         services = services + ['nginx', 'php5-fpm', 'postfix']
         Log.debug(self, "nginx,php5-fpm,postfix services status")
     for service in services:
         if EEService.get_service_status(self, service):
             Log.info(self, "{0:10}:  {1}".format(service, "Running"))
Ejemplo n.º 2
0
 def status(self):
     """Status of services"""
     services = []
     if self.app.pargs.nginx:
         Log.debug(self, "nginx service status")
         services = services + ['nginx']
     if self.app.pargs.php:
         Log.debug(self, "php5-fpm service status")
         services = services + ['php5-fpm']
     if self.app.pargs.mysql:
         if EEVariables.ee_mysql_host is "localhost":
             Log.debug(self, "mysql service status")
             services = services + ['mysql']
         else:
             Log.warn(
                 self, "Remote MySQL found, "
                 "unable to get MySQL service status")
     if self.app.pargs.postfix:
         services = services + ['postfix']
         Log.debug(self, "postfix service status")
     if self.app.pargs.memcache:
         Log.debug(self, "memcached service status")
         services = services + ['memcached']
     if self.app.pargs.dovecot:
         Log.debug(self, "dovecot service status")
         services = services + ['dovecot']
     if not services and EEVariables.ee_mysql_host is "localhost":
         services = services + ['nginx', 'php5-fpm', 'mysql', 'postfix']
         Log.debug(self, "nginx,php5-fpm,mysql,postfix services status")
     elif not services:
         services = services + ['nginx', 'php5-fpm', 'postfix']
         Log.debug(self, "nginx,php5-fpm,postfix services status")
     for service in services:
         if EEService.get_service_status(self, service):
             Log.info(self, "{0:10}:  {1}".format(service, "Running"))
Ejemplo n.º 3
0
    def status(self):
        """Status of services"""
        services = []
        if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php7
                or self.app.pargs.mysql or self.app.pargs.postfix
                or self.app.pargs.hhvm or self.app.pargs.memcache
                or self.app.pargs.dovecot or self.app.pargs.redis):
            self.app.pargs.nginx = True
            self.app.pargs.php = True
            self.app.pargs.mysql = True
            self.app.pargs.postfix = True
            self.app.pargs.hhvm = True

        if self.app.pargs.nginx:
            if EEAptGet.is_installed(self, 'nginx-custom') or EEAptGet.is_installed(self,'nginx-mainline'):
                services = services + ['nginx']
            else:
                Log.info(self, "Nginx is not installed")

        if self.app.pargs.php:
            if EEVariables.ee_platform_codename != 'trusty':
                if EEAptGet.is_installed(self, 'php5-fpm'):
                    services = services + ['php5-fpm']
                else:
                    Log.info(self, "PHP5-FPM is not installed")
            else:
                if EEAptGet.is_installed(self, 'php5.6-fpm'):
                    services = services + ['php5.6-fpm']
                else:
                    Log.info(self, "PHP5.6-FPM is not installed")

                if EEAptGet.is_installed(self, 'php7.0-fpm'):
                    services = services + ['php7.0-fpm']
                else:
                    Log.info(self, "PHP7.0-FPM is not installed")

        if self.app.pargs.php7:
            if EEVariables.ee_platform_codename == 'trusty':
                if EEAptGet.is_installed(self, 'php7.0-fpm'):
                    services = services + ['php7.0-fpm']
                else:
                    Log.info(self, "PHP7.0-FPM is not installed")
            else:
                Log.info(self, "Your platform does not support PHP 7")

        if self.app.pargs.mysql:
            if ((EEVariables.ee_mysql_host is "localhost") or
               (EEVariables.ee_mysql_host is "127.0.0.1")):
                if (EEAptGet.is_installed(self, 'mysql-server') or
                   EEAptGet.is_installed(self, 'percona-server-server-5.6') or
                   EEAptGet.is_installed(self, 'mariadb-server')):
                    services = services + ['mysql']
                else:
                    Log.info(self, "MySQL is not installed")
            else:
                Log.warn(self, "Remote MySQL found, "
                         "Unable to check MySQL service status")

        if self.app.pargs.postfix:
            if EEAptGet.is_installed(self, 'postfix'):
                services = services + ['postfix']
            else:
                Log.info(self, "Postfix is not installed")

        if self.app.pargs.hhvm:
            if EEAptGet.is_installed(self, 'hhvm'):
                services = services + ['hhvm']
            else:
                Log.info(self, "HHVM is not installed")
        if self.app.pargs.memcache:
            if EEAptGet.is_installed(self, 'memcached'):
                services = services + ['memcached']
            else:
                Log.info(self, "Memcache is not installed")

        if self.app.pargs.dovecot:
            if EEAptGet.is_installed(self, 'dovecot-core'):
                services = services + ['dovecot']
            else:
                Log.info(self, "Mail server is not installed")

        if self.app.pargs.redis:
            if EEAptGet.is_installed(self, 'redis-server'):
                services = services + ['redis-server']
            else:
                Log.info(self, "Redis server is not installed")

        for service in services:
            if EEService.get_service_status(self, service):
                Log.info(self, "{0:10}:  {1}".format(service, "Running"))
Ejemplo n.º 4
0
    def status(self):
        """Status of services"""
        services = []
        if not (self.app.pargs.nginx or self.app.pargs.php
                or self.app.pargs.mysql or self.app.pargs.postfix
                or self.app.pargs.hhvm or self.app.pargs.memcache
                or self.app.pargs.dovecot or self.app.pargs.redis):
            self.app.pargs.nginx = True
            self.app.pargs.php = True
            self.app.pargs.mysql = True
            self.app.pargs.postfix = True
            self.app.pargs.hhvm = True

        if self.app.pargs.nginx:
            if EEAptGet.is_installed(self,
                                     'nginx-custom') or EEAptGet.is_installed(
                                         self, 'nginx-mainline'):
                services = services + ['nginx']
            else:
                Log.info(self, "Nginx is not installed")

        if self.app.pargs.php:
            if EEAptGet.is_installed(self, 'php5-fpm'):
                services = services + ['php5-fpm']
            else:
                Log.info(self, "PHP5-FPM is not installed")

        if self.app.pargs.mysql:
            if ((EEVariables.ee_mysql_host is "localhost")
                    or (EEVariables.ee_mysql_host is "127.0.0.1")):
                if (EEAptGet.is_installed(self, 'mysql-server')
                        or EEAptGet.is_installed(self,
                                                 'percona-server-server-5.6')
                        or EEAptGet.is_installed(self, 'mariadb-server')):
                    services = services + ['mysql']
                else:
                    Log.info(self, "MySQL is not installed")
            else:
                Log.warn(
                    self, "Remote MySQL found, "
                    "Unable to check MySQL service status")

        if self.app.pargs.postfix:
            if EEAptGet.is_installed(self, 'postfix'):
                services = services + ['postfix']
            else:
                Log.info(self, "Postfix is not installed")

        if self.app.pargs.hhvm:
            if EEAptGet.is_installed(self, 'hhvm'):
                services = services + ['hhvm']
            else:
                Log.info(self, "HHVM is not installed")
        if self.app.pargs.memcache:
            if EEAptGet.is_installed(self, 'memcached'):
                services = services + ['memcached']
            else:
                Log.info(self, "Memcache is not installed")

        if self.app.pargs.dovecot:
            if EEAptGet.is_installed(self, 'dovecot-core'):
                services = services + ['dovecot']
            else:
                Log.info(self, "Mail server is not installed")

        if self.app.pargs.redis:
            if EEAptGet.is_installed(self, 'redis-server'):
                services = services + ['redis-server']
            else:
                Log.info(self, "Redis server is not installed")

        for service in services:
            if EEService.get_service_status(self, service):
                Log.info(self, "{0:10}:  {1}".format(service, "Running"))