How to Capture Qshell Output in a Separate File

Overview

If you need to collect large outputs of qshell commands, you can use the following procedure to redirect the output to a separate file, making it much easier to read.

 


Procedure

To redirect Qshell output to a separate file:

 

  1. Log into the management controller node as root.
  1. Exit out of OSMI by entering 0 (zero). 
  1. Enter the following to print a list of namespaces and their details:

qshell -c "print q.dss.manage.listNameSpaces()" | sed -e 's/, /\n/g'

 

  1. Redirect the output to a separate file:

# qshell -c "print q.dss.manage.listNameSpaces()" | sed -e 's/, /\n/g' > /output_file.txt

 

 

  1. Reformat the output so it's easier to read:

# echo "q.dss.manage.listNameSpaces()" | qshell > output_file.txt

 

Note: This is only one example of how to reformat the output. Pulling Qshell output and directing into a separate file may require some trial and error to figure out what works best.

 

  1. View the output file:

# ls

# more output_file.txt

 

The informaton in the output displays:

 

In [1]: Out[1]:
{'_metastorebackup': {'creation_date': 'Aug 13 2015 10:56:22.6454',
                      'custom': {},
                      'encryption_policy_id_scheme': None,
                      'id': '481e6398e9ec4553b01f918349322cf3',
                      'kind': 'NATIVE',
                      'master_node_id': 9,
                      'name': '_metastorebackup',
                      'nslocid': 0,
                      'owner_id': None,
                      'permission_settings': {'flags': ['INHERIT'],
                                              'user_permissions': {0: ['DELETE',
                                                                       'CREATE']
}},
                      'policy_id': 'b8a932fd945a4cfca0f445a740717c79',
                      'seq': 0,
                      'small_files_policy_id_and_threshold': None,
                      'ss_loc': 0,
                      'status': 'OK',
                      'syncstore_id': 'a8d9f9146a1e4b11b69999d8011fb95a',
                      'verification_interval': 31536000,
                      'verification_target_date': 'Sep 19 2017 02:32:45.2405',
                      'version': 1},
 '_osis_model_backup': {'creation_date': 'Aug 13 2015 10:56:09.8474',
                        'custom': {},
                        'encryption_policy_id_scheme': None,
                        'id': '969f1e6a0f484b86b0ed05e74b6e8035',
                        'kind': 'NATIVE',
                        'master_node_id': 10,
                        'name': '_osis_model_backup',
                        'nslocid': 0,
                        'owner_id': None,
                        'permission_settings': {'flags': ['INHERIT'],
                                                'user_permissions': {}},
                        'policy_id': 'b8a932fd945a4cfca0f445a740717c79',
                        'seq': 0,
                        'small_files_policy_id_and_threshold': None,
                        'ss_loc': 0,
                        'status': 'OK',
                        'syncstore_id': 'a8d9f9146a1e4b11b69999d8011fb95a',
                        'verification_interval': 31536000,
                        'verification_target_date': 'Sep 19 2017 04:32:12.6142',
                        'version': 1},
 'data1': {'creation_date': 'Aug 13 2015 10:55:45.0550',
           'custom': {},
           'encryption_policy_id_scheme': None,
           'id': 'cc40063f584d499d8606dad9562a45d6',
           'kind': 'NATIVE',
           'master_node_id': 4,
           'name': 'data1',
           'nslocid': 0,
           'owner_id': None,
           'permission_settings': {'flags': ['INHERIT'],
                                   'user_permissions': {}},
           'policy_id': 'b8a932fd945a4cfca0f445a740717c79',
           'seq': 0,
           'small_files_policy_id_and_threshold': None,
           'ss_loc': 0,
           'status': 'OK',
           'syncstore_id': 'a8d9f9146a1e4b11b69999d8011fb95a',
           'verification_interval': 31536000,
           'verification_target_date': 'Aug 12 2016 10:55:45.0547',
           'version': 1}}

 

 


 

 

 



This page was generated by the BrainKeeper Enterprise Wiki, © 2018