- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: favorite sysadmin scripts you always keep arou...
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
10-17-2002 06:15 AM
10-17-2002 06:15 AM
Re: favorite sysadmin scripts you always keep around [2]
####################################################################
# This configuration file is set up for the script filesysmon.
# Set up all file systems and percentage full before an email
# will go out to the admins of the server.
# 08/28/02 Lisa Mauer
####################################################################
# MAX_TRESH is the max thresh before sending out a critical message
MAX_THRESH=98
# THRESH for each FS is the THRESH before sending a message
FS[1]=/ ;THRESH[1]=60
FS[2]=/stand ;THRESH[2]=60
FS[3]=/var ;THRESH[3]=85
FS[4]=/usr ;THRESH[4]=95
FS[5]=/tmp ;THRESH[5]=85
FS[6]=/opt ;THRESH[6]=80
FS[7]=/opt/savelog ;THRESH[7]=75
FS[8]=/opt/oradata ;THRESH[8]=75
FS[9]=/opt/dbutil ;THRESH[9]=75
FS[10]=/opt/app/oracle ;THRESH[10]=80
FS[11]=/opt/gpdev/80 ;THRESH[11]=97
FS[12]=/home ;THRESH[12]=95
****************************************************************************************************
###########################################################################
# This script monitors file systems for available disk space on any server
# File systems and percentages are set up in the config file.
# To change the configuration use /usr/local/bin/disk_space.conf
# Currently set up in cron to run every 15 minutes.
#
# 08/28/02 Lisa Mauer
###########################################################################
# Debugging purposes
#set -x
PATH=/usr/bin:/usr/sbin
CONF_FILE=/usr/local/bin/disk_space.conf
# Source default env vars
. ${CONF_FILE}
# Count number of FS to check
i=${#FS[*]}
# echo max - $MAX_THRESH
# Check each Filesystem
while [ $i -gt 0 ]
do
PCT=`bdf ${FS[$i]} | grep -v Filesystem | cut -c 45-47`
if ((PCT>THRESH[$i]))
then
echo " ${THRESH[$i]} "
if (("${PCT}>${MAX_THRESH}"))
then
echo "Subject:Out of disk space ${FS[$i]} on `hostname`!!!!
Out of disk space on ${FS[$i]} on `hostname`" |sendmail admin@yourcompany.com admin2@yourcompany.com
else
echo "Subject:Threshold exceeded ${FS[$i]} on `hostname`!!!!
Threshold exceeded on ${FS[$i]} on `hostname`" | sendmail admin@yourcompany.com admin2@yourcompany.com
fi
fi
let i=i-1
done
exit 0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2002 11:01 AM
10-17-2002 11:01 AM
Re: favorite sysadmin scripts you always keep around [2]
/dev/rdsk/c4t7d2 :9803A000 vgdw lvarch0
/dev/rdsk/c4t7d3 :9803B000 vgdw lvarch1
/dev/rdsk/c4t7d4 :9803C000
NOTE:
-assumes EMC's inq utility is installed an in your path.
-attachement includes three files: emcuse.sh, lvassign.sh, and lvassign.prl that you'll need to save seperately.
- if you're multi-pathing, the LUN ids will repeat with the alternate disk device files.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2002 10:51 PM
10-17-2002 10:51 PM
Re: favorite sysadmin scripts you always keep around [2]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2002 01:11 AM
10-18-2002 01:11 AM
Re: favorite sysadmin scripts you always keep around [2]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2002 05:55 AM
10-18-2002 05:55 AM
Re: favorite sysadmin scripts you always keep around [2]
I have two. The first one sets up a volume group, the second one mirrors the system disk. There are a couple tricks to getting it to work. You need to create fstab and mirror scripts for each vg.
fstabs:
/dev/vg00/lvol3 / vxfs delaylog 0 1
/dev/vg00/lvol1 /stand hfs defaults 0 1
/dev/vg00/lvol4 /tmp vxfs delaylog 0 2
/dev/vg00/lvol5 /home vxfs delaylog 0 2
/dev/vg00/lvol6 /opt vxfs delaylog 0 2
/dev/vg00/lvol7 /usr vxfs delaylog 0 2
/dev/vg00/lvol8 /var vxfs delaylog 0 2
/dev/vg02/lvol3 / vxfs delaylog 0 1
/dev/vg02/lvol1 /stand hfs defaults 0 1
/dev/vg02/lvol4 /tmp vxfs delaylog 0 2
/dev/vg02/lvol5 /home vxfs delaylog 0 2
/dev/vg02/lvol6 /opt vxfs delaylog 0 2
/dev/vg02/lvol7 /usr vxfs delaylog 0 2
/dev/vg02/lvol8 /var vxfs delaylog 0 2
create vg:
mkdir /dev/vg02
mknod /dev/vg02/group c 64 0x020000
pvcreate -fB /dev/rdsk/c2t12d0
mkboot /dev/rdsk/c2t12d0
mkboot -a "hpux -lq" /dev/rdsk/c2t12d0
lifcp /dev/rdsk/c2t12d0:AUTO -
vgcreate -e 5000 -s 8 -l 8 -p 8 /dev/vg02 /dev/dsk/c2t12d0
lvcreate -L 112 -s y -C y -r n -n lvol1 /dev/vg02
lvcreate -L 4096 -s y -C y -r n -n lvol2 /dev/vg02
lvcreate -L 144 -s y -C y -r n -n lvol3 /dev/vg02
lvcreate -L 1024 -s y -n lvol4 /dev/vg02
lvcreate -L 4096 -s y -n lvol5 /dev/vg02
lvcreate -L 2744 -s y -n lvol6 /dev/vg02
lvcreate -L 1544 -s y -n lvol7 /dev/vg02
lvcreate -L 1544 -s y -n lvol8 /dev/vg02
lvlnboot -b /dev/vg02/lvol1
lvlnboot -r /dev/vg02/lvol3
lvlnboot -s /dev/vg02/lvol2
lvlnboot -d /dev/vg02/lvol2
After setting up the above files, the mirror script runs every noght to create a new system disk. I set this up as my alternate boot device. I can boot from alt without having to modify any files, then I can reboot from the PRI device any time, again without editing any files.
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2002 09:37 AM
10-18-2002 09:37 AM
Re: favorite sysadmin scripts you always keep around [2]
"netstats -h" for usage.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2002 10:12 AM
10-18-2002 10:12 AM
Re: favorite sysadmin scripts you always keep around [2]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2002 11:28 AM
10-18-2002 11:28 AM
Re: favorite sysadmin scripts you always keep around [2]
Usage: (how I mostly use it ;) )
title nodename
Will name the window $ icon to "nodename" and will ask if you want to telnet to nodename.
Makes it real nice to open a telnet session into all my key servers and close to an icon. Then I can know by their names exactly which icon will get me into which server.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2002 07:40 PM
10-29-2002 07:40 PM
Re: favorite sysadmin scripts you always keep around [2]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2002 12:50 AM
10-30-2002 12:50 AM
Re: favorite sysadmin scripts you always keep around [2]
A colleage said that changing all files using dreamweaver would not only take too much time (250+ files), but could be done much easier with vi.
I overheard, and typed this line:
# perl -pi -e's/charset=iso-8859-1/charset=utf-8/' *
Done in 15 seconds (including the typing)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2002 02:02 AM
10-30-2002 02:02 AM
Re: favorite sysadmin scripts you always keep around [2]
I am to lazy to type
ps -ef | grep xxx | grep yyy | grep zzz
so I made psgrep:
case $# in
1) ps -ef | grep $1 ;;
2) ps -ef | grep $1 | grep $2 ;;
3) ps -ef | grep $1 | grep $2 | grep $3 ;;
4) ps -ef | grep $1 | grep $2 | grep $3 | grep $4 ;;
5) ps -ef | grep $1 | grep $2 | grep $3 | grep $4 | grep $5 ;;
*) echo " Thats much parameters " ;;
esac
Greetzz
Donald
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2002 02:10 AM
10-30-2002 02:10 AM
Re: favorite sysadmin scripts you always keep around [2]
find / -print > /tmp/filelist
make an script filegrep:
case $# in
1) cat /tmp/filelist | grep $1 ;;
2) cat /tmp/filelist | grep $1 | grep $2 ;;
3) cat /tmp/filelist | grep $1 | grep $2 | grep $3 ;;
4) cat /tmp/filelist | grep $1 | grep $2 | grep $3 | grep $4 ;;
5) cat /tmp/filelist | grep $1 | grep $2 | grep $3 | grep $4 | grep $5 ;;
*) echo " Thats much parameters " ;;
esac
You now can quickly scan your filesystem for files like:
filegrep xxx yyy zzz
Greetzz
Donald
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2002 02:38 AM
10-30-2002 02:38 AM
Re: favorite sysadmin scripts you always keep around [2]
2 parts - Refreshignite.sh runs on the management server, copies out the checkignite.sh script and runs it.
Share and Enjoy!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2002 08:06 AM
10-30-2002 08:06 AM
Re: favorite sysadmin scripts you always keep around [2]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2002 08:22 AM
11-13-2002 08:22 AM
Re: favorite sysadmin scripts you always keep around [2]
Figured its time to post another one as we
should not let this thread fall by the wayside.
I am posting a copy of a script here which i have that does an archive of certain logfiles on the system keeping a specified amount of
days for the logfile specified. This script
will also zip up the old logfiles consolidating
space.
I encourage more people to post to this thread
as it is probably one of the greatest repository's of scripts on the web.
Gl 2 all.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2002 10:24 AM
11-13-2002 10:24 AM
Re: favorite sysadmin scripts you always keep around [2]
I got the idea from this forum(http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xbe2606350fe2d61190050090279cd0f9,00.html) and I would like to share it with those may encountered the same problem.
###########script start from here #######
if [ $# -ne 2 ]
then
echo "Usage: $0 lines filename_to_tail"
exit 1
else
typeset -i LINES=`wc -l $2 | awk '{print $1}'`
typeset -i STARTS
STARTS=$(($LINES-$1+1))
sed -n ${STARTS},${LINES}p $2
fi
############script end here ###############
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2002 07:19 AM
11-19-2002 07:19 AM
Re: favorite sysadmin scripts you always keep around [2]
Here is my small contribution. A perl script which just gives output of your /home directory usage:
/home's total usage is 115933 kb
/home/user (2902 kb) is 2%
/home/user (10363 kb) is 8%
/home/user (6189 kb) is 5%
/home/user (2732 kb) is 2%
/home/user (2444 kb) is 2%
...etc
-Ben
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2002 08:14 AM
11-19-2002 08:14 AM
Re: favorite sysadmin scripts you always keep around [2]
Thanks
...Manjeet
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2002 08:20 AM
11-19-2002 08:20 AM
Re: favorite sysadmin scripts you always keep around [2]
This script checks if a patch is :
- already installed on a system
- not present on a system
- superseded by another patch already on the system (and display the superseding patch).
Sometimes it can show you that you don't need to install a requested patch. This tool has a -u option for usage but works only for 11.00 and later (it uses show_patches)
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-16-2002 05:19 AM
12-16-2002 05:19 AM
Re: favorite sysadmin scripts you always keep around [2]
Hi,
A typing mistake again...
This is not a script really but a combination of pwd an ll or ls.
Good luck.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-16-2002 05:51 AM
12-16-2002 05:51 AM
Re: favorite sysadmin scripts you always keep around [2]
ll | sort -rnk5 | more
And attached is a script to find running programs by name. It does not use grep which eliminates all the errors caused by matching strings in other fields. I call it psbyname. Try it with:
psbyname sh
and compare to:
ps -ef | grep sh
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-16-2002 06:06 AM
12-16-2002 06:06 AM
Re: favorite sysadmin scripts you always keep around [2]
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-16-2002 06:08 AM
12-16-2002 06:08 AM
Re: favorite sysadmin scripts you always keep around [2]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-16-2002 06:11 AM
12-16-2002 06:11 AM
Re: favorite sysadmin scripts you always keep around [2]
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-16-2002 05:04 PM
12-16-2002 05:04 PM
Re: favorite sysadmin scripts you always keep around [2]
This is a small script to get the running processes
to a file when system load exceeds threshold.
You can change the threshold value and the no. of processes
to get into file according to
your system need.
This file gives us what system is running when loads goes high.
ENjoy.
Srini.