- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: shell script help in RHEL 5.4
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2012 03:05 AM
08-03-2012 03:05 AM
shell script help in RHEL 5.4
Hi ,
i need to collect the below system information , please find the commands and provide the shell script.
commands
df
crontab
vg details
sendmail
dmesg
ioscan
free -g
top
sar
vmstat
iostat
ifconfig -a
uname -m
uanme -r
runlevel
rpm -ql pakage
the above commands we need to collect ,each and every server. we need the final output testserver.tar.qz
- Tags:
- Monitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2012 06:38 AM
08-03-2012 06:38 AM
Re: shell script help in RHEL 5.4
Something like this maybe:
# cat script.sh
#!/bin/bash
HOST=$(hostname)
mkdir /tmp/${HOST}-data
cd /tmp/${HOST}-data
df > ${HOST}-df
crontab -l > ${HOST}-crontab
vgdisplay -v > ${HOST}-vgdisplay
cp /etc/mail/sendmail.cf ${HOST}-sendmail.cf
dmesg > ${HOST}-dmesg
free -g > ${HOST}-free
top -n 1 > ${HOST}-top
vmstat > ${HOST}-vmstat
iostat > ${HOST}-iostat
ifconfig -a > ${HOST}-ifconfig
uname -m > ${HOST}-uname-m
uname -r > ${HOST}-uname-r
runlevel > ${HOST}-runlevel
tar -cvzf ${HOST}.tar.gz ${HOST}-*
There are a couple of commands that you need to look at and determine exactly what you need.
For example the 'sar' command has a lot of options. Which ones do you want output from?
The 'rpm - ql' command requires a package name as an option. Which packages do you want information on?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2012 11:00 PM
08-05-2012 11:00 PM
Re: shell script help in RHEL 5.4
thanks you very much for providing the script.