예제 #1
0
 def _is_installed(stderr=False):
     env_dict = utilities.get_environment_file_dict()
     kibana_home = env_dict.get('KIBANA_HOME')
     if not kibana_home:
         if stderr:
             sys.stderr.write('[-] Kibana installation directory could not be located in '
                              '/etc/dynamite/environment.\n')
         return False
     if not os.path.exists(kibana_home):
         if stderr:
             sys.stderr.write('[-] Kibana installation directory could not be located at {}.\n'.format(
                 kibana_home))
         return False
     kibana_home_files_and_dirs = os.listdir(kibana_home)
     if 'bin' not in kibana_home_files_and_dirs:
         if stderr:
             sys.stderr.write('[-] Could not locate Kibana {}/bin directory.\n'.format(kibana_home))
         return False
     if 'webpackShims' not in kibana_home_files_and_dirs:
         if stderr:
             sys.stderr.write('[-] Could not locate Kibana {}/webpackShims directory.\n'.format(kibana_home))
         return False
     kibana_binaries = os.listdir(os.path.join(kibana_home, 'bin'))
     if 'kibana' not in kibana_binaries:
         if stderr:
             sys.stderr.write('[-] Could not locate Kibana binary in {}/bin/\n'.format(kibana_home))
         return False
     if not utilities.check_user_exists('dynamite'):
         sys.stderr.write('[-] dynamite user was not created.\n')
         return False
     return True
예제 #2
0
 def _is_installed(stderr=False):
     try:
         p = subprocess.Popen('jupyterhub --version', shell=True, stderr=subprocess.PIPE, stdout=subprocess.PIPE)
         p.communicate()
         if p.returncode != 0:
             sys.stderr.write('[-] Jupyterhub is not installed.\n')
             return False
         if not utilities.check_user_exists('jupyter'):
             sys.stderr.write('[-] jupyter user was not created.\n')
             return False
     except OSError:
         if stderr:
             sys.stderr.write('[-] Could not locate JupyterHub in $PATH.')
         return False
     return True
예제 #3
0
 def _is_installed(stderr=False):
     try:
         env_dict = utilities.get_environment_file_dict()
     except IOError:
         if stderr:
             sys.stderr.write(
                 '[-] ElasticSearch environment variables haven\'t been created.\n'
             )
         return False
     es_home = env_dict.get('ES_HOME')
     if not es_home:
         if stderr:
             sys.stderr.write(
                 '[-] ElasticSearch installation directory could not be located in '
                 '/etc/dynamite/environment.\n')
         return False
     if not os.path.exists(es_home):
         if stderr:
             sys.stderr.write(
                 '[-] ElasticSearch installation directory could not be located at {}.\n'
                 .format(es_home))
         return False
     es_home_files_and_dirs = os.listdir(es_home)
     if 'bin' not in es_home_files_and_dirs:
         if stderr:
             sys.stderr.write(
                 '[-] Could not locate ElasticSearch {}/bin directory.\n'.
                 format(es_home))
         return False
     if 'lib' not in es_home_files_and_dirs:
         if stderr:
             sys.stderr.write(
                 '[-] Could not locate ElasticSearch {}/lib directory.\n'.
                 format(es_home))
         return False
     es_binaries = os.listdir(os.path.join(es_home, 'bin'))
     if 'elasticsearch' not in es_binaries:
         if stderr:
             sys.stderr.write(
                 '[-] Could not locate ElasticSearch binary in {}/bin/\n'.
                 format(es_home))
         return False
     if not utilities.check_user_exists('dynamite'):
         sys.stderr.write('[-] dynamite user was not created.\n')
         return False
     return True
예제 #4
0
 def _is_installed(stderr=False):
     env_dict = utilities.get_environment_file_dict()
     ls_home = env_dict.get('LS_HOME')
     if not ls_home:
         if stderr:
             sys.stderr.write(
                 '[-] LogStash installation directory could not be located in '
                 '/etc/dynamite/environment.\n')
         return False
     if not os.path.exists(ls_home):
         if stderr:
             sys.stderr.write(
                 '[-] LogStash installation directory could not be located at {}.\n'
                 .format(ls_home))
         return False
     ls_home_files_and_dirs = os.listdir(ls_home)
     if 'bin' not in ls_home_files_and_dirs:
         if stderr:
             sys.stderr.write(
                 '[-] Could not locate LogStash {}/bin directory.\n'.format(
                     ls_home))
         return False
     if 'lib' not in ls_home_files_and_dirs:
         if stderr:
             sys.stderr.write(
                 '[-] Could not locate LogStash {}/lib directory.\n'.format(
                     ls_home))
         return False
     ls_binaries = os.listdir(os.path.join(ls_home, 'bin'))
     if 'logstash' not in ls_binaries:
         if stderr:
             sys.stderr.write(
                 '[-] Could not locate LogStash binary in {}/bin/\n'.format(
                     ls_home))
         return False
     if not utilities.check_user_exists('dynamite'):
         sys.stderr.write('[-] dynamite user was not created.\n')
         return False
     return True