- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: favourite sysadmin scripts you always keep aro...
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
Forums
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
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
09-10-2003 12:10 AM
09-10-2003 12:10 AM
Re: favourite sysadmin scripts you always keep around....
Although i am using this forum a lot, this is my first time to join...
Everytime i need to create FS and LVs, we need to check first the free space of our VGs right? That's why i created this script. This give me an idea how much is the free space on each VGs. Hope this help :)
script start here
--->
#!/usr/bin/ksh
#
#
VG_LIST=/tmp/vg_list.$$
vgdisplay | grep "/dev" | awk '{print $3}' > $VG_LIST
for i in `cat $VG_LIST`
do
VG_ALLOC=`vgdisplay $i|awk -v var=$i '/PE Size/ {PES=$NF} /Total PE/ {TPE=$NF} END{print "ALLOCATED SPACE for",var,vg=PES*TPE,"Mb"}'`
echo "$VG_ALLOC\c"
VG_USED=`vgdisplay $i|awk -v var1=$i '/PE Size/ {PES=$NF} /Alloc PE/ {APE=$NF} END{ print "\tUSED SPACE ",vg=APE*PES,"Mb"}'`
echo "$VG_USED\c"
VG_FREE=`vgdisplay $i|awk -v var=$i '/PE Size/ {PES=$NF} /Free PE/ {FPE=$NF} END{ print "\tFREE SPACE ",vg=FPE*PES,"Mb"}'`
echo "$VG_FREE"
done
exit 0
sample output
--->
ALLOCATED SPACE for /dev/vg00 34712 Mb USED SPACE 28472 Mb FREE SPACE 6240 Mb
ALLOCATED SPACE for /dev/appl 20568 Mb USED SPACE 18672 Mb FREE SPACE 1896 Mb
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2006 06:48 PM
02-21-2006 06:48 PM
Re: favourite sysadmin scripts you always keep around....
#!/usr/bin/sh
set -u
if [ $# -lt 1 ]
then
echo "Usage: $0 hardware_item"
echo " example: $0 disk"
echo " example: $0 processor"
echo " example: $0 memory"
exit
fi
if [ -f /usr/sbin/cstm ]
then
echo "selclass type $1;info;wait;infolog" | /usr/sbin/cstm
else
echo "/usr/sbin/cstm not installed."
fi
Regards,
Asif Sharif
Asif Sharif
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2006 09:53 PM
02-21-2006 09:53 PM
Re: favourite sysadmin scripts you always keep around....
small script about processes from users hard disconnection
E.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2006 01:12 AM
02-22-2006 01:12 AM
Re: favourite sysadmin scripts you always keep around....
just a "ksh" debugged revision of a previous script
#!/bin/ksh
# select fields in a file for any purpose
FILE=/etc/hosts
let LENGTH=`wc -l $FILE|awk '{ print $1 }'`
let COUNTER=1
while (( COUNTER <= LENGTH ))
do
LINE=`head -$COUNTER $FILE|tail -1`
FIELD1=`echo $LINE|awk '{ print $1 }'`
FIELD2=`echo $LINE|awk '{ print $2 }'`
# etc.....
# test
print "$FIELD2 \t $FIELD1"
COUNTER=`echo "$COUNTER + 1"|bc`
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2006 11:13 PM
06-08-2006 11:13 PM
Re: favourite sysadmin scripts you always keep around....
- « Previous
- Next »