Operating System - HP-UX
1833313 Members
3132 Online
110051 Solutions
New Discussion

Re: Submit Very Basic System administration commands and win easily points

 
SOLVED
Go to solution
G. Vrijhoeven
Honored Contributor

Re: Submit Very Basic System administration commands and win easily points

Hi,

Using the HP search link to search the forum for simular questions.

http://europe-support2.external.hp.com/emse/bin/doc.pl/forward/screen=emseHome/sid=936fa94804ab89aa3f?

or
http://docs.hp.com

is a good place for documetation requests.

Gideon
Uday_S_Ankolekar
Honored Contributor

Re: Submit Very Basic System administration commands and win easily points

To list the processes attached to a shared memory

# ipcs -moba

If you find anything under NATTACH coloumn with 0 (zero) and than you can saftly remove it by
# ipcrm -m id (The Id number from ipcs -moba output) This will release blocked shared memeory.

-USA..
Good Luck..
Justo Exposito
Esteemed Contributor

Re: Submit Very Basic System administration commands and win easily points

Hi,

Don't forget:

top (for look for procees running)
sar (CPU utilization)
vmstat (Memory utilization)
swapinfo -t (Swap utilization)
glance (If you have it)
sam (System Administration too)

Regards,

Justo.
Help is a Beatiful word
George_Dodds
Honored Contributor

Re: Submit Very Basic System administration commands and win easily points

The file command - determines file type.

server1> file memfile
memfile: awk program text
William Baines
Frequent Advisor

Re: Submit Very Basic System administration commands and win easily points

Find and remove core dumps:
# find / -name core -type f -exec rm {} \;

Printer system status:
# lpstat -t

Disable\Enable print que:
# disable -r "reason" quename
# enable quename

Network connectivity:
ping
linkloop
netstat -rn
arp -a
ifconfig
lanadmin
lanscan
nettl
nslookup

Work smarter, not harder
George_Dodds
Honored Contributor

Re: Submit Very Basic System administration commands and win easily points

Checking swap

swapinfo -mat
Mark Greene_1
Honored Contributor

Re: Submit Very Basic System administration commands and win easily points

if you are running nfs, run this command and route the output to a file:

UNIX95= ps -efH|head -1; UNIX95= ps -efH|egrep "inetd|rpc|mount|nfs"|grep -v grep; rpcinfo -p|egrep "service|nfs"; showmount -e;
mount -p

now you have a benchmark for what your nfs config should be if you ever have a problem with nfc or rcp.

--
mark
the future will be a lot like now, only later
Bill Hassell
Honored Contributor

Re: Submit Very Basic System administration commands and win easily points

Here's a few clarifications:

- shutdown (with no params or shutdown 0) is no longer a dependable way to reboot into single user mode. It was pretty good at versions 8 and 9 and even early 10.xx, but recently it has been unreliable, leaving mounted directories like /opt and /var and multi-user processes running. An interrupted boot process is the only reliable way today.

- make_recovery has been replaced with make_tape_recovery (which is based on make_net_recovery) and should be replaced with the latest version on all your systems. NOTE: the options have changed, so the recommended command should be:

# make_tape_recovery -AIv -a /dev/rmt/some_tape

- ioscan has a wide variety of reallty useful options. The most important is -k (the warp speed option--try it). Here are some really useful examples:

# ioscan -knf
# ioscan -knfC disk
# ioscan -kfC tape
# ioscan -kC processor
# ioscan -kfnH 8/10/5
# ioscan -knfH 12

- lpstat -t works well except when there are a lot of remote printers that must be polled. If any of the servers are down, there is a LONG delay to timout. To see just the current list of printers, use lpstat -v

- grep (-E -F or egrep and fgrep) egrep handles extended regular expressions but is quite slow. Since most uses of egrep (or grep -E) use the multiple search option, try this as an alternative...these two produce equivalent results but grep -F is much faster:

# grep -Ei "err|warn|panic|crit" syslog.log
# grep -Fi -e err -e warn -e panic -e crit syslog.log

So here's my favorite to prevent core dumps: in /etc/profile, put this line:

ulimit -Sc 0

It allows a knowledgeable user to change the value but if left alone, no core files will be produced.


Bill Hassell, sysadmin
Paula J Frazer-Campbell
Honored Contributor

Re: Submit Very Basic System administration commands and win easily points

Hi

Remove files but not dirs.

rm `ls -l | grep -v '^d' | awk '{ print $9 }'`


Paula
If you can spell SysAdmin then you is one - anon
Stefan Schulz
Honored Contributor

Re: Submit Very Basic System administration commands and win easily points

Hi,

a quick check for the installed memory:

/usr/sam/lbin/getmem (shows memory im MB)

Show the devicefiles for the installed tape:

ioscan -fnuC tape

Regards Stefan
No Mouse found. System halted. Press Mousebutton to continue.
Printaporn_1
Esteemed Contributor

Re: Submit Very Basic System administration commands and win easily points

to cleanup superseded patches in /var/adm/sw/save
by #cleanup -n -c
ex
cleanup -n -c 1
enjoy any little thing in my life
Albert Smith_1
Regular Advisor

Re: Submit Very Basic System administration commands and win easily points

Checking your swap utilization:

swapinfo -tam

Enabling swap

swapon

To recycle inetd

inetd -c

to recycle swagentd

swagentd -r

Deshpande Prashant
Honored Contributor

Re: Submit Very Basic System administration commands and win easily points

