Operating System - HP-UX
1753428 Members
4933 Online
108793 Solutions
New Discussion юеВ

Re: favorite sysadmin scripts you always keep around (3)

 
SOLVED
Go to solution
Bill McNAMARA_1
Honored Contributor

favorite sysadmin scripts you always keep around (3)

As the previous thread was getting quite large, I've decided to start a new thread:

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
It works for me (tm)
116 REPLIES 116
Geoff Wild
Honored Contributor
Solution

Re: favorite sysadmin scripts you always keep around (3)

Not really an individual script - but a tool nonetheless. For anyone running a MC/SG cluster, this is a valuable tool to monitor your environment to ensure all nodes are configured equally.

http://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
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Procnus
Frequent Advisor

Re: favorite sysadmin scripts you always keep around (3)

Here's a short perl script I use to find out who is logged in more than once. It's output is a little nicer than sorting and uniq'ing a who

Steven
Ramkumar Devanathan
Honored Contributor

Re: favorite sysadmin scripts you always keep around (3)

Five tips - not scripts - for configuring apache.

((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.
HPE Software Rocks!
Stefan Farrelly
Honored Contributor

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</tmp/t 2>&1
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
Im from Palmerston North, New Zealand, but somehow ended up in London...
Doug Burton
Respected Contributor

Re: favorite sysadmin scripts you always keep around (3)

Two things for your .kshrc file.

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 .
Doug Burton
Respected Contributor

Re: favorite sysadmin scripts you always keep around (3)

I don't remember why but I needed a big test file. I then got a bit carried away and made this....
Doug Burton
Respected Contributor

Re: favorite sysadmin scripts you always keep around (3)

This is another file system size checking script using bdf.

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.

Sajith V Mannadiar
Frequent Advisor

Re: favorite sysadmin scripts you always keep around (3)

Attached are some useful scripts,

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
Sajith V Mannadiar
Frequent Advisor

Re: favorite sysadmin scripts you always keep around (3)

Attached script (bigdir) will list you all large folders in a filesystem

for eg., bigdir /var 100\*1024\*1024

will list all folders larger than 100MB in /var


Regards,
Sajith