[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

looking for good things to add to a bash script for redhat 5 to tell us all we need to know about a box

Posted on 2010-08-31
2
Medium Priority
?
853 Views
Last Modified: 2012-05-10
I work in a closed network and we can not just add software to the boxes.  I can however add a bash script.  

We need to store network information for all reasons, rebuild, move, desaster recovery etc.

Can anybody suggest commands they like that work on redhat 5 that are not on the list ?/
#! /bin/bash

hostname=${HOSTNAME}
output=output.txt

#########
#       The purpose of this function it to recive a shell command string (SS)
#       Echo a begin marker with hostname and (SS)
#       Echo the results of (SS)
#       Echo a end marker just like the start marker
#       except the begin marker has "b" and the end has "e"
#
#########



# clear out old output.txt
echo > ${output}

function doo(){

echo "tqf####~"$hostname"~${1}~b~####" >> ${output}
echo  >> ${output}

${1}  >> ${output}

echo  >> ${output}
echo "tqf####~"$hostname"~${1}~e~####" >> ${output}
echo  >> ${output}

}

## note all commands commented out were try and did not work on REDHAT 5.5.  
## most of the commented out commands are likely for solaris or software I do not have on my redhat 5.5 system

# add ethtool
#doo "/etc/init.d/nettune"
#doo "/opt/MLsan/inq"
#doo "/opt/MLsan/vxinq"
#doo "/sbin/vxprint"
#doo "/usr/sbin/dmidecode"
#doo "cat /.build_version"
#doo "cat /.cmeinfo"
#doo "cat /etc/VRTSvcs/conf/config/main.cf"
#doo "cat /etc/VRTSvcs/conf/config/types.cf"
#doo "cat /nsr/res/servers"
#doo "cat /usr/sbin/lpfc/lputil"
#doo "cat/sbin/powermt"
#doo "eeprom"
#doo "pkginfo -l"
#doo "raidctl -c  -r"
#doo "vastool -v"
doo "/bin/df"
doo "/bin/netstat"
doo "/bin/ps"
doo "/bin/uname"
doo "/sbin/arp"
doo "/sbin/chkconfig --list"
doo "/sbin/ifconfig"
doo "/sbin/sysctl"
doo "/usr/bin/ipcs"
doo "/usr/bin/uptime"
doo "cat /etc/auto.master"
doo "cat /etc/efs.conf"
doo "cat /etc/exports"
doo "cat /etc/fstab"
doo "cat /etc/hosts"
doo "cat /etc/nsswitch.conf"
doo "cat /etc/ntp.conf"
doo "cat /etc/passwd"
doo "cat /etc/resolv.conf"
doo "cat /etc/services"
doo "cat /etc/sudoers"
doo "cat /etc/sysconfig/network"
doo "cat /etc/sysconfig/network-scripts/ifcfg-eth0"
doo "cat /etc/sysconfig/network-scripts/ifcfg-eth1"
doo "cat /etc/sysconfig/network-scripts/ifcfg-eth2"
doo "cat /etc/sysconfig/network-scripts/ifcfg-eth3"
doo "cat /etc/sysconfig/network-scripts/ifcfg-eth4"
doo "cat /etc/sysconfig/network-scripts/ifcfg-eth5"
doo "cat /etc/sysconfig/network-scripts/ifcfg-lo"
doo "cat /etc/sysctl.conf"
doo "cat /etc/xinetd.conf"
doo "cat /mlextras/teamquest/manager/bin/tqmgr"
doo "cat /proc/cpuinfo"
doo "chkconfig --list"
doo "crontab -l"
doo "df -k"
doo "domainname"
doo "ifconfig -a"
doo "ls -d"
doo "ls -l"
doo "mount"
doo "netstat -a"
doo "netstat -an"
doo "netstat -ng"
doo "netstat -tnlupan"
doo "ps -ef"
doo "ps -ef"
doo "top -n1"
doo "uname -a"
doo "uname -r"
doo "uname"
doo "vmstat"
doo "ypwhich -m"
doo "yum list installed"

Open in new window

0
Comment
Question by:TIMFOX123
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 3

Accepted Solution

by:
egarciat earned 2000 total points
ID: 33570247
What about:

/etc/passwd-
/etc/shadow
/etc/shadow-

fdisk -l /dev/YOURBOOTDEVICE
fdisk -l /dev/YOUROTHERSTORAGEDEVICES

/etc/syslog.conf


0
 
LVL 2

Expert Comment

by:idalian
ID: 33570303
Hi there,

Looks like you are going for a *lot* of information there. I guess you need as much as you can for DR purposes, so I won't question what you will or won't need.  But, if you do have a question about info that may be superfluous, please ask. (like cat /etc/services)

Some of the ones I use a lot and don't see there:

  lsmod = shows loaded kernel modules (helpful with hardware drivers)
  lspci = shows PCI devices (also helpful w/ hardware)
  cat /proc/meminfo = memory info
  netstat -nr = configured IP routes
 
I noticed that some lines may be redundant:
Line 91,92: ls will only list the current directory you are in (or running the script from)
Line 101-103:  You get all you need with uname -a

Hope this helps!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Suggested Courses
Course of the Month12 days, 15 hours left to enroll

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question