-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplatform-info.pl
More file actions
executable file
·55 lines (43 loc) · 1.18 KB
/
platform-info.pl
File metadata and controls
executable file
·55 lines (43 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env bash
# All of this is better to get from 'facter' (part of puppet)
# real hostname
echo -e "\nReal hostname: "
hostname=`hostname`
ip=`host $hostname |cut -f 4 -d ' '`
realhost=`host $ip | cut -f 5 -d ' '`
echo -e "$realhost"
# OS version
echo -e "\nOperating system: "
os=`lsb_release -a | grep -i Description`
echo -e "$os"
# Number x Mhz of CPUs
echo -e "\nCPUs: "
cpus=`cat /proc/cpuinfo | egrep 'model name|cpu MHz'`
echo -e "\n$cpus"
# 64bit if 'lm' (long-mode) flag is present:
if cat /proc/cpuinfo | grep -q lm; then
echo " 64bit CPU architecture"
else
echo " 32bit CPU architecture"
fi
# Memory chip information
if [ -r /dev/mem ]; then
echo -e "\nMemory chips: "
chips=`dmidecode|perl -n -e '$on=1 if /Memory Device$/; $on=0 if /^$/;print if $on'`
echo -e "\n$chips"
fi
# Memory total/free
echo -e "\nMemory: "
mem=`free -m | grep '^Mem' | field 2`
echo -e "$mem MB"
echo -e "Swap space: "
swap=`free -m | grep '^Swap' | field 2`
echo -e "$swap MB"
# Disk partitions/usag
echo -e "\nDisk usage: "
df=`df -h`
echo -e "\n$df"
# Video card name and memory
echo -e "\nVideo:"
video=`lspci -v | grep 'VGA compatible controller'`
echo -e "\n$video"