- 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
Forums
Discussions
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
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
04-30-2003 06:24 AM
04-30-2003 06:24 AM
favorite sysadmin scripts you always keep around (2)
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x836cc1c4ceddd61190050090279cd0f9,00.html
favourite sysadmin scripts you always keep around (1)
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x026250011d20d6118ff40090279cd0f9,00.html
PLEASE attach scripts as a txt file to facilitate cut and paste.
TOP POINTS for tried tested and improved and corrected scripts! (ie use at your own risk!)
Later,
Bill
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2003 07:04 AM
04-30-2003 07:04 AM
Solutionhttp://h40045.www4.hp.com/data/ccmon-service-brief.pdf
There is a small cost - usually just 1 or 2 "technical service days" from your support contract.
Note: This doesn't have to be just for MC/SG - any application where you need to monitor similiar configurations across multiple machines will work as well (IE SAP App Servers).
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2003 06:22 PM
04-30-2003 06:22 PM
Re: favorite sysadmin scripts you always keep around (3)
Steven
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2003 11:00 PM
04-30-2003 11:00 PM
Re: favorite sysadmin scripts you always keep around (3)
((teaser below))
1. AcceptMutex
2. Use 2.0 and threading (worker MPM)
3. SSL session cache
4. KeepAliveTimeout
5. Using mod_status
And the link is this -
http://builder.com.com/article.jhtml?id=u00320020423ere01.htm&page=1&vf=fb
HTH.
- ramd.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2003 12:35 AM
05-01-2003 12:35 AM
Re: favorite sysadmin scripts you always keep around (3)
Script to loop every second showing how many bytes are coming in to your default lancard. Easily changed to show outbound also. Very handy to see how much traffic is going in and out.
#!/bin/ksh
function lanad
{
lanadmin<
lan
display
quit
EOF
cat /tmp/t|grep Inbound|grep Oct|awk '{print $4}'
}
echo "Inbound Bytes per second on default lan interface"
let z=0
while true
do
sleep 1
let x=$(lanad)
let t=$x-$z
echo $t
let z=$x
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2003 07:02 AM
05-01-2003 07:02 AM
Re: favorite sysadmin scripts you always keep around (3)
Cleanup your ps|grep search.
Usage: seek something
alias seek='ps -ef|grep -v grep|grep -v "ps -ef"|grep -i '
Add the server name and current directory your in
to the top of an xterm or dtterm window. NOTE: Changes
the "cd" command.
####################################
# Set window and icon titles
####################################
# put text on the X-window title bar
setTitle()
{
hn="$1"
if [ "$TERM" = "hp" -o "$TERM" = "hpterm" ]
then
echo "^[&f0k${#hn}D$hn^M\c"
elif [ "$TERM" = "xterm" -o "$TERM" = "vt100" ]
then
echo "\033]2;$hn\007\c"
elif [ "$TERM" = "dtterm" -o "$TERM" = "vt220" ]
then
echo "\033]2;$hn\007\c"
fi
}
typeset -fx setTitle
# Lets set an alias
_cd()
{
'cd' ${1:-$HOME} ${2:-}
setTitle "`hostname`:`pwd`" 1>&2
}
alias -x cd="_cd"
_cd .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2003 12:31 PM
05-01-2003 12:31 PM
Re: favorite sysadmin scripts you always keep around (3)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-01-2003 12:51 PM
05-01-2003 12:51 PM
Re: favorite sysadmin scripts you always keep around (3)
File system is >= 90% - email root.
File system is > 95% - page somebody.
It will work when lvol names are large and running bdf drops the "kbytes used" etc data to the next line.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2003 05:20 AM
05-12-2003 05:20 AM
Re: favorite sysadmin scripts you always keep around (3)
bigfile -> To find large files in a filesystem
For eg, bigfile /var 10\*1024\*1024
will list all files of size greater than 10MB
Regards,
Sajith
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2003 05:21 AM
05-12-2003 05:21 AM
Re: favorite sysadmin scripts you always keep around (3)
for eg., bigdir /var 100\*1024\*1024
will list all folders larger than 100MB in /var
Regards,
Sajith
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2003 05:30 AM
05-12-2003 05:30 AM
Re: favorite sysadmin scripts you always keep around (3)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2003 05:37 AM
05-12-2003 05:37 AM
Re: favorite sysadmin scripts you always keep around (3)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2003 06:05 AM
05-12-2003 06:05 AM
Re: favorite sysadmin scripts you always keep around (3)
The script -> create_mnts
-----------
#!/bin/ksh
cd /
echo "Creating the required mount points..."
cat /etc/checklist |grep -v "^#"|awk '{print $2}'| while read dir_name
do
if [ ! -d ${dir_name:="/etc"} ]
then
umask 022;mkdir -p $dir_name
echo "Directory $dir_name created..."
fi
done
echo "Creating the required symbolic links..."
cat /etc/checklist |grep "symbolic link" | while read link_entry
do
sdir=`echo $link_entry|cut -d" " -f2`
ddir=`echo $link_entry|cut -d" " -f3`
ddir1=`dirname $ddir`
ddir2=`basename $ddir`
umask_val=`echo $link_entry|cut -d" " -f8`
umask $umask_val
mkdir -p $ddir1
cd $ddir1
ln -s $sdir $ddir2
echo "Created link $ddir -> $sdir "
umask 022
done
---------------------------------------
Sample fstab attached
--------------------
In our lab, at times, the systtem load increases due to some runaway processes...
Here is a one-liner to catch hold of them.. I call it 'runproc'
#!/bin/ksh
ps -elf|grep " R "|grep -v -E 'grep|ps'
-----------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2003 06:56 AM
05-12-2003 06:56 AM
Re: favorite sysadmin scripts you always keep around (3)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2003 07:02 AM
05-12-2003 07:02 AM
Re: favorite sysadmin scripts you always keep around (3)
When invoked, the CE can attach a number of files and send to a number of email addresses.
The call to MOTD has a privacy message for our protection, so you can be calling your own or comment this out.
The $MAILX_FILE is an executable that simply performs the mailx command and send out the attachments.
Have fun.
dl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2003 07:51 AM
05-12-2003 07:51 AM
Re: favorite sysadmin scripts you always keep around (3)
#!/usr/bin/sh
# scroll
# Don't ask.
typeset -i x=0
strg_len=`echo "$*" | wc -m`
#clear
delay ()
{
base=0
time=$1
while (( time > base ))
do
(( time = time - 1 ))
delays[x]="Delay?"
done
unset delays[*]
}
while (( x < $strg_len )) && (( $strg_len < 1024 ))
do
(( x = x + 1 ))
scroll[x]=`echo "$*" |cut -c $x`
[ ${scroll[x]} ] 2> /dev/null && {
print "${scroll[x]}\c"
delay 2000
} || {
print "${scroll[x]}\c"
delay 5000
}
done
tput cud1
Good for a laugh!
-ChaZ-
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2003 12:33 PM
05-12-2003 12:33 PM
Re: favorite sysadmin scripts you always keep around (3)
I have a few more.
check_rootlogin
It reports on bad root login attempts. I use it in cron. It can be set to auto disable the id, but I didn't think that was a very good idea.
SEP
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
05-12-2003 12:35 PM
05-12-2003 12:35 PM
Re: favorite sysadmin scripts you always keep around (3)
Provides sysadmin with a list of new large files created in size order.
This is a production script.
BTW, I did check my back posts for dups.
SEP
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
05-21-2003 04:54 AM
05-21-2003 04:54 AM
Re: favorite sysadmin scripts you always keep around (3)
/opt/OpenSource/xcdroast-0.98
You may need to edit some of the paths in the script for your own use - but on my system it works very well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2003 02:09 AM
06-13-2003 02:09 AM
Re: favorite sysadmin scripts you always keep around (3)
( Unix Power Tools, 2nd Edition: Examples )
ftp://ftp.oreilly.com/published/oreilly/power_tools/unix/upt9707.tgz
Regards,
Karthik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2003 06:36 AM
06-27-2003 06:36 AM
Re: favorite sysadmin scripts you always keep around (3)
I have the following script which seems to give me what I need.
echo "PID USER CPU% MEM_SIZE COMMAND"
while true
do
UNIX95= ps -eo "pid ruser pcpu vsz=Kbytes" -o comm | grep oracleT5751
sleep 1
done
It returns something like this...
8532 ormesa 0.02 32832 oracleT5751
536 ormesa 0.02 32832 oracleT5751
524 ormesa 0.02 32832 oracleT5751
22005 ormesa 0.02 32832 oracleT5751
8536 ormesa 0.02 40128 oracleT5751
I need to graph this in excel to show the memory / cpu consumed by each pid. I'm a little confused on how to setup the graph? any ideas...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2003 06:43 AM
06-27-2003 06:43 AM
Re: favorite sysadmin scripts you always keep around (3)
several examples can be found in the graph scripts included in the Statistics on https://www.beepz.com/personal/merijn/#Statistics or http://www.cmve.net/~merijn/#Statistics
Enjoy, have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2003 11:50 AM
06-27-2003 11:50 AM
Re: favorite sysadmin scripts you always keep around (3)
It uses secure shell to ll the /etc/hosts directory on each remote system. If the directory listing is successful, it assumes that the system is up and running. If not, it advises to "Update your resume'". It emails the results. We run this every day at 8 AM, so that we have no surprises at the 9 AM meeting.
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2003 12:17 AM
06-28-2003 12:17 AM
Re: favorite sysadmin scripts you always keep around (3)
Here is my backup script,which is invoked by cron every night.
She will check the tape first, if type is not ready, she send a mail to a certain mailbox. When this mailbox receive this special mail, it will send a message to the adminiatrator by mobile phone.
After backup, it will truncate some log files of the DB, and make a total report and send it to the administrator.
This keep the backup always done correctly!!!
-ux
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2003 08:45 AM
07-22-2003 08:45 AM
Re: favorite sysadmin scripts you always keep around (3)
There's been numerous times I've wanted to know which corresponding chmod command was needed to securing files and directories. Here's a script that I've created awhile back that others may want to have. Very useful for determining the chmod integer combinations. It lists the 4 digit code, security string, object type, owner:group, and filename. It has saved my rear-end multiple times and I call it from other scripts for when I may need to reset the security properties for a file or directory.
Here's an example of running the script...
# getchmod /etc/inetd.conf
0644 -rw-r--r-- file root:sys /etc/inetd.conf
And yes, it will use wildcards...
I've named the script getchmod....
jack...