- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Another Script question
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
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
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
тАО10-30-2001 09:27 AM
тАО10-30-2001 09:27 AM
tail -1 ppm_1001 >> Vito
tail -1 ppm_1002 >> Vito
tail -l ppm_1003 >> Vito
I have 10 systems to do this on. What am i missing to incorporate this for 30 days and for each of my systems?
So far, everyone has done great giving me feedback, but im having a mental block right now trying to figure this out?
Please advise?
Vito
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-30-2001 09:36 AM
тАО10-30-2001 09:36 AM
SolutionNFS - Export 1 filesystem and mount on the other 9. Write all your data to that filesystem
RCP - Using rcp, you could copy the data files to one location and process there.
If you are using "cron" on each of the 10 systems, you could schedule a script that would pull the data together and then put it to a central system.
To get the data to a PC, you could either ftp or use SAMBA and mount the filesystem on your PC.
Note- If you write your data comma seperated and name the file with .CSV extension, you can open it up in M$ EXCEL by opening the file from your PC.
Their are other methods available, but I think these are the most common.
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-30-2001 09:38 AM
тАО10-30-2001 09:38 AM
Re: Another Script question
do
tail -1 $i
done >> vito
In the other thread, I also gave you the awk syntax to generate your summary line.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-30-2001 09:47 AM
тАО10-30-2001 09:47 AM
Re: Another Script question
I din't understand your requirement
well. Do you want to have the sar Averages of all the Systems for 30days into a single file?. Then it is three dimensional. However, you can have sar reports of each system in one file so you will get 10 files of data.
Incorporate this script in job to run at 11:49 everyday. This has to run after your system_mmdd file gets created.
//END
#!/usr/bin/ksh
HOST=`hostname`
DATED=`date +%m%d`
MONTH=`date +%m%Y`
DATE=`date +%m-%d-%Y`
FILE=${HOST}_$DATED
RESULT=/some_where/result.$MONTH
if [ ! -f $RESULT ]
then
echo " DATE %usr %sys %WIO %IDLE" >> $RESULT
fi
USR=`grep Average $FILE|awk '{print $2}'`
SYS=`grep Average $FILE|awk '{print $3}'`
WIO=`grep Average $FILE|awk '{print $4}'`
IDLE=`grep Average $FILE|awk '{print $5}'`
echo " $DATE $USR $SYS $WIO %IDLE >> $RESULT"
//End
You can use printf statement to get a clean output. Checkout man page for printf and replace the echo statements with printfs.
You will have these files for every month in /some_where directory.
Hope this helps.
This is a generic script so you can place it on any system if the sar files are the in the same location everywhere.
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-30-2001 09:47 AM
тАО10-30-2001 09:47 AM
Re: Another Script question
If they are, then you can just do a for loop like:
for i in in ppm*
do
tail -1 $i >> /outputfilename
done
Otherwise if they are not on 1 system, you need to use rcp, NFS, ssh, ftp or some other mechanism to transfer the files from each of the systems to one central system. My preference would be to use SSH's scp as it is encypted and does require passing passwords around.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-30-2001 09:51 AM
тАО10-30-2001 09:51 AM
Re: Another Script question
Pulling data from various system:
While writing to a file use $hostname to identify the data belongs to which system.
for e.g use sardata$date.$hostname.
Once that is done use script to run rcp or ftp
to pull the data at a centrel location.
Hope this helps
-USA..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-30-2001 10:48 AM
тАО10-30-2001 10:48 AM
Re: Another Script question
for SYS in "sys1 sys2 sys3 sys4"; do
remsh $SYS tail -1
/*either you can right 10 remsh or use another
for loop or you can use Alan's method for i in /sar/pam*; do
this will genereate /tmp/vito.$SYS in to local system you can pull that to this server where you are running script */
rcp $SYS:/tmp/vito.$SYS /tmp/vito1
cat /tmp/vito1 >> /tmp/vito.final
done
Sachin