Search This Blog

Friday, February 27, 2015

Setting Speed, Duplexity Permanent in HP-Unix

This is a short tech-note to preserve the speed, duplexity and MAC settings for a network interface on HP-UX to survive a reboot. First, list the network interfaces with ioscan!

#ioscan -fknC lan
Class     I  H/W Path       Driver   S/W State   H/W Type     Description
==========================================================================
lan       0  1/0/0/1/0      igelan   CLAIMED     INTERFACE    HP PCI-X 1000Base-T Built-in
lan       1  1/0/4/1/0/4/0  iether   CLAIMED     INTERFACE    HP AB545-60001 PCI/PCI-X 1000Base-T 4-port 1000B-T Adapter
lan       2  1/0/4/1/0/4/1  iether   CLAIMED     INTERFACE    HP AB545-60001 PCI/PCI-X 1000Base-T 4-port 1000B-T Adapter
lan       3  1/0/4/1/0/6/0  iether   CLAIMED     INTERFACE    HP AB545-60001 PCI/PCI-X 1000Base-T 4-port 1000B-T Adapter
lan       4  1/0/4/1/0/6/1  iether   CLAIMED     INTERFACE    HP AB545-60001 PCI/PCI-X 1000Base-T 4-port 1000B-T Adapter

With the lanadmin command you can list the current settings. (Speed and duplexity) -x (lowercase) is for displaying. If something is wrong, you can modify it with the -X (uppercase) parameter. Note that there is an interactive mode for lanadmin if you don’t enter any parameter. Here I display the settings for PPA 1 and 2:

#lanadmin -x 0
Speed = 1000 Full-Duplex.
Autonegotiation = On.

#lanadmin -x 2
Speed = 1000 Full-Duplex.
Autonegotiation = On.

Though these settings won’t survive a reboot, so you need a config file to firm down the settings. The config files are to be found under /etc as usual, they vary according to the driver the adapter uses:

#ll /etc/rc.config.d/hp*conf | grep -e lan -e ether
-r--r--r--   1 bin        bin           1340 Feb 26 14:14 /etc/rc.config.d/hpbtlanconf
-r--r--r--   1 bin        bin           4469 Oct 24  2005 /etc/rc.config.d/hpgelanconf
-r--r--r--   1 bin        bin           6463 Feb 26 14:00 /etc/rc.config.d/hpietherconf
-r--r--r--   1 bin        bin           4988 Feb 26 14:16 /etc/rc.config.d/hpigelanconf

In my case, the lan0 uses a igelan driver, so I need to write its config into /etc/rc.config.d/hpigelanconf:

# tail -n 4 /etc/rc.config.d/hpigelanconf
HP_IGELAN_INTERFACE_NAME[0]=lan0
HP_IGELAN_STATION_ADDRESS[0]=
HP_IGELAN_SPEED[0]=auto_on
HP_IGELAN_MTU[0]=1500

The HP_IGELAN_INTERFACE_NAME[x] is an array containing the name of the interfaces; the HP_IGELAN_STATION_ADDRESS[x] array contains the MAC addresses of every btlan-adapter (it is used for a custom MAC address, leave it blank if not applicable). The HP_IGELAN_SPEED[x] array can have the following value: 10HD, 10FD, 100HD, 100FD and AUTO_ON. Note that there is no such setting as 1000HD or 1000FD, there is no way to force gigabit speed. If you want gigabit just set either way of the communication to AUTO_ON. For these three arrays the indices are coherent, this means that e.g. the speed setting HP_IGELAN_SPEED[8]=100FD belongs to the card declared in HP_IGELAN_INTERFACE_NAME[8]. The PPA number and these indices shouldn’t be the same, this means that I could define my cards in any order I wish. I just need to pay attention to the driver; it may be that other cards must be declared in other config files.

There is separate script for each driver at below location:

#grep -l lanadmin /sbin/init.d/*
/sbin/init.d/hpbtlan
/sbin/init.d/hpbtlan_enh
/sbin/init.d/hpgelan
/sbin/init.d/hpiether
/sbin/init.d/hpigelan
/sbin/init.d/hpintl100
/sbin/init.d/hppcifddi
/sbin/init.d/vlan

We could also accomplish above activity through sam.

Sam -> Networking and Communications -> Network Interface Cards -> select (appropriate) lan card - . Key Tab (to move curser to File)   -> Actions -> Modify.

Thank you for Reading,
For Reading other article, visit to “https://sites.google.com/site/unixwikis/

Tuesday, February 17, 2015

How to find from which disk the system has booted in HP-UX

HP-UX 11i v1 (11.11)

On HP-UX 11.11 systems execute the following command to determine the boot device.

# echo "boot_string/S" | adb -k /stand/vmunix /dev/kmem
Example:

# echo "boot_string/S" | adb -k /stand/vmunix /dev/kmem
boot_string:
boot_string:    disk(0/2/1/0.6.0.0.0.0.0;0)/stand/vmunix

