- 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-16-2002 01:24 AM
10-16-2002 01:24 AM
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x026250011d20d6118ff40090279cd0f9,00.html
favourite spelt incorrectly for American search engines! ;)
PS: when attaching scripts, rather than pasting them into the reply box, attach them as .txts. This helps both formatting problems and lots of scrolling ctrl c, ctrl v s..
TESTED SCRIPTS ONLY PLEASE!
If you find any scripts buggy, please feel free to post an improved version!
That's what the forum is about right! - sharing experiences, helping each other out! right?
Hope the scripts help!
attached is my remote system watch script that xwds and xwuds - I find it useful for remotly watching a windows display - or x display - screenhots logged into a unix box with relaxed xhost permissions. I used it for remote training where sharedX/ HPVC suffered due to network lag.
Later,
Bill
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2002 05:09 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2002 05:38 AM
10-16-2002 05:38 AM
Re: favorite sysadmin scripts you always keep around [2]
Here is a script that I use on one of our Oracle development systems. We keep the developers home directories in the /home/oradev tree, and every so often one of them will decide to copy a huge file into their home directory which fills up /home. I wrote this script to e-mail me a list of the top 10 disk hogs in the /home/oradev tree, which I then e-mail to all the developers. When /home fills and some developers can't do any work, they get this e-mail and they can ask the person in the next cubicle why the are hogging all the disk space. Peer pressure works much better for making them clean up after themselves than having me bug them individually! The script will also check each of the large files in the report to see if any processes are holding it open. I got tired of them deleting large files that someone else had open and not getting the space back.
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2002 06:06 AM
10-16-2002 06:06 AM
Re: favorite sysadmin scripts you always keep around [2]
netstat -na | grep -i close
If the above returns anything you may need the following script. It saves a reboot if you have sockest in cloae_wait state & have run out....
#!/usr/bin/ksh
#
# Author Tim Fulford
# Date 22 Jan 2001
# Purpose Kills CLOSE_WAIT sockets using ndd
close_wait_ip_collect ()
{
netstat -na | grep CLOSE | cut -c20-65 > /tmp/close_wait_ip_collect.out
}
close_wait_ip_convert_to_hex ()
{
cat /tmp/close_wait_ip_collect.out | while read TRGT SRCE
do
echo ${TRGT}.${SRCE} | awk -F"." '{printf "%02x%02x%02x%02x%04x%02x%02x%02x%02x%04x\n", $1, $2, $3, $4, $5, $6, $7, $8, $9, $10}'
done
}
close_wait_remove_socket ()
{
cat /tmp/close_wait_ip_convert_to_hex.out | while read SOCKET
do
echo "Clearing socket HEX address : ${SOCKET}"
echo "ndd -set /dev/tcp tcp_discon_by_addr ${SOCKET}"
done
}
close_wait_clear_up ()
{
rm /tmp/close_wait_ip_convert_to_hex.out /tmp/close_wait_ip_collect.out
echo "Finished...."
}
close_wait_ip_collect
close_wait_ip_convert_to_hex > /tmp/close_wait_ip_convert_to_hex.out
close_wait_remove_socket
close_wait_clear_up
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2002 06:55 AM
10-16-2002 06:55 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-16-2002 06:59 AM
10-16-2002 06:59 AM
Re: favorite sysadmin scripts you always keep around [2]
checkhardware.sh
#!/bin/sh
#
# checkwardare.sh Created 2/13/2001
# Steven E. Protter
#
# Designed to check for hardware lbolts and send out an alert email
#
/usr/sbin/dmesg | grep lbolt > /tmp/checkwardware
errs=`wc -l /tmp/checkwardware | awk {'print $1'}`
if [ $errs -ne 0 ]
then
# echo "Errors ${errs}"
/usr/sbin/dmesg > /tmp/checkwardware
/usr/sbin/dmesg | mailx -s "Hardware error detected /tmp/checkhardware" email@you.com
/usr/sbin/dmesg | mailx -s "Hardware error detected /tmp/checkhardware" yourboss@you.com
/usr/sbin/dmesg | mailx -s "Hardware error detected /tmp/checkhardware" yourboss'sboss@you.com
/usr/sbin/dmesg | mailx -s "Hardware error detected /tmp/checkhardware" root
/usr/bin/np -qQhp5000 /tmp/checkwardware
fi
A definite winner. The np commands assume installation of openspool which I recommend you not do. Its a legacy product with us.
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2002 07:01 AM
10-16-2002 07:01 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-16-2002 07:20 AM
10-16-2002 07:20 AM
Re: favorite sysadmin scripts you always keep around [2]
Out of the HP Certification Study Guide.
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2002 07:33 AM
10-16-2002 07:33 AM
Re: favorite sysadmin scripts you always keep around [2]
Kill a process or series of processes based on a command line parameter. Very powerful and useful.
I use it all the time, read it before you use it. I built in some basic protection to not let you to a process kill for strings like root and stuff, but its far from bullet proof.
This is a mod from some book.
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2002 07:39 AM
10-16-2002 07:39 AM
Re: favorite sysadmin scripts you always keep around [2]
psg
its a modifived ps -ef | grep that makes sure the grep among other things doesn't show up.
psg oracle shows all processes with the string oracle
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2002 08:33 AM
10-16-2002 08:33 AM
Re: favorite sysadmin scripts you always keep around [2]
I use this to search for files. Idea is borrowed from locate of linux.
Setup a cron job to create a datbase containing list of files on the system.
find / -print > /tmp/locate.db
Run the attached script as
locate filenmae[s].
Pretty useful.
hth
-balajio
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2002 08:46 AM
10-16-2002 08:46 AM
Re: favorite sysadmin scripts you always keep around [2]
--
Tony
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2002 09:41 AM
10-16-2002 09:41 AM
Re: favorite sysadmin scripts you always keep around [2]
I finally earned some points.
This is the best thread I've seen.
I went through the old one and collected 40 scripts. They need some mod, but still a gold mine.
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2002 09:49 AM
10-16-2002 09:49 AM
Re: favorite sysadmin scripts you always keep around [2]
This is part of a three function, six script system.
One for Deleting Oracle Users.
One for Adding Oracle Users.
One for Resetting their password when they forget.
This is a pre-ldap situation. When we do LDAP, this all changes.
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2002 09:52 AM
10-16-2002 09:52 AM
Re: favorite sysadmin scripts you always keep around [2]
This script is used for collecting various
areas of information from sar. The script
utilizes data collected from the SA files
located in: /var/adm/sa/sa##.
cron entry is below which will write an entry
in the file every hr on the hr.
0 * * * * /usr/lbin/sa/sa1 3600 1 &
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2002 09:52 AM
10-16-2002 09:52 AM
Re: favorite sysadmin scripts you always keep around [2]
He is called by the prior script. I'd zip them but am lazy today. Since its a set, feel free to do just 5 points per script.
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2002 09:55 AM
10-16-2002 09:55 AM
Re: favorite sysadmin scripts you always keep around [2]
using veritas netbackup as your backup
architecture. This script will compile a
report of all backup jobs executed for the
preceding 24hr period and report them in
html format. The html is very basic so feel
free to pretty it up some.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2002 09:57 AM
10-16-2002 09:57 AM
Re: favorite sysadmin scripts you always keep around [2]
This time, I took the time to make a tar file.
AddOracleUser is the main script
useradd.ksh (even though its probably using the posix shell, my dba is a little loose about checking this), is called.
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2002 09:58 AM
10-16-2002 09:58 AM
Re: favorite sysadmin scripts you always keep around [2]
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2002 10:01 AM
10-16-2002 10:01 AM
Re: favorite sysadmin scripts you always keep around [2]
This script sets the default oracle environoment based on the first entry in the /etc/oratab file
This building block should have been first.
If I missed something, let me know, I'll post it up.
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2002 10:08 AM
10-16-2002 10:08 AM
Re: favorite sysadmin scripts you always keep around [2]
Script to get lancard ID, state and speed
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2002 10:24 AM
10-16-2002 10:24 AM
Re: favorite sysadmin scripts you always keep around [2]
I just added a display variable to allow commands like bdf /sag to work.
A minor improvement.
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2002 10:48 AM
10-16-2002 10:48 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-16-2002 12:40 PM
10-16-2002 12:40 PM
Re: favorite sysadmin scripts you always keep around [2]
A real nice disk space monitor. There's a test section near the bottom so you can see what it does. Enjoy!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2002 04:57 AM
10-17-2002 04:57 AM
Re: favorite sysadmin scripts you always keep around [2]
"b" makes the backspace key functional if it isn't working in a shell.
"lsd" list only the subdirectories in a directory.
"mtcd" and "umtcd" mount and unmount my cd drive.
RD