- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Submit you HP-Ux tips and tricks and win easy ...
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
Discussions
Discussions
Forums
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
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
тАО02-26-2002 10:08 AM
тАО02-26-2002 10:08 AM
Re: Submit you HP-Ux tips and tricks and win easy 10points
echo "create filename" > filename.`date +%H%M%S`
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-26-2002 10:15 AM
тАО02-26-2002 10:15 AM
Re: Submit you HP-Ux tips and tricks and win easy 10points
Just like the beloved bash is it capable of doing integer arithmetiks.
A nice goodie that always comes in handy when you have to do some mundane "calculation", say extending filesystems using OnlineJFS.
This is how I do it (say, after I extended the size of the LV to 240 MB)
fsadm -b ((240*1024)) /mount_point
Or, how to do a quick conversion from hex to dec or vice versa (sometimes you need this when tampering with certain kernel tunables
# printf %d\\n 0x1aff
6911
# printf %x\\n 6911
1aff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-26-2002 10:19 AM
тАО02-26-2002 10:19 AM
Re: Submit you HP-Ux tips and tricks and win easy 10points
Of course, it has to be
fsadm -b $((240*1024)) /mnt
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-26-2002 10:39 AM
тАО02-26-2002 10:39 AM
Re: Submit you HP-Ux tips and tricks and win easy 10points
Here are some, I usually set in my .*shrc files.
Someday I discovered, that newer HP boxes are delivered with a manifest file where amogst other things the bloody Serial No. (which you always have to know when calling HP support) is stored.
So I made me this alias (it doesn't have to be Perl for a text filter)
alias serial="perl -ane 'print \"\$F[-1]\n\" if /\s+serial\s*number/i' \ /var/opt/ignite/local/manifest/manifest"
Apropos Perl, I always want to have a quick overview of my installed CPAN modules, this alias could help
alias perlmods="perl -MConfig -MFile::Find -e 'find(sub{ print \"\$File::Find::name\\n\" if /\\.pm\$/ },
@Config{qw(installprivlib installsitelib)})'"
Another often needed number is your host's IP
# host identity
alias myip="awk -F= '/^IP_ADDRESS\[0\]/ {print \$2}' /etc/rc.config.d/netconf| sed 's/\\\"//g'"
alias myname="awk -v ip=\$(myip) '\$1==ip {print \$2}' /etc/hosts"
alias mynet="netstat -in|awk -v ip=\$(myip) '\$4==ip {print \$3}'"
alias mydomain='echo `myname`|cut -d. -f2-$NF'
Then one always has to fiddle with PVs, VGs, and LVs,
so these help me
# typeset -f pvs
pvs ()
{
/usr/sbin/vgdisplay -v $* 2>/dev/null | awk '/PV Name/ {print $NF}'
}
# typeset -f dskinfo
dskinfo ()
{
for pv in $(pvs $* | sed 's/dsk/rdsk/');
do
/usr/sbin/diskinfo $pv;
done
}
# alias vgs
alias vgs='vgdisplay 2>/dev/null|awk '\''/VG Name/{print $NF}'\'''
# typeset -f lvs
lvs ()
{
/usr/sbin/vgdisplay -v $* 2>/dev/null | awk '/LV Name/ {print $NF}'
}
So I can say
# dskinfo $(pvs vg01) | head
SCSI describe of /dev/rdsk/c1t6d0:
vendor: SEAGATE
product id: ST336704LC
type: direct access
size: 35566480 Kbytes
bytes per sector: 512
SCSI describe of /dev/rdsk/c2t6d0:
vendor: SEAGATE
product id: ST336704LC
type: direct access
# lvs vg00
/dev/vg00/lvol1
/dev/vg00/lvol2
/dev/vg00/lvol3
/dev/vg00/lvol4
/dev/vg00/lvol5
/dev/vg00/lvol6
/dev/vg00/lvol7
/dev/vg00/lvol8
/dev/vg00/gnu
/dev/vg00/lvol10
/dev/vg00/lvol11
/dev/vg00/arch_b13
/dev/vg00/zoo
/dev/vg00/lvol12
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-26-2002 10:45 AM
тАО02-26-2002 10:45 AM
Re: Submit you HP-Ux tips and tricks and win easy 10points
PV links are for redundancy but can be used to load balence. If you do a vgdisplay -v on a vg you will see 2 addresses for the disk. The first is used as a primary and the second is backup. If you vgreduce the first address
"vgreduce /dev/dsk/c10/t1/d0 vg02"
the second address becomes the primary. The next step is to vgextend the same disk back
"vgetend /dev/dsk/c10/t1/d0 vg02"
So now the old primary is the backup pvlink. I use this to force single contoler units to use both controlers by doing this to half of the disks. That way there is still redundance if either controler fails but performance is increased if you know where to split the disks.
Obiously on a striped system this is a no-brainer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-26-2002 11:45 AM
тАО02-26-2002 11:45 AM
Re: Submit you HP-Ux tips and tricks and win easy 10points
All I have to offer is a neat way to ensure a tape is actually inserted in the DDS drive before you kick off your make_tape_recovery. See attached for actual script. Modify it to fit your needs and create a no_tape_msg flat file that contains a generic message that requests that operators place a tape in the drive. This way you feel confident that your make_tape_recovery at least has a tape in the drive to work with and if it doesn't you can make yourself and others aware of this fact.
The only other thing I can offer is my favorite telnet proggie for Windows and it's free!
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
-Mike
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-26-2002 11:46 AM
тАО02-26-2002 11:46 AM
Re: Submit you HP-Ux tips and tricks and win easy 10points
How abouth this tips,
A. Shared memory Check
1. # ipcs -ma
2. #ipcs -mob
B. The tools such as "cleanup" to reclaim sum spaces in cleaning the superseed patches.
1. Download & install the utility from the patch PHCO_24347 (11.00) & PHCO_24630 (11i)
2. This will also install "show_patches" & "check_patches" utility
refer man cleanup, show_patches, check_patches for further help after installing the patches, which DON'T NEED a REBOOT.
FYI
Sudalaimani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-26-2002 12:41 PM
тАО02-26-2002 12:41 PM
Re: Submit you HP-Ux tips and tricks and win easy 10points
- #! /bin/csh
for x (`ls`)
set y = `ls $x | tr a-z A-Z`
mv $x $y
end
Joey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-26-2002 12:46 PM
тАО02-26-2002 12:46 PM
Re: Submit you HP-Ux tips and tricks and win easy 10points
- download ???nickel.tar??? at ftp://contrib:9unsupp8@hprc.external.hp.com/sysadmin/inventory
- untar nickel.tar
- run ./nickel
note: this will get all system
information and will save (default)
on /tmp
- create a cronjob
ex. 03 06 * * * /opt/contrib/bin/nickel
-n -o /tmp/tools/System.Info/
note: -o if u want to specify another
output directory
- point your browser to nickel output dir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-27-2002 02:02 AM
тАО02-27-2002 02:02 AM
Re: Submit you HP-Ux tips and tricks and win easy 10points
modify line 5 with your device and mount point. Have fun.
#!/pro/bin/perl -w
use strict;
my ($cmd, $dev, $mnt) = ("mount", "/dev/cd0", "/cdrom");
sub usage ()
{
print STDERR "Usage: $0 [
" mount CD-ROM on $mnt for ISO-9660 with RockRidge extens
ions\n";
exit;
} # usage
@ARGV == 1 and $ARGV[0] eq "-?" || $ARGV[0] =~ m/^-+help$/ and usage;
sub stop (@)
{
print STDERR @_;
exit 1;
} # stop
@ARGV and $mnt = shift;
$< == 0 or stop "You have to be root to be able to mount\n";
$mnt =~ m:^/: or stop "Mountpoint should be an absolute pathname\n";
-d $mnt or stop "Mountpoint $mnt is not available\n";
if ($^O eq "hpux") {
my $fst = "/etc/pfs_fstab";
$cmd = "pfs_mount";
unless (-s $fst) {
-b $dev or stop "Cannot mount $mnt on $dev, device does not exist\n";
open my $fs, "> /etc/pfs_fstab" or stop "Cannot create $fst: $!";
print $fs "$dev $mnt pfs-rrip xlat=unix 0 0\n";
close $fs;
}
unless (grep m/\bpfsd$/, `ps -e`) {
print STDERR "Starting PFS\n";
system "nohup /usr/sbin/pfs_mountd &";
system "nohup /usr/sbin/pfsd &";
sleep 1;
}
unless (grep m/\bpfsd$/, `ps -e`) {
print STDERR "PFS not running\n";
exit $!;
}
}
$0 =~ m/umount/ and $cmd =~ s/mount/umount/;
if (grep m/^pfs_u?mount:/, qx "$cmd $mnt") {
$cmd =~ s/^pfs_//;
system "$cmd $mnt";
}