- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- favourite sysadmin scripts you always keep around....
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
06-10-2002 07:36 AM
06-10-2002 07:36 AM
Re: favourite sysadmin scripts you always keep around....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-11-2002 04:15 AM
06-11-2002 04:15 AM
Re: favourite sysadmin scripts you always keep around....
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2002 12:06 AM
06-12-2002 12:06 AM
Re: favourite sysadmin scripts you always keep around....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2002 12:49 AM
06-12-2002 12:49 AM
Re: favourite sysadmin scripts you always keep around....
nice initiative BILL ;)
Maybe this forum could have a section dedicated this topic.
My contribution is the RDA(Remote Diagnostic Agent) which helps people running Oracle People should use to document their systems each time they do a change.
Poeple having access to Metalink will get the latest version from here: http://metalink.oracle.com/cgi-bin/cr/getfile_cr.cgi?281592
otherwise the current version is attached.
Cheers
Yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2002 01:02 AM
06-12-2002 01:02 AM
Re: favourite sysadmin scripts you always keep around....
here is my bdf in MB , not as goos as yours but I needed a simple script quickly.
John.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2002 01:39 AM
06-12-2002 01:39 AM
Re: favourite sysadmin scripts you always keep around....
This script will help in taking oracle database backup using tar utility.
Regards,
Gnana A.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2002 02:13 AM
06-12-2002 02:13 AM
Re: favourite sysadmin scripts you always keep around....
Another useful script that allows me to export my Oracle database and at the same time compress it. Saving precious diskspace.
---------------------------------------------
#!/bin/csh -vx
setenv UID /
setenv FN exp.`date +%j_%Y`.dmp
setenv PIPE /tmp/exp_tmp_ora8i.dmp
setenv MAXSIZE 500m
setenv EXPORT_WHAT "full=y COMPRESS=n"
echo $FN
cd /nfs/atc-netapp1/expbkup_ora8i
ls -l
rm expbkup.log export.test exp.*.dmp* $PIPE
mknod $PIPE p
date > expbkup.log
( gzip < $PIPE ) | split -b $MAXSIZE - $FN. &
# uncomment this to just SPLIT the file, not compress and split
#split -b $MAXSIZE $PIPE $FN. &
exp userid=$UID buffer=20000000 file=$PIPE $EXPORT_WHAT >>&
expbkup.log
date >> expbkup.log
date > export.test
cat `echo $FN.* | sort` | gunzip > $PIPE &
# uncomment this to just SPLIT the file, not compress and split
#cat `echo $FN.* | sort` > $PIPE &
imp userid=sys/o8isgr8 file=$PIPE show=y full=y >>& export.test
date >> export.test
tail expbkup.log
tail export.test
ls -l
rm -f $PIPE
-----------------------------------------------
This also always does an 'integrity' check of the export right after it is done with an import show=y, that shows how to use these split files with import.
----------------------------------------------
!!!
cat `echo $FN.* | sort` | gunzip > $PIPE &
sorts the filenames, sends them to cat, which give them to gunzip in the right order.
Hope this will 1000's of you people
Best Regards
Yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2002 02:25 AM
06-12-2002 02:25 AM
Re: favourite sysadmin scripts you always keep around....
Good scripts, and keep them coming!
Later,
Bill
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2002 05:21 AM
06-12-2002 05:21 AM
Re: favourite sysadmin scripts you always keep around....
This script DBAs will love it! ;)
I still don't recall where i borrowed it however.
Email Notification whenever an error (ORA type) occurs in the database.
Hope someone appreciate it as we do it here!
NB. please do the appropriate modifications before executing it.
cheers
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2002 05:36 AM
06-12-2002 05:36 AM
Re: favourite sysadmin scripts you always keep around....
I would like to contribute with this small script, which I use to rename VG.
Be careful, because we have a little bit different convention for naming VG and LV as usually used. No problem, script is easy customized...
#!/sbin/sh
export VG_OLD=$1 #Number of an old VG
export VG_NEW=$2 #Number of a new VG
vgchange -a n vg${VG_OLD}
vgexport -s -m /tmp/vg${VG_OLD}.map vg${VG_OLD}
mkdir /dev/vg${VG_NEW}
mknod /dev/vg${VG_NEW}/group c 64 "0x"${VG_NEW}"0000"
awk -v VG_NEW="${VG_NEW}" '{if ($2 ~ /^lv/) {print $1 " lv" VG_NEW} else {print $0}}' /tmp/vg${VG_OLD}.map > /tmp/vg${VG_OLD}_.map
vgimport -s -m /tmp/vg${VG_OLD}_.map vg${VG_NEW}
vgchange -a y vg${VG_NEW}
Have a nice time,
Brano.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2002 05:45 AM
06-12-2002 05:45 AM
Re: favourite sysadmin scripts you always keep around....
This script collects specific system information; the smileys not attached.
I use it to see in one glimps of an eye to check the status of the disks, system messages, specific processes, mail etc.
The script is straightforward.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2002 05:50 AM
06-12-2002 05:50 AM
Re: favourite sysadmin scripts you always keep around....
running this script once a month, i can get a quick overview of my machines.
I hope the format of this attachment is ok ...
If not, sorry !
Hey, where is Robin Wakefield ??? I got the STM stuff from him.
RGDS, Holger
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2002 06:07 AM
06-12-2002 06:07 AM
Re: favourite sysadmin scripts you always keep around....
serialnumber.sh
echo "sel path system\ninfolog\nexit"|cstm|grep "System Serial Number"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2002 02:22 AM
06-13-2002 02:22 AM
Re: favourite sysadmin scripts you always keep around....
this one i use it quite often to locate my "memory hungry" sessions most of the time "zombies"...
psram.sh
regards
Yogeeraj
PS. Source from HP Forum ;)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2002 02:59 AM
06-13-2002 02:59 AM
Re: favourite sysadmin scripts you always keep around....
Based in an Stefan Farrelly Original Idea (http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xa482107d277ad611abdb0090277a778c,00.html), this script change the permits to the original, for all the products an O.S. installed.
Regards,
Justo.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2002 05:15 AM
06-13-2002 05:15 AM
Re: favourite sysadmin scripts you always keep around....
great stuff on this page ...
Attached you will find a little modification of the smbstatus command in combination with cmviewcl and ssh ...
RGDS, Holger
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2002 05:17 AM
06-13-2002 05:17 AM
Re: favourite sysadmin scripts you always keep around....
Cron entry:
08 * * * * /cag/thresh /filesystem_here 75 2>&1
# cat thresh
#!/usr/bin/ksh
#bdf paging script to page when threshold is reached
# $1 = Filesystem
# $2 = Threshold
CAPTHRESH=$2
bdf -i $1 | grep -v "^Filesystem" | paste - - | read FS V W X CAP Y Z IN
OD MP
if [[ ${CAP%\%*} -gt $CAPTHRESH ]]
then
echo "WARNING Filesystem $1 reach ${CAP%\%*}"%" Filesystem is almost Full"
/usr/bin/mailx -s "Filesystem Alert" cag@youremail.com
fi
Cheryl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2002 05:23 AM
06-13-2002 05:23 AM
Re: favourite sysadmin scripts you always keep around....
Starting at 11.11 some machines (Superdome, rp8400 and rp7410) will return serial number with:
# getconf CS_MACHINE_SERIAL
From C, use
confstr(_CS_MACHINE_SERIAL).
Memory configuration:
# echo "selclass qualifier memory;info;wait;infolog"|cstm > /tmp/meminfo
Processor information:
# echo "selclass qualifier cpu;info;wait;infolog"|cstm > /tmp/procinfo
What disk and/or kernel you booted from:
# echo 'boot_string/S'|adb /stand/vmunix /dev/mem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2002 05:32 AM
06-13-2002 05:32 AM
Re: favourite sysadmin scripts you always keep around....
just FYI
N/A
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2002 07:20 AM
06-13-2002 07:20 AM
Re: favourite sysadmin scripts you always keep around....
cannot get enough of this script collection and want to add something from our HA CIFS stuff ...
NOTE: Every samba documentation i've read says, the daemons automatically re-read their configuration, but i didn't see any changes from testparm after manipulating the conf file ...
So i wrote this little script sending a HANGUP to specific samba procs. The script also considers the different Fileservers ...
-----------------------------------------------
#!/bin/sh
#
#set -x
PATH=$PATH:/opt/samba/bin
usage () {
echo "USAGE: $0
}
if [ "$#" != 1 ]
then
echo "ERROR in handling"
usage
exit 1
fi
case $1 in
Fileserver1) NETBIOS=fs_1
;;
Fileserver2) NETBIOS=fs_2
;;
*) echo "ERROR: $1 is an unknown instance!"
usage
exit 2
;;
esac
echo "NOTE: Sending HANGUP to all samba procs belonging to $1"
ps -ef | grep mb | grep ${NETBIOS} | grep -v grep | awk '{print $2}' | while read samba_proc;do
echo "RELOADING ${samba_proc}"
kill -1 ${samba_proc}
done
-----------------------------------------------
Hope it will be useful !
RGDS, Holger
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2002 08:01 AM
06-13-2002 08:01 AM
Re: favourite sysadmin scripts you always keep around....
Used Regularly on 11.0
This script generates a report with seven sections for accounts that are not allowed to login to the system and emails it to the sys admin.
The seven reasons are:
1) Expired Passwords
2) Inactive Accounts
3) Past Absolute Account Lifetime
4) Excessive Invalid Login Attempts
5) Password Required but Using a Null Password
6) Administrative Lock
7) Password is "*"
The script does use the /usr/lbin/getprpw command which is NOT supported by HP. These are used by SAM.
Review the script before using. It assumes that the Working Directory is /sysadm/util/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2002 08:06 AM
06-13-2002 08:06 AM
Re: favourite sysadmin scripts you always keep around....
Used regularly on 11.0
# vi and copy command
#
# This command copies the file you are about to edit
# if this is the first time it is being edited on
# the current date. If you use it multiple times
# you will still have a copy of the days original
# version. The backup file name is in the original
# directory with the date (yymmdd format) appended
# to the end.
#
# Syntax: vicp
# Examples: vicp hosts
# vicp /etc/hosts
#
# Results in a backup file called hosts.010602 if
# this were run on 06.02.2001
It also used vipw for /etc/passwd and runs a grpck for /etc/group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2002 08:09 AM
06-13-2002 08:09 AM
Re: favourite sysadmin scripts you always keep around....
Used regularly on 11.0
# Script Description
# This script is used to determine the MAC address of a system. It only works for
# systems on the same subnet ( ie. 10.40.**.** )
It's simple enough. It simply uses ping, arp, and cut to get the info.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2002 08:15 AM
06-13-2002 08:15 AM
Re: favourite sysadmin scripts you always keep around....
Used regularly on 11.0
This script greps "ps -ef" for up to 3 strings.
If ONLY one job meets the criteria it prompts you with a (y/n) to kill it.
If you replied "y" it does a "kill PID", sleeps 3 seconds, and then checks to see if the job has ended.
e.g. killname run-amuck
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2002 08:52 AM
06-13-2002 08:52 AM
Re: favourite sysadmin scripts you always keep around....
Typical:
ps -ef | grep something | grep -v grep
Easy and super reliable:
UNIX95= ps -f -C something
By setting (temporarily) UNIX95, the ps command inherits a bunch of new options such as -C -H and -o. -C does the grep for you but never looks at the entire line. Instead, -C finds the exact name of the process. Thus, -C sh will not find ksh but will find sh and -sh.
Try these two examples:
ps -ef | grep sh | grep -v grep
UNIX95= ps -f -C sh
Bill Hassell, sysadmin