Hi
Committing an individual patch. (to recover space form /var/adm)

#swmodify -x patch_commit=true

The cleanup command helps listing and committing multiple patches based on no. of superseeded.
#cleanup -p -c 3 -> to list superseeded thrice.
#cleanup -c 3 -> to commit superseeded thrice.

Thanks.
Prashant.
Take it as it comes.
John Payne_2
Honored Contributor

Re: Submit Very Basic System administration commands and win easily points

xstm - X interface to the online diagnostics. Can see HW states, firmware levels, etc.
Spoon!!!!
A. Clay Stephenson
Acclaimed Contributor

Re: Submit Very Basic System administration commands and win easily points

To change/update/examine terminal behavior:

infocmp vt100 > vt100.new (writes vt100's current definition to textfile vt100.new)
vi vt100.new (to change or make a new definition)
tic vt100.new (compile the new entry into the terminfo database)

How long has the system been up?
uptime or who -b

What hardware am I running on?
model or uname -a


If it ain't broke, I can fix that.
Michael Tully
Honored Contributor

Re: Submit Very Basic System administration commands and win easily points

Ever wanted to clean up a machine or partially clean it before it used for something else. One thing a lot of Junior's miss is making sure that the symbolic links hanging around that you may want to remove or to keep are dealt with.

# find / -type l -print | xargs ll >/tmp/link.out
Anyone for a Mutiny ?
Glenn L. Stewart
Frequent Advisor

Re: Submit Very Basic System administration commands and win easily points

Find largest files in a filesystem... great for those times when a filesystem has grown to near max and you would like to find the largest files.

find . | xargs ll -d | sort -nrk5 | head

Or

find . | xargs ll -d | sort -nrk5 | grep "Jan ??" | head

Where Jan ?? is the Month and day of today - ie growing file will be dated today.

Glenn

Glenn L. Stewart
Frequent Advisor

Re: Submit Very Basic System administration commands and win easily points

Finding the cause of a core file.

1. # file core

Should say core with offending executable
This doesn't always work if not try.

2. # strings core | head -n5 | tail -n1

The same cause should be shown on this line.
Deshpande Prashant
Honored Contributor

Re: Submit Very Basic System administration commands and win easily points

Hi
To check the fiber card status.
#fcmsutil
(Driver State should be online.)

#fcmsutil stat

Look for "Bad Rx Char" count for errors.

Thanks.
Prashant.
Take it as it comes.
Victor BERRIDGE
Honored Contributor

Re: Submit Very Basic System administration commands and win easily points

Changing alternate links (for load balancing etc...):
e.g.
vgdisplay -v r5vg05|grep dsk
PV Name /dev/dsk/c6t0d3
PV Name /dev/dsk/c7t0d3 Alternate Link
> vgreduce r5vg05 /dev/dsk/c6t0d3
Device file path "/dev/dsk/c6t0d3" is an primary link.
Removing primary link and switching to an alternate link.
Volume group "r5vg05" has been successfully reduced.
Volume Group configuration for /dev/r5vg05 has been saved in /etc/lvmconf/r5vg05.conf
> vgextend r5vg05 /dev/dsk/c6t0d3
Volume group "r5vg05" has been successfully extended.
Volume Group configuration for /dev/r5vg05 has been saved in /etc/lvmconf/r5vg05.conf
vgdisplay -v r5vg05??grep dsk
PV Name /dev/dsk/c7t0d3
PV Name /dev/dsk/c6t0d3 Alternate Link
There is also pvchange cmd especially pvchange -s

All the best

Victor
Mary Ann Lipa
Valued Contributor

Re: Submit Very Basic System administration commands and win easily points

recovering/restoring corrupted /etc/lvmtab file:
#vgscan -a
Which is worse, smoking or picking your nose in a public place?
Mary Ann Lipa
Valued Contributor

Re: Submit Very Basic System administration commands and win easily points

remane first /etc/lvmtab to another name before executing vgscan....

Create an account at ITRC and check for latest patch releases and updates...

http://itrc.hp.com

;-)
Which is worse, smoking or picking your nose in a public place?
TVS MURTY
Advisor

Re: Submit Very Basic System administration commands and win easily points


Create a file /etc/securetty
which contains a line
console
in it. Give 644 permissions.
This would enable direct root
login only at the console
terminal and no where else.


Thanks

TVS
Alexander M. Ermes
Honored Contributor

Re: Submit Very Basic System administration commands and win easily points

Hi there.
Sonething to kill all processes of some user :

#!/bin/sh
# this should kill off those goners who shut of their PC's
# in an not-so-ok fashion......
#
ps -ef|grep ${1}|grep -v grep|sort|awk '{print "kill -9 "$2}'> /usr/tmp/kill_em
chmod 700 /usr/tmp/kill_em
/usr/tmp/kill_em
ps -ef|grep ${1}
rm /usr/tmp/kill_em


Rgds
Alexander M. Ermes
.. and all these memories are going to vanish like tears in the rain! final words from Rutger Hauer in "Blade Runner"
Alexander M. Ermes
Honored Contributor

Re: Submit Very Basic System administration commands and win easily points

Hi there.
Here another one.
If you have zipped a file and the zipped file is larger than 2 GB, usually you cannot unzip it.
Here a workaround :

cat file | gunzip > new_file

We use this, when we have zipped ORACLE exports on the flight and want to import these data.
Rgds
Alexander M. Ermes
.. and all these memories are going to vanish like tears in the rain! final words from Rutger Hauer in "Blade Runner"