LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-11-2008, 05:49 AM   #1
permalac
Member
 
Registered: Jul 2007
Location: Barcelona
Posts: 115

Rep: Reputation: 16
script to report some host information


hello,

one day I needed to send some info to a partner about our servers, and I prepared a script to make the info easier to get and send.

Now I just want to share it, it's not a hard script but somebody can find it useful.

Code:
#/bin/bash

exec 1>`hostname`_report.txt
exec 2>/dev/null


echo ----------------------------------------------------------------------
echo " Report of  `hostname`  (`date`)"
echo ----------------------------------------------------------------------
echo

echo --- OS ----
lsb_release
uname -a
echo ----------------------------------

echo
echo
echo " Hardware"
echo ----------------------------------------------------------------------
echo
echo --- CPU ---
cat /proc/cpuinfo | grep -A7 processor | tail -8
cat /proc/cpuinfo | grep -A1 flags | tail -2
echo
echo --- Virtualizacion--
(grep pae /proc/cpuinfo 1>/dev/null && echo CPU ParaVirtualization OK ) || echo CPU ParaVirtualization NO
(egrep "vmx|svm" /proc/cpuinfo 1>/dev/null && echo CPU FullVirtualization OK ) || echo CPU FullVirtualization NO
(grep hvm /sys/hypervisor/properties/capabilities 1>/dev/null && echo BIOS FullVirtualization OK) || echo BIOS FullVirtualization NO
echo
echo --- RAM ---
free -m
echo

echo
echo
echo " NETWORK"
echo ----------------------------------------------------------------------
echo
echo --- IPs ---
ip addr | grep -B2 inet | egrep -v "127.0.0.|loopback|lo:|--"
echo
echo --- Route ---
ip route
echo
echo --- /etc/resolv.conf ---
cat /etc/resolv.conf
echo

echo
echo
echo " Filesystem"
echo ----------------------------------------------------------------------
echo
echo --- Partitions  ---
fdisk -l
echo
echo --- file systems  ---
df -hT
echo
echo --- mount points ---
mount
echo
echo --- /proc/swaps ---
cat /proc/swaps
echo
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Script for getting host information,disk usage and all details o/p should be in html kishorem666 Linux - Server 4 09-17-2008 09:30 AM
host information in a LAN sniffer_raghav Linux - Networking 2 05-20-2008 01:41 PM
DDNS in router does not renew IP address; host and dig report incorrect IP Bruce Hill Linux - Networking 9 10-19-2006 04:10 PM
system information report sphynx Linux - General 1 03-05-2005 01:15 PM
Wich files contain IP and host information? sawoy Linux - Newbie 3 03-04-2004 12:04 PM


All times are GMT -5. The time now is 08:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration