Quantcast
Channel: Linux on the mainframe
Viewing all articles
Browse latest Browse all 18

Getting a quick systeminfo for a linuxguest on s390x

$
0
0

For the purpose of getting a quick overview of the current linux instance you're working with I wrote a small script which shows me the most important information I need. Amongs other things the script also check the kind of disks (DASD, SCSI). I suggest that you modifiy the script for your requirements. Here an example:

SLES11FT:/srv/ftp/configs # systeminfo

-----------------------------------------------------------------------
SUSE Linux Enterprise Server 11 (s390x) VERSION = 11 PATCHLEVEL = 0
-----------------------------------------------------------------------
Hostname: SLES11FT.tec.zlinux
-----------------------------------------------------------------------
Current IP address:
inet 10.199.10.50/24 brd 10.199.10.255 scope global eth0
-----------------------------------------------------------------------
MemTotal: 1020836 kB
-----------------------------------------------------------------------
Report file system disk space usage:
Filesystem Size Used Avail Use% Mounted on
/dev/dm-2 20G 4.4G 15G 24% /
udev 499M 116K 499M 1% /dev
/dev/sda1 190M 31M 150M 17% /boot
/dev/dm-0 9.9G 3.4G 6.0G 36% /home
/dev/dm-1 20G 483M 19G 3% /opt
/dev/mapper/vg00-lvsrv
99G 62G 32G 66% /srv
/dev/mapper/vg00-lvtmp
5.0G 171M 4.6G 4% /tmp
/dev/loop0 4.2G 4.2G 0 100% /srv/ftp/centos62
/dev/loop1 2.6G 2.6G 0 100% /srv/ftp/rhel6
-----------------------------------------------------------------------
uname -a:
Linux SLES11FT 2.6.27.19-5-default #1 SMP 2009-02-28 04:40:21 +0100 s390x s390x s390x GNU/Linux
-----------------------------------------------------------------------
No DASDs available!
-----------------------------------------------------------------------
0.0.5108/0x500507630713c79e/0x4010400000000000 0:0:0:1073758224
-----------------------------------------------------------------------


And here the script listing:


#! /bin/bash

# Script:'systeminfo' from Daniel Schwarzentruber, created on Wed, 7. Sep 2011

Suserelease="/etc/SuSE-release"
Redhatrelease="/etc/redhat-release"
Zfcp=$(lszfcp -D |egrep '^Error' | cut -f 1 -d ":")
Lsdasd=$(lsdasd |grep dasd)

clear
echo -----------------------------------------------------------------------
# check if the file is available
if [ -f "/etc/SuSE-release" ]
then
Suse=$(cat $Suserelease)
echo $Suse
else if [ -f $Redhatrelease ]
then
Rhel=$(cat $Redhatrelease)
echo $Rhel
else
echo "OMG - no entry found!" && exit 1
fi
fi
echo -----------------------------------------------------------------------
if [ -f "/etc/sysconfig/network" ]
then
Hostbez=$(cat /etc/sysconfig/network)
cat /etc/sysconfig/network |grep HOSTNAME
else if [ -f "/etc/HOSTNAME" ]
then
Hostbez=$(cat /etc/HOSTNAME )
echo "Hostname: "$Hostbez
else
echo "No HOSTNAME found!"
fi
fi
echo -----------------------------------------------------------------------
IPaddress=$(ip addr show |grep global |grep eth0)
echo Current IP address:
echo $IPaddress
echo -----------------------------------------------------------------------
Storagetotal=$(cat /proc/meminfo |grep MemTotal:)
echo $Storagetotal
echo -----------------------------------------------------------------------
# report file system disk space usage
echo "Report file system disk space usage:"
#Dfh=$(df -lh)
#
# echo $Dfh
df -lh
echo -----------------------------------------------------------------------
# chkconfig --list |grep 3:on
echo "uname -a:"
uname -a
echo -----------------------------------------------------------------------
if [ -z $Lsdasd ]
then
echo "No DASDs available!"
else
lsdasd
fi
echo -----------------------------------------------------------------------
if [ "$Zfcp" != "Error" ];
then
# echo "FCP WWPN LUN"
lszfcp -D
else
echo "No FCP Devices found."
fi
echo -----------------------------------------------------------------------
exit 0

The post Getting a quick systeminfo for a linuxguest on s390x appeared first on Linux on the mainframe.


Viewing all articles
Browse latest Browse all 18

Trending Articles