FastHandle - IT Operations Examples

FastHandle is fast operation tools for infrastructure configurations and tests.

User Tools

Site Tools


Top     SiteMap

Sidebar


Top     SiteMap

Manager Server

Target Server

$FHHOME/bin/xxx.sh | xxxx.exp













.

os:linux:get:scripts:systeminfo.sh.html



Linux Operation with Fabric (ope.py)

systeminfo.sh

$FHHOME/target/scripts/systeminfo.sh

#!/bin/bash
#==============================================================================
# systeminfo.sh
#
# How to use
#     systeminfo.sh  2>/dev/null
#==============================================================================

LANG=C

#==============================================================================
# Function
#==============================================================================


#==============================================================================
# Main
#==============================================================================
cat << @
## hostname ####
`hostname`

## uname -a ####
`uname -a`

## cat /etc/redhat-release ####
`cat /etc/redhat-release`

#----------------------------------------------------------
# Hardware
#----------------------------------------------------------
## The number of Processors like top command
## cat /proc/cpuinfo | grep processor |wc -l ####
`cat /proc/cpuinfo | grep processor |wc -l`

## The number of total core
## cat /proc/cpuinfo |grep "cpu cores" | perl -e 'while(<>){$n+=/(\d+)/?$1:0;}print"$n\n";' ####
`cat /proc/cpuinfo |grep "cpu cores" | perl -e 'while(<>){$n+=/(\d+)/?$1:0;}print"$n\n";'`


## cat /proc/meminfo  |egrep "MemTotal|SwapTotal" ####
`cat /proc/meminfo  |egrep "MemTotal|SwapTotal"`

## df -h  |grep -v tmpfs
`df -h  |grep -v tmpfs`

## mount | egrep ^/dev ####
`mount | egrep "^/dev|nfs"`


#----------------------------------------------------------
# Networking
#----------------------------------------------------------
## cat /etc/sysconfig/static-routes ####
`cat /etc/sysconfig/static-routes`


## ip a |egrep "mtu|inet" |grep -v inet6 ####
`ip a |egrep "mtu|inet" |grep -v inet6`


#----------------------------------------------------------
# Package
#----------------------------------------------------------
## which rpm > /dev/null 2>&1 && rpm -qa --qf '%{name}\n' |sort ####
`which rpm > /dev/null 2>&1 && rpm -qa --qf '%{name}\n' |sort`

@





Linux Operation with Fabric (ope.py)




os/linux/get/scripts/systeminfo.sh.html.txt ยท Last modified: 2018/02/04 23:58 by kurihara