@@ -0,0 +1,2427 @@
+import sys%0Aimport argparse%0Afrom subprocess import Popen, PIPE%0A%0A%0Adef parse_args():%0A    parser = argparse.ArgumentParser()%0A    parser.add_argument(%22--vertica_password%22,%0A                        help=%22Vertica password for disk.sh and alarm_transitions.sh%22, default='password',%0A                        required=False)%0A    return parser.parse_args()%0A%0A%0Adef split_result(results):%0A    result_dict = %5B%5D%0A    results = results.split(%22%5Cn%22)%0A    column_names = results.pop(0).split(%22,%22)%0A    for result in results:%0A        result_dict.append(zip(column_names, result.split(%22,%22)))%0A    return result_dict%0A%0A%0Adef run_query(vertica_base_query, vertica_query):%0A    vertica_base_query.append(vertica_query)%0A    query = Popen(vertica_base_query, stdout=PIPE, stderr=PIPE)%0A    result, error_output = query.communicate()%0A    return result%0A%0A%0Adef parse_projection_stats(stats):%0A    print stats%0A%0A%0Adef parse_resource_rejections(rejections):%0A    print rejections%0A%0A%0Adef parse_resource_usage(usage):%0A    print usage%0A%0A%0Adef main():%0A    args = parse_args()%0A    # vertica_base_query =%5B%22/opt/vertica/bin/vsql%22, %22-U%22, %22dbadmin%22, %22-w%22,  args.vertica_password, %22-A%22, %22-F%22, %22,%22, %22-c%22%5D%0A    vertica_base_query =%5B%22/opt/vertica/bin/vsql%22, %22-U%22, %22dbadmin%22, %22-w%22,  args.vertica_password, %22-c%22%5D%0A    parse_projection_stats(run_query(list(vertica_base_query), %22select node_name, projection_name, projection_schema, %22%0A                                                               %22wos_used_bytes, ros_used_bytes, ros_count from %22%0A                                                               %22projection_storage%22))%0A    parse_resource_rejections(run_query(list(vertica_base_query), %22select * from resource_rejections%22))%0A    parse_resource_usage(run_query(list(vertica_base_query), %22select node_name, request_queue_depth, %22%0A                                                             %22active_thread_count, open_file_handle_count, %22%0A                                                             %22wos_used_bytes, ros_used_bytes, %22%0A                                                             %22resource_request_reject_count, %22%0A                                                             %22resource_request_timeout_count, %22%0A                                                             %22disk_space_request_reject_count, %22%0A                                                             %22failed_volume_reject_count from resource_usage%22))%0A%0Aif __name__ == %22__main__%22:%0A    sys.exit(main())%0A

Add script to query vertica stats