HP-UX 11i v2 (11.23)

On HP-UX 11.23 systems execute the following command to determine the boot device.


# echo "bootdev/X" | adb -o /stand/vmunix /dev/kmem 
bootdev: 
bootdev:        0x1f######  

Example:

# echo "bootdev/X" | adb -o /stand/vmunix /dev/kmem 
bootdev: 
bootdev:        0x1f021002 
ll /dev/dsk/* | grep 021002
brw-r-----   1 bin        sys         31 0x021002 Oct 28  2004 /dev/dsk/c2t6d0

HP-UX 11i v3 (11.31)

On HP-UX 11i v3 systems use Agile View device naming scheme. Execute the following command to determine the boot device.

# echo "bootdev/X" | adb -o /stand/vmunix /dev/kmem
bootdev:
bootdev:        0x10000##

Example:

# echo "bootdev/X" | adb -o /stand/vmunix /dev/kmem 
bootdev: 
bootdev:        0x1000004 
# ll /dev/disk/* | grep 000004
brw-r-----   1 bin        sys          1 0x000004 Jul  1 15:00 /dev/disk/disk11
Current boot configuration

Sometimes, instead of verify the disk from were the disk has booted, is only necessary to check the current boot configuration status (non mirrored environment), this can be accomplish using ioscan and setboot commands.

HP-UX 11.11 (PA-RISC)
Example

# ioscan -fnkH `setboot | awk -F":" '/Primary bootpath/ {print $2}'`
Class     I  H/W Path       Driver   S/W State   H/W Type     Description
==========================================================================
disk      0  1/0/1/0/0/1/1.6.0  sdisk    CLAIMED     DEVICE       HP 73.4GST373307LC
                           /dev/dsk/c1t6d0   /dev/rdsk/c1t6d0

HP-UX 11.23 (Integrity)
Example

# ioscan -fnkH `setboot | awk -F":" '/Primary bootpath/ {print $2}'`
Class     I  H/W Path       Driver S/W State   H/W Type     Description
=======================================================================
disk      4  1/0/0/3/0.6.0  sdisk CLAIMED     DEVICE       HP 36.4GMAS3367NC
                           /dev/dsk/c0t6d0     /dev/rdsk/c0t6d0
                           /dev/dsk/c0t6d0s1   /dev/rdsk/c0t6d0s1
                           /dev/dsk/c0t6d0s2   /dev/rdsk/c0t6d0s2
                           /dev/dsk/c0t6d0s3   /dev/rdsk/c0t6d0s3

Thank you for Reading,
For Reading other article, visit to “https://sites.google.com/site/unixwikis/

Monday, February 16, 2015

HPUX :Node is not eligible. cmrunpkg :Unable to start some package

#-> cmrunpkg -n test01 pkg01
Unable to run package pkg01 on node test01. Node is not eligible.
cmrunpkg: Unable to start some package or package instances.
[root@test01:/etc/cmcluster]#

Check the Node for eligibilty to run the pakcage, below output states that switching Parameter are disable. to make cmrunpkg work , this need to be enable for both node.
#
[root@test01:/etc/cmcluster]#
#-> cmviewcl -vp pkg01

UNOWNED_PACKAGES

    PACKAGE        STATUS           STATE            AUTO_RUN    NODE
    pkg01        down             failed           enabled     unowned

      Policy_Parameters:
      POLICY_NAME     CONFIGURED_VALUE
      Failover        configured_node
      Failback        manual

      Node_Switching_Parameters:
      NODE_TYPE    STATUS       SWITCHING    NAME
      Primary      up           disabled     test01
      Alternate    up           disabled     test02

      Other_Attributes:
      ATTRIBUTE_NAME                          ATTRIBUTE_VALUE
      Style                                   modular
      Priority                                no_priority

[root@test01:/etc/cmcluster]#cmmodpkg -e -n test01 pkg01
[root@test01:/etc/cmcluster]#cmmodpkg -e -n test02 pkg01
#-> cmviewcl -vp pkg01

UNOWNED_PACKAGES

    PACKAGE        STATUS           STATE            AUTO_RUN    NODE
    pkg01        down             failed           enabled     unowned

      Policy_Parameters:
      POLICY_NAME     CONFIGURED_VALUE
      Failover        configured_node
      Failback        manual

      Node_Switching_Parameters:
      NODE_TYPE    STATUS       SWITCHING    NAME
      Primary      up           enabled     test01
      Alternate    up           enabled     test02

      Other_Attributes:
      ATTRIBUTE_NAME                          ATTRIBUTE_VALUE
      Style                                   modular
      Priority                                no_priority
[root@test01:/etc/cmcluster]#
#-> cmrunpkg -n test01 pkg01
Running package pkg01 on node beusap14
Successfully started package pkg01 on node beusap14
cmrunpkg: All specified packages are running
[root@test01:/etc/cmcluster]#

Thank you for Reading,
For Reading other article, visit to “https://sites.google.com/site/unixwikis/