Locate Dell Service Tag

From KlavoWiki
Jump to navigationJump to search

Linux Platform

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

Script

vi /usr/bin/details
#!/bin/bash

boot=$(uptime -s)
up=$(uptime -p)
zone=$(date +%Z )
gmt=$(date +%z)

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 'System Boot :' $boot ' ('$zone','$gmt')'
echo -e '     Uptime :' $up
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
chmod +x /usr/bin/details

Windows Platform

From a Command Prompt

wmic bios get serialnumber