Showing posts with label HP-UX. Show all posts
Showing posts with label HP-UX. Show all posts

Wednesday, March 22, 2017

HPUX NTP setup

/etc/hosts
192.168.1.4. ntp1
192.168.1.5  ntp2

/etc/ntp.conf
server 127.127.1.0  #Local clock
fudge 127.127.1.0 stratum 10

server ntp1 prefer
server ntp2

/etc/rc.config.d/netdaemons
export NTPDATE_SERVER=ntp1
export XNTPD=1
export XNTPD_ARGS="-l /var/adm/xntpd.log"

NTP Pool as alternate external NTP if ports are open:  north-america.pool.ntp.org

My recommendation is for NTP entries to be in DNS as cname records and then just reference the cname records in your configuration files... so if you ever need to change the NTP server you do not have to edit hundreds of client NTP client files.  Just update the DNS entries for NTP1 NTP2 etc.

The reason you update /etc/ntp.conf as well as ntpdate in the netdaemons file... is that ntpdate is intended for a single use on boot up... then from that point on... it gets updated from xntpd running from the /etc/ntp.conf configuration.  The reason for this is that xntpd will refuse to start if the local clock is off by more than 1000 seconds off from the NTP server you wish you get time from and if this happens the xntpd won't start and time will be way off until someone notices... manually runs ntpdate and then starts xntpd again.  Be careful not to cause your clock to go backwards or jump ahead after a database or application is running if it is sensitive to time.  Be sure to read about setting the options to SLEW the clock if you have things like a database running when you need to affect a large time change.

Thursday, June 11, 2015

How to Determine if an HP-UX Account is Locked

/usr/lbin/getprpw -l <account>
/usr/lbin/modprpw -k <account>

You need to know if accounts are locked
System may be a "trusted" system which means that it has higher security
enabled.
On a non-trusted system the /etc/passwd file will contain the information:
man passwd:
-s name Display some password attributes associated with the
specified name. Superuser privilege and non-trusted
mode is required if the files repository is specified.
The format of the display will be:
name status mm/dd/yy min max warn


or, if password aging information is not present
(#### e.g. that info is held in tcb directories ###)
name status
where status means: PS =passworded; LK =locked; and NP=no password.
passwd -s -a:
PS =passworded; LK =locked; and NP=no password
on a trusted system the /tcb directory structure holds the lock info;
man getprpw:
lockout returns the reason for a lockout in a "bit" valued string, where 0 = condition not present, 1 is present.

The position, left to right represents:
Google Voice and Video Chat Installer for Google Hangouts  "The Installer encountered error 1625:  This installation is forbidden by system policy.  Contact your system administrator".

1 past password lifetime
2 past last login time (inactive account)
3 past absolute account lifetime
4 exceeded unsuccessful login attempts
5 password required and a null password
6 admin lock
7 password is a *
(If the user is NOT locked, all bits will be 0)

getprpw:
for USER in `awk -F: '{print $1}' /etc/passwd`
do
printf $USER
printf " "
/usr/lbin/getprpw -m lockout,alock $USER
done

Bryan Payne on Linkedin  https://www.linkedin.com/in/paynebryan


+Bryan Payne add me on Google Plus


Friday, May 10, 2013

HP-UX: HOW TO BOOT FROM TAPE EFI ITANIUM

Keep in mind that some servers do not support booting from tape, or may require a firmware update to support booting from tape.

Exit from the boot menu to the EFI Shell

fs0:\> reconnect -r

Broadcom NetXtreme Gigabit Ethernet (BCM5704) is detected (PCI-X)
Broadcom NetXtreme Gigabit Ethernet (BCM5704) is detected (PCI-X)
HP 2Port 2Gb Fibre Channel Adapter (driver 1.42, firmware 3.03.150)
Broadcom NetXtreme Gigabit Ethernet (BCM5703) is detected (PCI-X)
HP 2Gb Fibre Channel Combo Adapter (driver 1.30, firmware 3.03.171)
Broadcom NetXtreme Gigabit Ethernet (BCM5703) is detected (PCI-X)
Scsi(Pun0,Lun0) HP      MSL6000 Series  0520 ( 20 MBytes/sec)
Scsi(Pun1,Lun0) HP      Ultrium 3-SCSI  G63W (320 MBytes/sec)
ReconnectController(0,0,0) : Status = Success

From this we gather that the Ultrium 3 Tape Drive is Pun1, Lun0.

At this point exit from the shell... returning you to the boot menu.  At this point enter the boot configuration menu and boot from a file if you want a one time boot and look for result of your reconnect -r output... in my case it was Pun1, Lun0.

Boot menu showed the device as follows:
Device Path Acpi(HWP0002,PNP0A03,700)/Pci(1|1)/Scsi(Pun1,Lun0)

Other helpful commands would be:
devtree, devices, map
Bryan Payne on Linkedin  https://www.linkedin.com/in/paynebryan

+Bryan Payne add me on Google Plus

Thursday, April 4, 2013

Manually Configuring a Lan interface using ifconfig under HP-UX

You would like to add an ephemeral or temporary IP perhaps to troubleshoot a problem involving a Network Interface Card.

NOTE: Keep in mind you may lose network connectivity... be sure to be connected to the network console or MP (management port), or via another network card on the system other than the one you are configuring. Be sure to check if you are using NFS shares or other things that rely on network connectivity before making changes that may impact it's availability.

For temporary changes which will persist until changed again, or a reboot
occurs:
ifconfig lan0 down
ifconfig lan0 unplumb
ifconfig lan0 plumb
ifconfig lan0 172.16.0.121 up netmask 255.255.255.0
you can confirm by using:
netstat -in
If you need to configure a default route you can use the following:
1) View the current routes by using netstat -nr
You may have to remove the default route and the syntax would be:
route delete default 172.16.0.1
2) add the route as follows:
Note: "default route" route add default netmask 255.255.255.0 172.16.0.1 1
Note: "host route" route add host 136.128.103.16 10.12.3.102 1
Note: "net route" route add net 172.16.0.0 netmask 255.255.0.0
192.168.70.11 1
Keep in mind the changes are temporary and are not persistent across a reboot. At boot time the /etc/rc.config.d/netconf file is used as well as other configuration files that vary depending on the NIC and it's associated driver.

