2017-02-27

Working on Patching HP-UX Servers

1) Run the software inventory tool.

[saptst01:root]/ # uname -a
HP-UX sapux20 B.11.31 U ia64 0574715905 unlimited-user license
[saptst01:root]/ # swainv
sh: swainv:  not found.
[saptst01:root]/ # whereis swainv
swainv: /opt/swa/lbin/swainv
[saptst01:root]/ # /opt/swa/lbin/swainv
Copyright (c) Hewlett-Packard 2005-2006.  All rights reserved.
  swainv revision: 4.01
This script lists the patches, products, bundles, and filesets found
in a system or depot and packages the information in a file for transfer
to the ITRC or the Response Center.

      * Listing Filesets
      * Listing Products
      * Listing Bundles
      * Inventory written to inventory.xml
[saptst01:root]/ # ls -al inventory.xml
-rw-r--r--   1 root       sys        1067962 Feb 27 14:28 inventory.xml

2) Upload it to https://h20566.www2.hpe.com/portal/site/hpsc/patch/home/ >> Upload new system information.

3) Once the inventory.xml is uploaded click "Find HP-UX patches in a patch set".  Or select from the option on the right side of the site.


4) In my case I chose "Patch bundles for my uploaded HP-UX system - HP-UX: 11.31 - saptst01" and selected Bundle for March 2016.

From here, I can start analysing which patch set I need to install on my system(s).

2017-02-24

Replacing DNS Nameserver in Oracle Solaris 11

Reference: https://docs.oracle.com/cd/E23824_01/html/821-1455/dnsref-31.html#dnsref-36

root@lyon:~# svccfg -s system/name-service/switch
svc:/system/name-service/switch> setprop config/host = astring: "files dns"
svc:/system/name-service/switch>exit
root@lyon:~# nscfg export svc:/network/dns/client:default
root@lyon:~# svcadm enable network/dns/client
root@lyon:~# svcadm enable system/name-service/switch

root@lyon:~# cat /etc/resolv.conf
#
# _AUTOGENERATED_FROM_SMF_V1_
#
# WARNING: THIS FILE GENERATED FROM SMF DATA.
#   DO NOT EDIT THIS FILE.  EDITS WILL BE LOST.
# See resolv.conf(4) for details.
domain  localdomain
search  mondragon.dk
nameserver      8.8.8.8
nameserver      208.67.222.123

root@lyon:~# svcadm refresh dns/client && svcadm restart dns/client

Keeping Command History File in Oracle Solaris 11

Today I just figured it out that there's no history of commands being kept by the system.  I tried investigating and I found a forum that does the trick.  Unfortunately, I am unable to bookmark it, but credit is to the guy who make this thing to work.

root@lyon:~# grep -i hist .profile
root@lyon:~# grep -i hist /etc/profile
root@lyon:~# echo $SHELL
/usr/bin/bash
root@lyon:~# HISTFILE=$HOME/.bash_history.$$
root@lyon:~# export HISTFILE
root@lyon:~# HISTSIZE=10000
root@lyon:~# export HISTSIZE
root@lyon:~# history
   1 clear
   2 history
   3 grep -i hist .profile
   4 grep -i hist /etc/profile
   5 echo $SHELL
   6 HISTFILE=$HOME/.bash_history.$$
   7 export HISTFILE
   8 HISTSIZE=10000
   9 export HISTSIZE
   10 clear
   11 history
   12 clear
   13 pkg update
   14 pkg publisher
   15 clear
   16 pkg publisher
   17 mkdir -m 0755 -p /var/pkg/ssl
   18 pkg list -n solaris-11-cpu
   19 uname -a
   20 clear
   21 pkg info kernel
   22 pkg info entire
   23 cat /etc/resolv.conf
   24 vim /etc/resolv.conf
   25 svcadm refresh dns/client
   26 svcadm restart dns/client
   27 nslookup mondragon.dk
   28 nslookup cognomics.me
   29 nscfg export svc:/network/dns/client:default
   30 svcadm enable network/dns/client
   31 svcadm enable system/name-service/switch
   32 cat /etc/resolv.conf
   33 svcadm refresh dns/client && svcadm restart dns/client
   34 clear
   35 history
root@lyon:~#>

2017-02-23

Verify Which SRU a System Is Running on Oracle Solaris 11

Reference: https://docs.oracle.com/cd/E36784_01/html/E39499/gmpgs.html

root@lyon:~# pkg info entire
          Name: entire
       Summary: Incorporation to lock all system packages to the same build
   Description: This package constrains system package versions to the same
                build.  WARNING: Proper system update and correct package
                selection depend on the presence of this incorporation.
                Removing this package will result in an unsupported system.
      Category: Meta Packages/Incorporations
         State: Installed
     Publisher: solaris
       Version: 0.5.11 (Oracle Solaris 11.3.1.5.1)
 Build Release: 5.11
        Branch: 0.175.3.1.0.5.1
Packaging Date: January  5, 2017 12:09:52 AM
          Size: 5.46 kB
          FMRI: pkg://solaris/entire@0.5.11,5.11-0.175.3.1.0.5.1:20170105T000952Z

Get hostname from fully qualified domain name (FQDN)

Here’s a quick post to get the host/server name out of its fully qualified domain name (FQDN).

[mmond@centaur ~]$ cat servers.master
jupiter.nn.hosted.net
centaur.nz.hosted.net
pentana.dk.hosted.net

[mmond@centaur ~]$ cat servers.master | cut -d. -f1
jupiter
centaur
pentana
[mmond@centaur ~]$