1#!/bin/bash 2# 3# $Id: hardwareReport.sh 421 2007-04-05 15:46:55Z dhill $ 4# 5if [ $1 ] ; then 6 MODULE=$1 7else 8 MODULE="pm1" 9fi 10 11if [ $2 ] ; then 12 OUT_FILE=$2 13else 14 OUT_FILE=${MODULE}_logReport.txt 15fi 16 17{ 18echo " " 19echo "******************** Configuration/Status Report for ${MODULE} ********************" 20echo " " 21 22chkconfig=`which chkconfig 2>/dev/null` 23if [ -n "$chkconfig" ]; then 24 echo "-- chkconfig configuration --" 25 echo " " 26 echo "################# chkconfig --list | grep columnstore #################" 27 echo " " 28 chkconfig --list | grep columnstore 2>/dev/null 29fi 30 31systemctl=`which systemctl 2>/dev/null` 32if [ -n "$systemctl" ]; then 33 echo "-- systemctl configuration --" 34 echo " " 35 echo "################# systemctl list-unit-files --type=service | grep columnstore #################" 36 echo " " 37 systemctl list-unit-files --type=service | grep columnstore 2>/dev/null 38 echo "################# systemctl list-unit-files --type=service | grep mariadb #################" 39 echo " " 40 systemctl list-unit-files --type=service | grep mariadb 2>/dev/null 41fi 42 43updaterc=`which update-rc.d 2>/dev/null` 44if [ -n "$updaterc" ]; then 45 echo "-- services configuration --" 46 echo " " 47 echo "################# service --status-all | grep columnstore #################" 48 echo " " 49 service --status-all | grep columnstore 2>/dev/null 50fi 51 52 53echo " " 54echo "-- fstab Configuration --" 55echo " " 56echo "################# cat /etc/fstab #################" 57echo " " 58cat /etc/fstab 2>/dev/null 59 60echo " " 61echo "-- Server Processes --" 62echo " " 63echo "################# ps axu #################" 64echo " " 65ps axu 66 67echo " " 68echo "-- Server Processes with resource usage --" 69echo " " 70echo "################# top -b -n 1 #################" 71echo " " 72top -b -n 1 73 74} >> $OUT_FILE 75 76exit 0 77