- Community Home
- >
- Servers and Operating Systems
- >
- Operating System - Linux
- >
- System Administration
- >
- Re: shell script help in RHEL 5.4
-
- Forums
-
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
- HPE Blog, Austria, Germany & Switzerland
- Blog HPE, France
- HPE Blog, Italy
- HPE Blog, Japan
- HPE Blog, Middle East
- HPE Blog, Russia
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
-
Blogs
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Blog, Latin America
- HPE Blog, Middle East
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
-
Information
- Community
- Welcome
- Getting Started
- FAQ
- Ranking Overview
- Rules of Participation
- Tips and Tricks
- Resources
- Announcements
- Email us
- Feedback
- Information Libraries
- Integrated Systems
- Networking
- Servers
- Storage
- Other HPE Sites
- Support Center
- Aruba Airheads Community
- Enterprise.nxt
- HPE Dev Community
- Cloud28+ Community
- Marketplace
-
Forums
-
Blogs
-
Information
-
English
- 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
- Email to a Friend
- 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
- Email to a Friend
- 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
- Email to a Friend
- 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.
Hewlett Packard Enterprise International
- Communities
- HPE Blogs and Forum
© Copyright 2021 Hewlett Packard Enterprise Development LP