Locate Dell Service Tag: Difference between revisions

From KlavoWiki
Jump to navigationJump to search
Line 19: Line 19:
ram=$(dmidecode -t 17 | awk '( /Size/ && $2 ~ /^[0-9]+$/ ) { x+=$2 } END{ print x "MB"}')
ram=$(dmidecode -t 17 | awk '( /Size/ && $2 ~ /^[0-9]+$/ ) { x+=$2 } END{ print x "MB"}')
os=$(cat /etc/redhat-release)
os=$(cat /etc/redhat-release)
kern=$(uname -r)


echo
echo
Line 30: Line 31:
echo -e '        RAM :' $ram
echo -e '        RAM :' $ram
echo -e '        OS :' $os
echo -e '        OS :' $os
echo -e '    Kernel :' $kern
echo
echo
echo
echo

Revision as of 03:44, 19 July 2016

Linux Platform

yum -y install dmidecode
dmidecode -s system-serial-number

Script

#!/bin/bash

model=$(dmidecode -s system-product-name)
tag=$(dmidecode -s system-serial-number)
bios=$(dmidecode -s bios-version)
cpu=$(dmidecode -s  processor-version)
hn=$(hostname)
ram=$(dmidecode -t 17 | awk '( /Size/ && $2 ~ /^[0-9]+$/ ) { x+=$2 } END{ print x "MB"}')
os=$(cat /etc/redhat-release)
kern=$(uname -r)

echo
echo '================================='
echo -e ' ' $model
echo '================================='
echo -e '   Hostname :' $hn
echo -e 'Service Tag :' $tag
echo -e '       BIOS :' $bios
echo -e '        CPU :' $cpu
echo -e '        RAM :' $ram
echo -e '         OS :' $os
echo -e '     Kernel :' $kern
echo
echo

Windows Platform

From a Command Prompt

wmic bios get serialnumber