Example Routes in /etc/rc.config.d/netconf file (Take effect on reboot or "/sbin/init.d/net stop" "/sbin/init.d/net start" see note on connectivity below:

ROUTE_DESTINATION[2]="host 136.128.103.16"
ROUTE_GATEWAY[2]="10.2.15.35"
ROUTE_COUNT[2]="1"

ROUTE_DESTINATION[1]="net 172.16.0.0"
SUBNET_MASK[1]="255.255.0.0"
ROUTE_GATEWAY[1]="192.168.70.11"
ROUTE_COUNT[1]="1"

Default route in /etc/rc.config.d/netconf:
ROUTE_DESTINATION[0]=default
ROUTE_MASK[0]=255.255.255.0
ROUTE_GATEWAY[0]=172.16.0.1
ROUTE_COUNT[0]="1"
ROUTE_ARGS[0]=""
ROUTE_SOURCE[0]=""

Sample Interface entry in /etc/rc.config.d/netconf for lan0:
INTERFACE_NAME[1]="lan0"
IP_ADDRESS[1]="172.16.0.121"
SUBNET_MASK[1]="255.255.255.0"
BROADCAST_ADDRESS[1]="172.16.0.255"
INTERFACE_STATE[1]="up"
DHCP_ENABLE[1]="0"
INTERFACE_MODULES[1]=""

If you see an entry like lan900 and above... that pertains to Auto Port Aggregation (APA), which on other platforms is sometimes referred to NIC teaming or bonding.
You can actually add an alias IP or stack IP's on the same interface by using the following syntax. For example lan0 is actually lan0:0 so an additional IP could be added to lan0:1... lan0:2 etc. This is actually how service guard works... it takes advantage of these alias IP address and they are assigned to an application and then move between nodes in the serviceguard cluster.

Additional Commands
To try to determine which lan card is in which physical slot/location... use
ioscan -funC lan
then look at slot information with "olrad -q", or "rad -q" depending on your HP-UX OS version.

KEEP IN MIND IFCONFIG IS TEMPORARY. IF YOU NEED TO CHANGE THE IP ADDRESS PERMANANTLY IT WILL NEED TO BE DONE IN THE /etc/rc.config.d/netconf FILE.  If you are an advanced user you can edit this file directly and then re-run the /sbin/init.d/net stop and /sbin/init.d/net start or altertively reboot your server. If you do not plan to reboot you should be connected to the console either via a webconsole... actual console, or an ILO connection.

NOTE ON CONNECTIVITY:
(YOU MAY LOSE NETWORK CONNECTIVITY AND MAY EVEN HANG YOUR SYSTEM) Remember to keep in mind other services that rely on network services like NFS that may even affect another server. The safest thing is to edit the netconf file and then reboot during a maintenance window. You can also use the set_parms command to change the IP address if you dont want to edit the files manually or use "sam", or "smh" on newer systems.
Bryan Payne on Linkedin  https://www.linkedin.com/in/paynebryan








+Bryan Payne

If you found this information helpful... and you see an advertisement for which you have legitimate interest... every click helps.  Thanks!

Creating a Depot file from a Depot Directory

There are two types of depot's... either a depot directory or a depot file (also called a tape depot).
apa_J4240AA_11.11.depot is a depot file, which is essentially a glorified tar file.  A depot directory is a directory that can contain products, bundles or patches and resides in a directory that has been "registered" and is known to HP-UX's Software Distributor for Unix (SD-UX).

A depot directory is created or has additional items added to it via the swcopy command.  The benefit of a depot directory is that SD-UX allows for only one source "depot" to be specified... so if you want to install multiple kernel patches (that require reboots)... multiple reboots would be required if all you had were individual depot files (one for each patch).  This is where a depot directory is essential.  Another advantage is that if you have registered a depot it is accessible not only locally, but also over the network to be used as a source depot for other servers.  To see what depot directories you have...

swlist -l depot  (Assumes local system)
or
swlist -l depot @ <hostname>  (remote system referenced by hostname).




Once you have created a depot directory... you can use this to create a depot file. To create a depot file from a directory style depot:
 
For our example lets say you have a directory depot /var/spool/sw where there is a product called
J4240AA (Auto Port Aggregation) and you want to create a single file depot (also known as a Tape depot).
swpackage -x media_type=tape -s /var/spool/sw J4240AA @
/tmp/apa_J4240AA_11.11.depot

You will find the depot file in /tmp called apa_J4240AA_11.11.depot.


Bryan Payne on Linkedin  https://www.linkedin.com/in/paynebryan








+Bryan Payne

If you found this information helpful... and you see an advertisement for which you have legitimate interest... every click helps.  Thanks!

Friday, March 1, 2013

How to create an Ignite Boot helper DVD from ISO


For two step booting (as was previously required for Itanium systems) use the following command:

/opt/ignite/data/scripts/examples/make_media_install -r B.11.31 -m/var/opt/ignite/bryan

NOTE:  Be sure you have enough room in the -m (Media Directory) that you intend to write to.(You can also specify -r as B.11.23 for example)

CAUTION:  Be sure to create this on a system that has the same version of Ignite-UX as you intend to use for the recovery... whether that be from tape or from an Ignite server using make_net_recovery.

This will create the ISO file, and burn it if you have a DVD-RW, but you can transfer this ISO image file to your PC to burn it from here if you do not have a DVD-RW connected to your HP-UX Unix System.

Output will look like this:
/opt/ignite/data/scripts/examples/make_media_install -r B.11.31 -m /var/opt/ignite/bryan

WARNING: Non-default -m option value specified along with default -p option value; the default directory could run out of disk space, should both options be given?
=== Step 1: Make Ignite-UX config files for golden image archive(s) ===
=== Step 2: Copy SD depot(s) and make config files for them ===
=== Step 3: Make a boot-image (LIF volume) ===
+ /opt/ignite/bin/make_medialif -a -r B.11.31 -f /opt/ignite/data/Rel_B.11.31/config -l /var/opt/ignite/media/pseudo_root/bootvol.lif
+ /opt/ignite/bin/instl_adm -b -F /var/opt/ignite/media/pseudo_root/bootvol.lif
=== Step 4: Make ISO media image ===
+ cp -p /opt/ignite/boot/Rel_B.11.31/EFI_CD_image /var/opt/ignite/media/pseudo_root
+ /opt/ignite/lbin/mkisofs -U -max-iso9660-filenames -no-emul-boot -b EFI_CD_image -R -eltorito-alt-boot -no-emul-boot -b bootvol.lif -o /var/opt/ignite/bryan/image.iso /var/opt/ignite/media/pseudo_root
Warning: creating filesystem that does not conform to ISO-9660.
Warning: ISO-9660 filenames longer than 31 may cause buffer overflows in the OS.
Size of boot image is 10240 sectors -> No emulation
Size of boot image is 995440 sectors -> No emulation
  1.99% done, estimate finish Fri Mar  1 17:59:04 2013
  3.98% done, estimate finish Fri Mar  1 17:59:29 2013
  5.96% done, estimate finish Fri Mar  1 17:59:37 2013
  7.95% done, estimate finish Fri Mar  1 17:59:41 2013
  9.94% done, estimate finish Fri Mar  1 17:59:44 2013
 11.93% done, estimate finish Fri Mar  1 17:59:37 2013
 13.91% done, estimate finish Fri Mar  1 17:59:32 2013
 15.90% done, estimate finish Fri Mar  1 17:59:29 2013
 17.89% done, estimate finish Fri Mar  1 17:59:26 2013
 19.88% done, estimate finish Fri Mar  1 17:59:29 2013
 21.86% done, estimate finish Fri Mar  1 17:59:26 2013
 23.85% done, estimate finish Fri Mar  1 17:59:29 2013
 25.84% done, estimate finish Fri Mar  1 17:59:27 2013
 27.83% done, estimate finish Fri Mar  1 17:59:25 2013
 29.81% done, estimate finish Fri Mar  1 17:59:27 2013
 31.80% done, estimate finish Fri Mar  1 17:59:26 2013
 33.79% done, estimate finish Fri Mar  1 17:59:27 2013
 35.78% done, estimate finish Fri Mar  1 17:59:29 2013
 37.76% done, estimate finish Fri Mar  1 17:59:27 2013
 39.75% done, estimate finish Fri Mar  1 17:59:29 2013
 41.74% done, estimate finish Fri Mar  1 17:59:30 2013
 43.73% done, estimate finish Fri Mar  1 17:59:29 2013
 45.71% done, estimate finish Fri Mar  1 17:59:30 2013
 47.70% done, estimate finish Fri Mar  1 17:59:31 2013
 49.68% done, estimate finish Fri Mar  1 17:59:32 2013
 51.67% done, estimate finish Fri Mar  1 17:59:31 2013
 53.66% done, estimate finish Fri Mar  1 17:59:31 2013
 55.65% done, estimate finish Fri Mar  1 17:59:30 2013
 57.63% done, estimate finish Fri Mar  1 17:59:31 2013
 59.62% done, estimate finish Fri Mar  1 17:59:32 2013
 61.61% done, estimate finish Fri Mar  1 17:59:33 2013
 63.60% done, estimate finish Fri Mar  1 17:59:32 2013
 65.58% done, estimate finish Fri Mar  1 17:59:32 2013
 67.57% done, estimate finish Fri Mar  1 17:59:33 2013
 69.56% done, estimate finish Fri Mar  1 17:59:34 2013
 71.55% done, estimate finish Fri Mar  1 17:59:33 2013
 73.53% done, estimate finish Fri Mar  1 17:59:33 2013
 75.52% done, estimate finish Fri Mar  1 17:59:34 2013
 77.51% done, estimate finish Fri Mar  1 17:59:34 2013
 79.50% done, estimate finish Fri Mar  1 17:59:34 2013
 81.48% done, estimate finish Fri Mar  1 17:59:34 2013
 83.47% done, estimate finish Fri Mar  1 17:59:35 2013
 85.46% done, estimate finish Fri Mar  1 17:59:35 2013
 87.45% done, estimate finish Fri Mar  1 17:59:34 2013
 89.43% done, estimate finish Fri Mar  1 17:59:35 2013
 91.42% done, estimate finish Fri Mar  1 17:59:35 2013
 93.40% done, estimate finish Fri Mar  1 17:59:35 2013
 95.40% done, estimate finish Fri Mar  1 17:59:35 2013
 97.38% done, estimate finish Fri Mar  1 17:59:35 2013
 99.37% done, estimate finish Fri Mar  1 17:59:36 2013
Total translation table size: 2048
Total rockridge attributes bytes: 846
Total directory bytes: 4096
Path table size(bytes): 40
Max brk space used f000
251599 extents written (491 MB)
=== Step 5: Combine LIF volume and media image ===
+ /opt/ignite/lbin/instl_combine -C /var/opt/ignite/bryan/image.iso
El Torito offset for LIF volume is: 0x50e800
Adjusting LIF file: ISL (Old iplstart: 4096; New iplstart: 5306368)
Adjusting LIF file: AUTO
Adjusting LIF file: INDEX
Adjusting LIF file: CONFIG
Adjusting LIF file: HPUX
Adjusting LIF file: FWWKAR6
Adjusting LIF file: FWWKAR7
Adjusting LIF file: FWWKAR8
Adjusting LIF file: WINSTALL
Adjusting LIF file: WINSTALLFS
Adjusting LIF file: IINSTALL
Adjusting LIF file: IINSTALLFS
Adjusting LIF file: INSTCMDS
Adjusting LIF file: SYSCMDS
Adjusting LIF file: INSTCMDSIA
Adjusting LIF file: SYSCMDSIA
Adjusting LIF file: SCRIPTS
Adjusting LIF file: PAD
=== Step 6: Write image file to tape/CD/DVD media ===
+ /opt/ignite/lbin/growisofs -Z /dev/rdsk/c0t0d0=/var/opt/ignite/bryan/image.iso
:-( "/dev/rdsk/c0t0d0=/var/opt/ignite/bryan/image.iso": unexpected errno:No such file or directory
+ Error 83 /opt/ignite/lbin/growisofs failed.
/opt/ignite/data/scripts/examples/make_media_install: ERROR: /opt/ignite/lbin/growisofs failed.
# cd /var/opt/ignite/bryan
# ls -l
total 1006414
drwxr-xr-x   3 root       sys             96 Mar  1 17:59 .
drwxr-xr-x  15 root       sys           1024 Mar  1 17:57 ..
drwxr-xr-x   2 root       sys             96 Mar  1 17:57 cfgs
-rw-r--r--   1 root       sys        515274752 Mar  1 17:59 image.iso

This is the image.iso file you will need.