HBASE-24632 Enable procedure-based log splitting as default in hbase3 Add deprecation...
[hbase.git] / dev-support / gather_machine_environment.sh
blob5506bfcc1b28053314c82b966e7aa5343fdb151e
1 #!/usr/bin/env bash
2 # Licensed to the Apache Software Foundation (ASF) under one
3 # or more contributor license agreements. See the NOTICE file
4 # distributed with this work for additional information
5 # regarding copyright ownership. The ASF licenses this file
6 # to you under the Apache License, Version 2.0 (the
7 # "License"); you may not use this file except in compliance
8 # with the License. You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing,
13 # software distributed under the License is distributed on an
14 # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 # KIND, either express or implied. See the License for the
16 # specific language governing permissions and limitations
17 # under the License.
19 set -e
20 function usage {
21 echo "Usage: ${0} /path/for/output/dir"
22 echo ""
23 echo " Gather info about a build machine that test harnesses should poll before running."
24 echo " presumes you'll then archive the passed output dir."
26 exit 1
29 if [ "$#" -lt 1 ]; then
30 usage
34 declare output=$1
36 if [ ! -d "${output}" ] || [ ! -w "${output}" ]; then
37 echo "Specified output directory must exist and be writable." >&2
38 exit 1
41 echo "getting machine specs, find in ${BUILD_URL}/artifact/${output}/"
42 echo "JAVA_HOME: ${JAVA_HOME}" >"${output}/java_home" 2>&1 || true
43 ls -l "${JAVA_HOME}" >"${output}/java_home_ls" 2>&1 || true
44 echo "MAVEN_HOME: ${MAVEN_HOME}" >"${output}/mvn_home" 2>&1 || true
45 mvn --offline --version >"${output}/mvn_version" 2>&1 || true
46 cat /proc/cpuinfo >"${output}/cpuinfo" 2>&1 || true
47 cat /proc/meminfo >"${output}/meminfo" 2>&1 || true
48 cat /proc/diskstats >"${output}/diskstats" 2>&1 || true
49 cat /sys/block/sda/stat >"${output}/sys-block-sda-stat" 2>&1 || true
50 df -h >"${output}/df-h" 2>&1 || true
51 ps -Aww >"${output}/ps-Aww" 2>&1 || true
52 ifconfig -a >"${output}/ifconfig-a" 2>&1 || true
53 lsblk -ta >"${output}/lsblk-ta" 2>&1 || true
54 lsblk -fa >"${output}/lsblk-fa" 2>&1 || true
55 ulimit -a >"${output}/ulimit-a" 2>&1 || true
56 uptime >"${output}/uptime" 2>&1 || true