Operating System - HP-UX
1833443 Members
3712 Online
110052 Solutions
New Discussion

Submit Very Basic System administration commands and win easily points

 
SOLVED
Go to solution
Rita C Workman
Honored Contributor

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

Don't know if anyone has posted this..so if it's a duplicate 'Sorry'

My favorite thing is to fix the .profile of 'challenging' users.

vi /home/user/.profile

As the last two lines I add

/dir/
exit

So when these 'challenging' users login the only app they need automatically runs...and when they exit the job...they are automatically logged out of system....Ahhhh!! Yup, 2 little lines I have come to love.

Rgrds,
Rita
u856100
Frequent Advisor

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

To push an existing UNIX process into the background ONCE it has started :

# z (in the inception shell)
# bg (pushes program to background)

Now the shell can be utilised again

cheers
John
chicken or egg first?
K.Vijayaragavan.
Respected Contributor

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

Simple command to take print in network printers?

#hpnpf -n -x file

-vijay
"Let us fine tune our knowledge together"
Kristopher March
Regular Advisor

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

insf - used to install special files in device directory.
*helpful when one of our fddi lan cards suddenly dissapeared.
"This ain't no burger flippin job!"
mahmoud fayed
Occasional Contributor

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

Hi,
#ioscan -fnC disk -> to know physical disk h/w pth and status(claimed or not)
#strings /var/adm/wtmp -> to read wtmp bin file
#fuser -ku /dev/vgxx/filesystems -> to kill all user using that filesystem

To build a new kernel after modification done by SAM UX 11.0:
1-#cd /stand
2-#cp /stand/system /stand/system.prev
3-#cp /stand/build/system.sam /stand/system
4-#kmupdate /stand/build/vmunix_test
5-#shutdown -rn



think about it logically
James George_1
Trusted Contributor

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

To supersede the patch level ( To save space on /var or /var/adm/...)

# cleanup -cx ( where x is the run level, eg: 2,3,4 ..)

# /usr/sbin/syslogd start ( If syslog daemon is not running )

# To change the hernel configurations..

# Edit the system file
# mk_kernel -s /stand/system -o /stand/vmunix.new
# kmupdate /stand/vmunix.new

James
forum is for techies .....heaven is for those who are born again !!
Steve Steel
Honored Contributor

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

catman -w

-w

Causes only the /usr/share/lib/whatis database to be created. No manual reformatting is done.

man -k keyword

All man pages with keyword in title

text manpages
man $*|sed -e 's/_^H//g' -e 's/^H.//g'|pg


Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
Josh_13
Super Advisor

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

this one will show you everything in one particular logical volum group. it's good for cleaning up say /

du -x /


i needed this when i found that i had root at 98% full and was trying to find out why.
worked really well. i found a rather lagre file in dev that was 69% of the used space.
Justo Exposito
Esteemed Contributor

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

NAME
nohup - run a command immune to hangups

SYNOPSIS
nohup command [arguments]

DESCRIPTION
nohup executes command with hangups and quits ignored.

It's very usefull if you use it with & (background jobs).

Regards,

Justo.
Help is a Beatiful word
K.Vijayaragavan.
Respected Contributor

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

Here is one more command that i got from forum itself,

#graphinfo

to display the graphics configuration details including the extensions loaded and support informations.

-Vijay
"Let us fine tune our knowledge together"
Xavier Gutierrez
Frequent Advisor

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

Hi, all

Copying a filesystem's structure and files to another filesystem before the disk it resides in dies completely:

cd
find . -depth -print | cpio -pd


After disk HW replacement:

vgcfgrestore -n vgxx /dev/rdsk/c?t?d?
vgchange -a y vgxx (-a e if in cluster environment)
newfs -F /dev/vgxx/rlvoly (for each lvol in the disk)
mount (+options)
cd
find . -depth -print |cpio -pd

That's it

Regards,

Xavier
Live fast, die young!
Josh_13
Super Advisor

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

Xavier : doesn't cp miss things like symbolic links? i was once told that by someoen that knows unix systems much better than i. as a result, if i'm copying a directory or structure i do one of the following:

1: (transfer a directory)
cd /
tar -cf - | (cd ; tar -xf -)

is optional if you want to move to another host for the backup

is the absolute path of the directory you want to backup to.



2: (back up a directory)
tar -cf -c

is the absolute path of the file being created

is the directory you want to back up



3: (disk slice image)
dump 0f - /old | (cd /new restore -rf -)

/old is the (absolute path of the) directory being transfered (in this case temporarily backed up)

/new is where you're moving it to (absolute path)


if i feel that the information is critical to the computer running i use the second method there so that i can keep the tar file until the transfer has been proven successful. this allows restoring to be faster since i don't have togo to the site's tape backup, which could have beome impossible depending on the directory moved.
Kenny Chau
Trusted Contributor

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

To view the priority of the process:

