Monday, August 25, 2008

Using linux as a serial console

[pstubbs@burpless ~]$ sudo cat /proc/tty/driver/serial
serinfo:1.0 driver revision:
0: uart:16550A port:000003F8 irq:4 tx:0 rx:0 CTS|DSR|CD
1: uart:unknown port:000002F8 irq:3
2: uart:unknown port:000003E8 irq:4
3: uart:unknown port:000002E8 irq:3
[pstubbs@burpless ~]$ cat /dev/ttyS0
cat: /dev/ttyS0: Permission denied
[pstubbs@burpless ~]$ sudo cat /dev/ttyS0

[pstubbs@burpless ~]$ sudo cu -l ttyS0 -9600
Connected.

Friday, July 11, 2008

find the EBN names for EMC devices in a device group

This script will list all the EBN (Veritas enclosure based names) for the disks in the named EMC device group

#!/usr/bin/ksh

PATH=/usr/sbin:/usr/bin:/usr/ccs/bin:/usr/ucb:/usr/proc/bin:/usr/platform/SUNW,Sun-Fire-15000/sbin:/etc/vx/bin:/usr/local/bin:/usr/local/sbin:/usr/storapi/bin

# list the character devices in the given EMC device groups
[[ $# -lt 1 ]] && echo "[FATAL]Must give one or more EMC device groups" && exit 1
[[ $(uname -s) != 'SunOS' ]] && echo "[FATAL]Only works on Solaris" && exit 1

# show the emc device names that correspond to each of the devices in an EMC device group
dev_groups="$@"
# work through the given EMC device groups
for _dev_group in $dev_groups
do
# save the Symmetrix ID of the device group so that we get the right disks later
_sym_enc_id=$(symdg show $_dev_group | grep 'Symmetrix ID' | awk '{print $NF}')
for _sym_dev in $(symdg show $_dev_group | grep 'DEV[0-9]' | awk '{print $3}')
do
# find the disks with both device id and Symmetrix ID that match.
for _rdev in $(syminq -symmids | nawk -v sd=$_sym_dev -v se=$_sym_enc_id '{if (NF>3 && match($(NF-1), "[0-9A-E][0-9A-E][0-9A-E]"sd"[0-9A-E][0-9A-E][0-9A-E]") && $(NF-3) == se ) {print $1; exit}}')
do
_base_dev=${_rdev##*/} # basename $_rdev
_emc_path=$(vxdisk path | grep $_base_dev | awk '{print $2}')
echo $_dev_group $_sym_enc_id $_sym_dev $_emc_path
done
done
done

How to sleep until an hour has elapsed.

Let say you want to run a script and then run another one an hour after the current one started
# in the first script
# save the current time

awk 'BEGIN { srand(); printf("%d\n", srand()+3610)}' > /tmp/start_time
 

# in the second script
# sleep until the rest of the hour has passed.

ONE_HOUR_LATER=$(cat /tmp/lstart_time)
SLEEP_TIME=$(awk -v ohl=$ONE_HOUR_LATER 'BEGIN { srand(); printf("%d\n", ohl-srand())}')
sleep $SLEEP_TIME
 

The trick is that srand will return the seconds since the epoch on it's first call. Yes it's in the man page, but on solaris it seems to be the second call. Beware!

Wednesday, July 09, 2008

Who's logged on when 'w' or 'who' won't work

Sometime you can't use 'w' or 'who' to see who's logged on. Some dodgy tools don't update 'wtmp' when they spawn a shell for a connecting user. Opsware is such a tool. In such cases you need to find processes with controlling terminals to see who's logged on

  • HPUX & Solaris
ps -ef | egrep 'pts/[0-9a-z]' | grep -v $$


  • AIX (less than perfect, but a start)
ps -efo pid,ppid,user,tty,args | awk '$4!="-" {print}' grep -v $$


I have not idea how to communicate with them once you find them since wall won't work :~(

Tuesday, June 10, 2008

Using korn shell functions with xargs

It's not easy to call fuctions with xargs. Even when they're exported they can't be invoked by xargs. But there's a way using eval like this.

#!/bin/ksh
function myecho_function
{
echo In myecho_function
echo $@
}

OLDIFS=$IFS
IFS='
'

for line in $(find ~ -type f -print | xargs echo myecho_function)
do
# this will call the function the minumum number times
eval $line
done

IFS=$OLDIFS

Thursday, September 21, 2006

HP/UX kernel building

Kernel building on UX 10.x

  1. cd /stand/build

  2. Create a new system file from the running kernel.

    /usr/lbin/sysadm/system_prep -s /stand/build/system


  3. Edit the kernel with the planned changes.

    vi /stand/build/system


  4. Build the new kernel.

    /usr/sbin/mk_kernel -s /stand/build/system


  5. Copy the old system and vmunix files so if anything goes wrong, the system can be booted from the old kernel.
    cp /stand/system /stand/system.prev
    cp /stand/build/system /stand/system
    cp /stand/vmunix /stand/vmunix.prev
    mv /stand/build/vmunix_test /stand/vmunix

  6. Reboot the system from the new kernel.

    shutdown -r



Kernel building on UX 11.xx


  1. cd /stand/build

  2. Create a new system file from the running kernel.

    /usr/lbin/sysadm/system_prep -s /stand/build/system


  3. Edit the kernel with the planned changes.

    vi /stand/build/system


  4. Build the new kernel.

    /usr/sbin/mk_kernel -s /stand/build/system


  5. Copy the old system and vmunix files so if anything goes wrong, the system can be booted from the old kernel.
    cp /stand/system /stand/system.prev
    cp /stand/vmunix /stand/vmunix.prev
    rm -rf /stand/dlkm.vmunix.prev
    cp -R /stand/dlkm /stand/dlkm.vmunix.prev
    cp /stand/build/system /stand/system

  6. Move the new system file and new kernel into place, ready to be used when rebooting the system.

    mv /stand/build/system /stand/system
    kmupdate /stand/build/vmunix_test

  7. Reboot the system from the new kernel.

    shutdown -r


Installing an ignite boot helper

installing a Ignite boot helper
swinstall -s ignite:/swdepot/Ignite/IgniteUX Ignite-UX.MinimumRuntime
/opt/ignite/bin/instl_adm -t <IgniteServerIP>
/opt/ignite/bin/instl_adm -d
vim /etc/opt/ignite/instl_boottab

Itanium systems don't use /etc/opt/ignite/instl_boottab but have to use /etc/bootptab So on such systems edit /etc/bootptab. Then edit /etc/inetd.conf to activate bootps and tftpd, run inetd -c

YUM update source on whitebox/Centos/RHEL

Changing the YUM update source on whitebox. Edit /etc/yum.conf and /etc/sysconfig/rhn/sources

IPv6 on SLES 9


  • The 'IPv6-in-IPv4' tunnel is done by the network interface sit0. It can be configured with the /sbin/ip command as per the Linux IPv6 HOWTO

  • You can see the tunnels with /sbin/ip -6 tunnel show

  • You can see the IPv6 routing table with /sbin/route -A inet6

SAM log viewer

To see what sam been doing use /usr/sam/bin/samlog_viewer or read /var/sam/log/samlog by hand.
When a system is running in trusted mode, even the root account can be locked out to network access. To unlock it simply log in as root on the console. If not run modprpw -k root. To take a system out of trusted mode run sam or
/usr/sbin/audsys -f
/usr/lbin/tsconvert -r
and to re-trust it sam and enter trusted mode. The option to 'untrust' a system is in the action menu on most of the applets in the sam area 'Auditing and Security'

Unix 'tree'

Not much use, but clever. This will print a directory listing similar to the windows/dos 'tree' command
ls -R | grep ":" | sed -e 's/://' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-//'

Cache Directory Tagging

Cache Directory Tagging Standard defines a standard way of marking directories to be excluded from backup/searches/indexing etc. It ties nicely into the gtar option --exclude-caches.

Update a system to the stable branch of OpenBSD

To update the system source to the stable branch of OpenBSD run this
#!/bin/sh

export CVS_RSH=/usr/bin/ssh
#export CVSROOT=anoncvs@anoncvs.de.openbsd.org:/cvs
export CVSROOT=anoncvs@anoncvs.no.openbsd.org:/cvs
VERSION=`uname -a | awk
# initial get
cd /usr; cvs checkout -P -rOPENBSD_${VERSION} src
else
# update
cd /usr/src
cvs -q up -rOPENBSD_${VERSION} -Pd
fi

Fast shutdown except when Oracle's running

To shutdown labs in a hurry, this command will immediatly halt anything not running oracle and cleanly shutdown oracle
ps -ef | grep [o]ra || /usr/sbin/reboot -qh; init 0; tail -f /etc/rc.log

To find the processor architecture on HP/UX


  • To find the processor architecture on UX
    print 'selclass qualifier cpu;info;wait;infolog' | /usr/sbin/cstm | grep 'CPU Module'

  • Processor speed
    print itick_per_usec/D | adb -k /stand/vmunix /dev/kmem

  • How much memory is in my system?
    grep Physical /var/adm/syslog/syslog.log
    or
    print 'memory_installed_in_machine/D' | adb -k /stand/vmunix /dev/kmem | perl -nle '/(\d+)/&print$1*4,"k"'
    or
    print memory_installed_in_machine/D  | adb -k /stand/vmunix /dev/kmem
    or
    print 'selclass qualifier memory;info;wait;infolog' | /usr/sbin/cstm | grep 'Total Configured'

  • What's my system's serial number?
    print 'selclass qualifier system;info;wait;infolog' | /usr/sbin/cstm | grep 'System Serial Number'

Profiling a Perl script

When profiling a script using
export PERL5OPT=-d:Dprof You need to unset PERL5OPT before running profiling a script because that's a perl script too and it will overwrite your tmon.out and wreck the results. Only use PERL5OPT if you can't invoke perl directly with -d:Dprof as with inquest.

Changing the hostname on SLES 9.0

You can change the hostname on a SLES system without being disconnected using yast2 dns Intuitive isn't it?

Perl regex to parse out the swinstall.hosts from /.sw/defaults.hosts

Perl regex to parse out the swinstall.hosts from /.sw/defaults.hosts The string can be like this

swinstall.hosts = {ws01 s003 s002 s001 a7altsrv a7server}

or

swinstall.hosts = {
s004
s001sdb1
s003
s002p1
s002
ws01
s001p1
s001
a7server
}

Ie. The code needs to deal with line breaks

undef $/;
open(DH, "</.sw/defaults.hosts") or die "unable to open default.hosts\n";
$file = <dh>;
close(DH);
$file =~ m/
swinstall\.hosts # Match the beginning of the hosts we want
(?:.*?) # followed by a space or not. Minimal match
= # followed by an '='
(?:.*?) # followed by a space or not. Minimal match
{ # followed by the open brace to begin the list of hosts
(.*?) # followed by some characters which are the
# hostnames saved into a back reference
} # followed by the close brace
/six;
print $1 . "\n";

To create a tape SD depot

To create a tape depot

swpackage -x autoselect_dependencies=false -x autoselect_dependencies=false -x media_type=tape -s /swdepot/depot package,r=revision @ /tmp/file.depot

To register and list the depot
swreg -l depot -x run_as_superuser=false /tmp/file.depot
swlist -l fileset -s /tmp/file.depot

To unregister the depot
swreg -l depot -u /tmp/file.depot

xauth, su and sudo with ssh X tunneling

Some xauth notes to su from root but keep the same ssh tunnel for X11
# save the MIT-MAGIC-COOKIE for the current X display to a file (/tmp/xauth.out)
xauth extract /tmp/xauth.out $DISPLAY
# save the DISPLAY variable to a file (remember env is lost)
echo $DISPLAY > /tmp/DISPLAY
# make sure the su'd id can read the files
chmod 666 /tmp/xauth.out /tmp/DISPLAY
# su
su - oracle
# setup a new XAUTHORITY file
export XAUTHORITY=/tmp/xauth
# load DISPLAY
export DISPLAY=$(cat /tmp/DISPLAY)
# Load the MIT-MAGIC-COOKIE for root's display
xauth merge /tmp/xauth.out
# run the X application
/usr/bin/X11/xclock
Or as a single command
xauth extract /tmp/xauth.out $DISPLAY; echo $DISPLAY > /tmp/DISPLAY; \
chmod 666 /tmp/xauth.out /tmp/DISPLAY; su - oracle -c \
"export XAUTHORITY=/tmp/xauth; export DISPLAY=$(cat /tmp/DISPLAY); \
xauth merge /tmp/xauth.out ; /usr/bin/X11/xclock"

HP SmartArray RAID Controller Family config

# remove the old LV (use sam or whatever)
# save the current config details
sautil /dev/ciss4 > /tmp/current_config
# delete all the config on the array
saconfig /dev/ciss4 -D all
# create the new raid
saconfig /dev/ciss4 -R 5 -p 1:0 -p 1:1 -p 1:2 -p 1:3 -p 1:4 -p 1:5 -p 1:8 -p 1:9 -p 1:10 -p 1:11 -p 1:12 -p 1:13 -p 1:14 -p 1:15
ioscan
insf -e

# Create the new LV. Don't forget to allow for largefiles!

Cisco IP accounting info

IP accounting information can be gleaned from the cisco routers with these commands.

router(config)# interface
router(config-if)# ip accounting
router(config)# ip accounting-threshold 10000
router# show ip accounting


Accounting can be reset with
router# clear ip accounting

It's best not to leave the accounting configured when it's not needed.

RDP to the console

You can connect to the console of Windows systems using
mstsc /console /v:hostname or IP

YOU server setup notes

YOU server setup notes
To setup a new YOU server start yast2 to do a YOU sync using official credentials which will put all the patches into /var/lib/YaST2/you/mnt/.
If you want to snapshot that directory, it has to be copied/moved to another place and /etc/apache2/conf.d/you_server.conf should be copied and modified share the new location. The YOU server (httpd) should be restarted for the changes to be activated. Use yast2 for this

To tune SCSI cards on HP/UX

To tune SCSI cards on HP/UX go into the BCH (Boot Console Handler) SERvice menu and use the SCSI command.
Service Menu: Enter command > help scsi
------- SCSI Help -------------------------------------------------------------
SCSI displays the SCSI controller parameters. SCSI is also
used to set parameters for a SCSI controller at a specified path.
These parameters are used by the operating system SCSI driver.
If a parameter is set to Unknown or a path is not in the table,
a firmware suggested SCSI controller parameter is used by the
SCSI driver. The firmware suggested value for the initiator id is 7.
An exception is for the termination. If the SCSI card does not support
SCSI Parameters, then the TERM setting will be displayed as UNKNOWN.
In this case, the termination is not programmatically controlled.
SCSI Display all SCSI controller parms
SCSI Display SCSI control parms specific path
SCSI INIT Set initiator id for specified path
SCSI RATE Set transfer rate for specified path
SCSI TERM Set auto term for specified path
SCSI WIDTH Set bus width for specified path.
SCSI DEFAULT Set a specific path to use default parms
SCSI DEFAULT Set SCSI devices to use default parms.
is in I/O notation, such as 1/2/3/4 (SBA/LBA/DEV./FUNC.)
is an integer in the range 0..15 Default: 7
= SLOW, FAST, ULTRA, ULTRA2, ULTRA160, ULTRA320,
or NOLIMIT (where NOLIMIT means use max) Default: max
is either 0, 8, or 16 (where 0 means use max) Default: max
is either ON, OFF, or DEFAULT Default: ON
Short Command for SCSI: SCSI

HP/UX Page Deallocation Table

When bit errors occur in the memory of HP/UX systems the error is logged in the PDT (Page Deallocation Table). To see the PDT boot the system to the BCH (Boot Console Handler), go into the SERvice menu and then PDT. The HP guy said that finding a couple of dozen on older machines is normal and doesn't matter although the table is much smaller on them. The RPs have 3000 slots and the systems of the vintage of D's only have 128.

Service Menu: Enter command > help PDT
---- PDT Help ----------------------------------------------------------------
PDT will display the contents of the Page Deallocation Table.
PDT CLEAR will clear the Page Deallocation Table and then hard
boot the system. The PDT CLEAR command will cause memory to be
reconfigured when the system is rebooted.
PDT Display PDT contents
PDT CLEAR Clear the PDT
NOTE: When the CLEAR command is executed the user is first
queried before proceeding to clear the PDT.


This information is also available from STM (xstm and cstm) (thanks Dave!)

Some HP/UX LVM notes

  • To make volume groups by hand
    mkdir /dev/vg01 /dev/vg02
    /usr/sbin/mknod /dev/vg01/group c 64 0x010000
    /usr/sbin/mknod /dev/vg02/group c 64 0x020000
  • Create physical volumes
    /usr/sbin/pvcreate /dev/rdsk/c5t0d0
    /usr/sbin/pvcreate /dev/rdsk/c6t0d0
  • Add the disks to the volume groups (remember to make sure the max extents per disk are large enough for future larger disks, it can't be changed in the future)
    /usr/sbin/vgcreate -e 15000 /dev/vg01 /dev/dsk/c5t0d0
    /usr/sbin/vgcreate -e 15000 /dev/vg02 /dev/dsk/c6t0d0
  • Create some logical volumes
    /usr/sbin/lvcreate -L 23436 -s y /dev/vg01
    /usr/sbin/lvcreate -L 2604 -s y /dev/vg01
    /usr/sbin/lvcreate -L 23436 -s y /dev/vg02
    /usr/sbin/lvcreate -L 2604 -s y /dev/vg02
  • To recreate /etc/lvmtab
    mv /etc/lvmtab /etc/lvmtab.old
    vgscan -av
  • To import disks into a volume group with
    vgimport -v /dev/vg01 /dev/dsk/c4t5d0 /dev/dsk/c4t12d0
    don't worry if you get the disks wrong. vgimport checks the disk to see if they are all in the same LV you might be able to find which disks belong in which VG from strings /etc/lvmtab but only if they've been on that system before.
  • Net recovery does these things to import VG's after a recovery
    /usr/sbin/vgimport -v -m /etc/lvmconf/vg01.mapfile /dev/vg01 /dev/dsk/c3t15d0
    /usr/sbin/vgchange -a r vg01
    test -d /dev/vg00 && /usr/sbin/vgcfgbackup /dev/vg00
    test -d /dev/vg01 && /usr/sbin/vgcfgbackup /dev/vg01
  • this will create the map file for use in the above
    /usr/sbin/vgexport -p -m /etc/lvmconf/vg01.mapfile /dev/vg01
  • if restoring a vg config to a new disk (make sure the SCSI ID is the same)
    vgcfgrestore -n /dev/ /dev/dsk/
    then activate the VG
    vgchange -a y

Wednesday, September 20, 2006

Calculate pi

Sum this i = 0 -> infinity to calculate pi. It will calculate one Hex digit of pi every iteration.

pi=((4/((8*i)+1))-(2/((8*i)+4)) - (1/((8*i)+5))-(1/((8*i)+6)))/(16^i)

Update initrd

To update the contents of the SLES 9.0 initrd.

mv initrd initrd.gz
gunzip initrd.gz
mount -o loop /tmp/initrd /mnt

Edit /mnt/info as needed

cd /tmp
umount /mnt
gzip -9 initrd
mv initrd.gz initrd

Put the initrd back into place to build the install CD

rsync to preserve hard links

rsync --partial --delete -Pav -H host:/path /path

To build mkcdrec for use in the labs

To build mkcdrec for use in the labs. Get the source RPM and install it onto a SLES system with gcc installed. Install the source RPM, then extract the tar ball under /usr/src/packages/SOURCE.

cd /usr/src/packages/SOURCE
tar xzvf mkCDrec_v0.8.5.tar.gz
cd mkcdrec

Change the file Config.sh with the following

CHECK_BAD_BLOCKS="-c"

EXCLUDE_LIST= Make it what ever you want

AUTODR="y"
INITRDSIZE=8192
LINUX_KERNEL="/boot/vmlinuz"
MAXCDSIZE=700000

Extract mkCDrec_v0.7.9_utils.tar.gz into the mkcdrec directory

cd /usr/src/packages/SOURCE/mkcdrec/
tar xzvf /tmp/mkCDrec_v0.7.9_utils.tar.gz

Fix a crazy scsi disk major number problem

cd /var/opt/mkcdrec/scripts
perl -i.old -pe 's/major=65/major=8/g' clone-dsk.sh make_common.sh restore-fs.sh

Create a source tarball named with the Version: number below

cd /usr/src/packages/SOURCES
tar czvf mkCDrec_v0.8.5_TSD.tar.gz mkcdreci
rm -rf mkcdrec

Alter the SPEC file to mark the build as a custom one

cd /usr/src/packages/SPECS/
vim mkcdrec.spec

Change Version: v0.8.5 to Version: v0.8.5_TSD or something. Here's a diff of the changes I made to get it working

8c8
<> Version: v0.8.5_TSD
90a91
> mkdir -p $RPM_BUILD_ROOT%{_prefix}/utilities
130a132,134
> for fname in `find utilities -type f`; do
> install -m 755 $fname $RPM_BUILD_ROOT%{_prefix}/utilities
> done
182a187
> %{_prefix}/utilities

Then rebuild the binary package

cd /usr/src/packages
rpmbuild -bb SPECS/mkcdrec.spec

The resulting binary backage will be in /usr/src/packages/RPMS/i586/

Friday, May 19, 2006

A SUN E4000: Clock board TOD does not match TOD on any IO board

A SUN E4000 was giving the warning "Clock board TOD does not match TOD on any IO board" at boot time. This is easily fixed with the OpenBoot command "copy-clock-tod-to-io-boards"

Tuesday, March 28, 2006

building grubby for SLES9

grubby is part of mkinitrd-3.5.13-WB1 on RHE/WB etc. Grab the srpm from linux7 and extract the .tgz. To get grubby to build you need to add #include in grubby.c then build and install the popt library. Then it just builds. Once it's built, recompile it with

cc -o grubby grubby.o mount_by_label.o -Wl,-Bstatic -lpopt -Wall -DVERSION=\"3.5.13\"

to make it statically linked, strip it, then copy it to where every it's needed.

recovering from a change in device paths under HP/UX

Added a NIC to an HP/UX system and had to move the HSC SCSI card as a consequence. This meant that the device paths to the NIKE RAID array changed and the volume groups didn't mount on reboot. We had to import the volume groups like this

depot # strings lvmtab
/dev/vg00
wV60?{
/dev/dsk/c2t6d0
/dev/swdepot
wV60@
/dev/dsk/c3t0d0
/dev/tmp
wV60@
/dev/dsk/c3t0d1


The VG 'swdepot' was on /dev/dsk/c3t0d0 and tmp was on /dev/dsk/c3t0d1. To see where they've moved to

depot # ioscan -funC disk
Class I H/W Path Driver S/W State H/W Type Description
=====================================================================
disk 3 8/4.0.0 sdisk CLAIMED DEVICE DGC C2300WDR5
/dev/dsk/c4t0d0 /dev/rdsk/c4t0d0
disk 4 8/4.0.1 sdisk CLAIMED DEVICE DGC C2300WDR5
/dev/dsk/c4t0d1 /dev/rdsk/c4t0d1
disk 0 8/16/5.6.0 sdisk CLAIMED DEVICE SEAGATE ST34573N
/dev/dsk/c2t6d0 /dev/rdsk/c2t6d0


Because the old volume groups are in /etc/lvmtab it needs to be moved aside

depot # mv /etc/lvmtab /etc/lvmtab.OLD

Import the volume groups with

depot # vgimport swdepot /dev/dsk/c4t0d0
depot # vgimport tmp /dev/dsk/c4t0d1


Then activate them with

vgchange -a y swdepot
vgchange -a y tmp


Recreate /etc/lvmtab with vgscan -av and mount them or reboot.

Extending a logical volume on HP/UX

Extended the /depot volume on depot_host with the following commands

depot_host:user$ sudo lvextend -L 24000 /dev/vg01/lvol1
depot_host:user$ lvdisplay /dev/vg01/lvol1
depot_host:user$ bc
24000*1024
24576000
depot_host:user$ sudo fsadm -F vxfs -b 24576000 /depot

Creating an ignite image for the Itanium.

Creating an ignite image for the Itanium. I ignited it to the Foundation OE without the platform patches and without any of our post-install scripts. Then

rcp 10.0.0.102:/opt/ignite/data/scripts/make_sys_image /tmp
init 1
/tmp/make_sys_image -l 2 -s local -m c -c g -n UX1123_0304_64bit.gz
rcp /var/tmp/UX1123_0304_64bit.gz 10.0.0.102:/swdepot/Images


It puts the image in /var/tmp

Lan booting the rx2600 Itanium system

Lan booting the rx2600 Itanium system. Go to the EFI shell and issue the command lanboot select. This will give the choice of which ethernet interface to use. I believe that the default it the gigabit interface or the one that's got a link, but it will show the MAC address for each of them at this stage. It requires that there be a dhcp/bootp and tftp server in broadcast range. There's good help on the Ignite FAQ. Particularly the entry on PXE-E16 errors Ensure that there's an entry in /etc/bootptab like this

ignite-defaults: ht=ethernet: hn: bf=/opt/ignite/boot/nbp.efi: bs=48

test4: tc=ignite-defaults: ha=00306EF34BAA: sm=255.255.255.0: gw=10.224.0.1: ip=10.224.0.234

test5: tc=ignite-defaults: ha=00306EF3FB21: sm=255.255.255.0: gw=10.224.0.1: ip=10.224.0.235

Here I've added both the cards in a particular system.

booting from an IDE cd-rom on a HP RP3410

Booting rp3410s
sea IPL
doesn't find a bootable disk even when there's a CD in the drive. Just search and boot. The CD is an IDE device so that might be why.
To get sd commands working on a system without a network you would
  • boot to single user mode (press any key within 10 seconds -> bo pri isl -> interact with ipl yes -> hpux -is)
  • mount -a
  • touch /var/adm/sw/standalone
  • vi /etc/hosts (127.0.0.1 {hostname} loopback
  • mv /etc/resolv.conf /etc/resolv.conf.sav
  • mv /etc/nsswitch.conf /etc/nsswitch.conf.sav
  • /sbin/init.d/hostname start
  • /sbin/init.d/net.init start
  • /sbin/init.d/net start
  • /usr/sbin/swagentd &

Multiple putty keys

If you have 2 or more shortcuts to keys in your start menu you end up with 2 putty agents running. The solution is to start the agent with the two keys and remove the shortcuts to the other keys. Create a new shortcut with something like this as the command line

"C:\Program Files\PuTTY\pageant.exe" \putty.PPK \labs.PPK

Or similar

HP/UX ntp man page errors

The man page for ntpq on HP-UX says that "delay", "offset" and "disp" are displayed in seconds. They are actually displayed in milliseconds.

HP B-132 workstations and 10/100 NICs

B132s with serial numbers less than 3630908000 can't take 5509 100Mb ethernet card without a backplane update.

HP G-Class memory fault code

A FLT 705A on a G-Class means that the memory in slot 5A is faulty. In this case the stick had died and needed to be replaced

Cisco unnumbered loopback

Cisco allows you to assign an IP address to the loop back and use that with the IP unknumbered interfaces. The advantage is that the loopback never goes down. I don't think we can use it since we'd need an IP address for the loopback and for the ethernet (you can only use IP un-numbered on serial links) and we'd need to publish the route to the loopback via OSPF as well. See these pages 1 2 for more info.

SD and NIS

Because sd commands are a bit strange you need the NIS tokens in /etc/passwd (+::-2:600001:::) and /etc/group (+:*:*) if you use NIS accounts.

to multisite a VOB

multitool rename replica:original@/projects/VOB-name replica:region@/projects/VOB-name
multitool chreplica -host rgyserv /projects/VOB-name
multitool mkreplica -export -fship -work /tmp/vob_sync remote-vob-server:remote-region@/projects/VOB-name

multitool mkreplica -import \
-nc \
-workdir /tmp/vob_sync_x \
-options noauto \
-preserve \
-public -password pass\
-tag /projects/VOB-name \
-vob /data/path/VOB-name.vbs \
-host vob-server.com \
-hpath /data/path/VOB-name.vbs \
-gpath /data/path/VOB-name.vbs \
packetname
remote-host# ct lsvob -long /projects/VOB-name

Cisco router filtering example

This is a router config set that will add filters to ethernet0. Something like it will be applied to the top level router in the to improve secuirty

config terminal
!
! make sure the DNS is setup
ip domain-name domain.name.com

ip name-server xx.xx.x.xx

!
! for lab-bb
! interface FastEthernet0/0
!
interface ethernet 0
no ip access-group 110 in
no ip access-group 110 out
exit
!
no access-list 110
!
! allow ssh to labgw (192.196.15.5)
access-list 110 permit tcp any host labgw eq 22
access-list 110 deny tcp any any eq 22
!
! allow ftp to
ftpserv (192.196.15.6)
access-list 110 permit tcp any host
ftpserv eq 21
access-list 110 deny tcp any any eq 21
!
! block rexec
access-list 110 deny tcp any any eq 512
!
! block rlogin
access-list 110 deny tcp any any eq 513
!
!block rcmd
access-list 110 deny tcp any any eq 514
!
!block telnet
access-list 110 deny tcp any any eq 23
!
! allow everything not explicitly denied.
access-list 110 permit ip any any
!
!
interface ethernet 0
ip access-group 110 out
exit

Creating an SD depot for a non-root user

Added a depot to dsgdepot for a user. The commands were

swcopy -s /data/nsg/stuff/SWPackage/Depot/stuff_Alpha.depot @ dsgdepot:/mnt1/depot/NSG/Ergo
swacl -l depot -M user:nlittle:rwit @ dsgdepot:/mnt1/depot/NSG/Stuff

He will have to build his tape depot with the
-x run_as_superuser=true
And then add that to the swcopy command to be able to do things on his own.

Router config

I had a lot of trouble getting a router to work. I will have to remember that Cisco routers don't actually bring an interface up unless it's has a link. If you only connect the un-numbered interface on a router and not the numbered you can't ping the numbered since it doesn't exist until it's up.

HP/UX make net recovery

The net recovery service doesn't work on UX 10.20. You get “warning: ignoring unknown keyword architecture at line xxx” it might be fixable by installing an appropriate version of the ignite client on the probe, but it might not! 10.20 isn't supported so that makes it harder to get answers from HP.

Saturday, December 10, 2005

Initial Post

Intention is to post technical notes for future reference.