Solved

I am writing a script for rh4.8 and I need to know commands that will tell me about the box

Posted on 2010-08-31
6
391 Views
Last Modified: 2012-05-10
I need to store information for rebuilt, recovery & moveing systems.

We are on a closed network so we can not add software, just scripts.

see if you can spot any good stuff I have missed.

#! /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 hostanme and (SS)

#       Echo the results of (SS)

#       Echo a stop marker just like the start marker

#       except the start 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}



}







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/redhat-release"

doo "cat /etc/resolv.conf"

doo "cat /etc/services"

doo "cat /etc/sudoers"

doo "cat /etc/sysconfig/network"

doo "cat /etc/sysctl.conf"

doo "cat /etc/xinetd.conf"

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 "rpm -qa"

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
6 Comments
 
LVL 16

Expert Comment

by:santoshmotwani
ID: 33572878
Try Sydi

It will make your job bit easier
0
 
LVL 16

Accepted Solution

by:
santoshmotwani earned 167 total points
ID: 33572917
0
 
LVL 77

Expert Comment

by:arnold
ID: 33573547
Can you add a satellite server?
http://www.redhat.com/docs/manuals/RHNetwork/satellite/4.1.0/s1-intro-sat.html

You would then be able to bring software for update or configure a new system with the matching packages.
netstat -a and netstat -an merely will indicate what connections exist at the time of the run.

Are these systems monitored via SNMP?
You could use that by setting up an OID that will run a specific command to generate output.

You are running commands that deals with a snapshot of what is running on the system.

0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 

Author Comment

by:TIMFOX123
ID: 33576819
Can I add a satalite server ?

Good idea howver I can not and also this is a windows/linux/solaris solution.

I can run scripts on all the above.

0
 
LVL 19

Assisted Solution

by:jools
jools earned 167 total points
ID: 33577429
for some hardware information:
dmidecode
hal-device
/proc/meminfo

Firewall stuff:
iptables -vL

Prolly loads more too!
0
 
LVL 77

Assisted Solution

by:arnold
arnold earned 166 total points
ID: 33579068
Are these systems monitored via SNMP or nagios?
rpm -qa will take a snapshot of installed packages and their versions.

The other alternative is to actually setup a backup server bacula.org.

instead of running mount, cat /etc/fstab
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Suggested Solutions

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

863 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now