ps -el |more

To change the relative priority:

nice - command

To change the real-time priority:

rtprio command


Regards,
Kenny.

Kenny
Maurice Skubski
Trusted Contributor

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

check if a OVO agent is running on the system:
----------------------------------------------
> opcagt -status
or
> /opt/OV/bin/OpC/opcagt exist?

check which templates are enabled / disabled:
---------------------------------------------
> opctemplate -l

find the Managementserver:
--------------------------
> more /opt/OV/bin/OpC/opcinfo

in this file you can also enable the trace option.

;)
TIP: ITO was renamed to VPO. And now with Version 7 it is renamed to OVO (OpenView Operations)
Robert Gamble
Respected Contributor

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

Bounce back to the top ...
pap
Respected Contributor

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

to increase the filesystem size on a system running OnlineJFS.

lvextend /dev/vgXX/lvolX

fsadm -F vxfs -b XXXXXXX

b=1024 x filesystem size in MB.

-pap
"Winners don't do different things , they do things differently"
PIYUSH D. PATEL
Honored Contributor

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

To make a mirror of root vg

1. pvcreate -b /dev/rdsk/c1t2d0 ( root mirror )
2. vgextend /dev/vg00 /dev/rdsk/c1t2d0
3. mkboot /dev/rdsk/c1t2d0
4. mkboot -a "hpux -l q (;0)/vmunix" /dev/rdsk/c1t2d0

5.lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c1t2d0
lvextend -m 1 /dev/vg00/lvol3 /dev/dsk/c1t2d0
lvextend -m 1 /dev/vg00/lvol2 /dev/dsk/c1t2d0

6. lvlnboot -b /dev/vg00/lvol1
lvlnboot -v -r /dev/vg00/lvol3
lvlnboot -s /dev/vg00/lvol2

7. lvlnboot -R
8. lvlnboot -v

Thats it..
Your root mirror is created.

Piyush
steven Burgess_2
Honored Contributor

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

Hi

Perl example

For bdf usage ( filesystems above 80% )

bdf -l | perl -ne '/(\d+)%/&&$1>80&&print'

Finding deadlinks

find -type l -print | perl -nle '-e || print'

If you can't readily tell which directory has the growing file, try this:

find / -type d -xdev | xargs du -sk >file1
sort -k2,2 file1 >sorted1

Wait awhile (30 minutes?)

find / -type d -xdev | xargs du -sk >file2
sort -k2,2 file2 >sorted2
join -j 2 sorted1 sorted2 >file3

file3 will be formatted as:
directory firstsize secondsize

Simply look for large discreprencies between the first and second sizes to narrow down to a directory. Then you can hopefully identify the file.

Steve
take your time and think things through
George_Dodds
Honored Contributor

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

To check if a system is trusted run :-

usr/lbin/getprdef

You'll either get message 'system is not trusted'
or a return code 2 if it is.

Cheers

George
kish_1
Valued Contributor

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

hello
How to give name to terminal
echo "^[]0;babu^G"

How to find out file system is supported large file system

fsadm -F vxfs /mountarea
share the power of the knowledge
H.Merijn Brand (procura
Honored Contributor

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

Make kmtune output usable with attached perl script
Enjoy, Have FUN! H.Merijn
John Carr_2
Honored Contributor

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

Hi

stop internet services deamon

inetd -k

this will stop hosts connecting through ftp, rcp , remsh , rlogin and telnet.

start it up again with inetd -c

John.
Simon Wickham_1
Occasional Advisor

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

Checkeing Processes :
ps -ef | grep "name of process" | awk ' { printf "Process id = %s Parent Process id = %s\n", $2, $3 }'

ps -ef | grep -v grep | grep | awk '{print $2,$3}'

ps -ef aux |head -10



Example :
We will look here at the syslog daemon :
ps -ef | grep "syslogd" | awk ' { printf "Process id = %s Parent Process id = %s\n", $2, $3 }'
Process id = 303 Parent Process id = 1
Process id = 2105 Parent Process id = 2074

Note :
The higher number is the child and the lower the parent pid number.




Help required
John Carr_2
Honored Contributor

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

Hi

changing file ownerships

chown username filename

changing group ownership

chgrp groupname filename

changing group and username in one go

chown groupname:username filename

John.
Anonymous
Not applicable

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

To get a shell prompt indicating user, host and working directory {may leave out the $(echo .*) }
add to $HOME/.profile:
export PS1=$(whoami)@$(hostname)$(echo "\033[7m")['${PWD##*/}']$(echo "\033[0m ")

More about what sh can do for you in
man sh-posix

To leave a footprint in /var/adm/syslog/syslog.log
logger "the message goes here"

To monitor in syslog what values vhand sees
vhandinfo on
(see script attached)

Document your systems while they are running eg with cfg2html
http://groups.yahoo.com/group/cfg2html/