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

Wednesday, August 26, 2009

How to change date & time in Solaris, Linux, HP-UX and Netapp?

Changing date/time in Solaris, Linux, HP-UX and Netapp is one command step as long as used with correct syntax.

For Solaris:

# date
Thu Aug 27 00:22:37 SGT 2009
# date 0827002509
Thu Aug 27 00:25:00 SGT 2009
# date
Thu Aug 27 00:25:02 SGT 2009


For Netapp:

# ssh filer01 date
Thu Aug 27 00:20:11 SGT 2009

# ssh filer01 date 0827002509
Error: 27 is not a valid month of the year. Range is 01-12.
usage: date [-u] [[[[CC]yy]mm]dd]hhmm[.ss]]
date [-u] -c
date [-f] -c initialize

# ssh filer01 date 0908270026
Thu Aug 27 00:26:00 SGT 2009

# ssh filer01 date
Thu Aug 27 00:26:03 SGT 2009

Tuesday, June 2, 2009

How to find server hardware model?

In Linux:

# /usr/sbin/dmidecode | grep "Product Name" | head -1
Product Name: Sun Fire V20z


In Solaris:

# /usr/sbin/prtdiag | grep "System Configuration"
System Configuration: Sun Microsystems Sun Fire V20z


In HP-UX:

# /usr/bin/model
9000/785/C3600

Friday, March 13, 2009

Xterm - tips and tricks

xterm terminal is a powerful, programmable and full with options. It is available with almost all variants of Unix OS.

The following reference is good for at least Solaris operating system.

Explanation of switches available for xterm:
======================================================================
-T "Title name" : Used for displaying title
-bg : For background color
-fg : For foreground color
-fn : For font name (it can be name as well as size also)
-e : This x-application will open in xterm window
-geometry 180x60 : To define xterm's window size and location (optional)
-display : To send the xterm's display on "Hostname" (i.e. for remote display)

How to open Xterm on local system:
======================================================================
xterm -T "This xterm is from: `whoami`@`hostname`" -bg black -fg white -fn fixed -geometry 180x60
xterm -T "This xterm is from: `whoami`@`hostname`" -bg black -fg white -fn "*-fixed-*-*-*-20-*" -geometry 180x60


How to open Xterm on remote system:
======================================================================
xterm -T "This xterm is from: `whoami`@`hostname`" -bg black -fg white -fn fixed -display 10.10.10.230:6.0
xterm -T "This xterm is from: `whoami`@`hostname`" -bg black -fg white -fn "*-fixed-*-*-*-20-*" -display 10.10.10.230:6.0
xterm -T "This xterm is from: `whoami`@`hostname`" -bg black -fg white -fn fixed -display 10.10.10.230:6.0 -e xclock

Monday, September 8, 2008

How to enable FTP in HP-UX?

Most of the time, FTP is enabled in HP-UX systems. For some reason, if it is not enabled, here is how to enable it:
  1. Login to system as root
  2. Look for a file called "/etc/shells"
  3. If /etc/shells is not present, then create this file and put "/bin/tcsh" in this file.
  4. FTP should work now. :-)



% cat /etc/shells
/bin/tcsh

Tuesday, August 12, 2008

How to find HP-UX system details?

Here is the coolest thing about HP-UX b11.11. With this script/utililty, we can find lots of information about the system.. like:
  1. Installed softwares
  2. Installed hardware
  3. System parameters (kernel)
  4. Disk layout
  5. filesystem and volume information
  6. LVM/JFS information
  7. RAM/swap and other details.

The only thing is it doesn't come with all versions/releases of HP-UX. But if it is available, then it is extremely useful utility.




# /opt/ignite/bin/print_manifest



System Information

Your Hewlett-Packard 9000 computer has software installed and
configured as follows.

The system was created November 17, 2004, 13:48:41 EST.
It was created with Ignite-UX revision B.3.3.116.

-------------------------------------------------------------
NOTE: You should retain this information for future reference.
-------------------------------------------------------------


System Hardware

Model: 9000/785/C3600
Main Memory: 2560 MB
Graphics: HP VISUALIZE-FXE color 1280x1024 48 planes
Processors: 1
OS mode: 64 bit
LAN hardware ID: 0x00306XXXXXXX
LAN hardware ID: 0x00108XXXXXXX
Software ID: 2007XXXXXX
Keyboard Language: USB_PS2_DIN_US_English

Storage devices HW Path Interface
MITSUMI CD-ROM FX4830T!B 10/0/14/0.0.0 IDE Primary Channel
IBM IC35L018UCD210-0 17501 Mb 10/0/15/1.5.0 SCSI C896 Ultra2 Wide LVD

I/O Interfaces
Class H/W Path Driver Description
lan 10/0/12/0 btlan HP PCI 10/100Base-TX Core
audio 10/0/13/0 audio Built-in Audio
ext_bus 10/0/14/0 side IDE Primary Channel
tty 10/0/14/1/1 asio0 Built-in RS-232C
tty 10/0/14/1/2 asio0 Built-in RS-232C
ext_bus 10/0/14/1/3 SCentIf Built-in Parallel Interface
usb 10/0/14/2 hcd Built-in USB Interface
ext_bus 10/0/15/0 c720 SCSI C896 Ultra Narrow Single-Ended
ext_bus 10/0/15/1 c720 SCSI C896 Ultra2 Wide LVD
lan 10/1/4/0 btlan HP A5230A/B5509BA PCI 10/100Base-TX Addon
sicl 10/1/5/0 sicl PCI SimpleComm (10b59050)
61622 10/1/6/0 t61622 PCI class(255,0) (10e88179)
cid1 10/4/1/0 PciCID10ec PCI Bridge (10b59080)
sicl 10/4/3/0 sicl PCI SimpleComm (10b59050)
graphics 10/6/2/0 graph3 PCI Display (103c108b)


Installed Software

Your system was installed with HP-UX version B.11.11.

Your system has the following software products installed and
configured on the system disk drive(s).

Product Revision Description
B3899BA B.11.11.06 HP C/ANSI C Developer's Bundle for HP-UX 11.i (S700)
B3911DB C.03.37.01 HP aC++ Compiler (S700)
B9788AA 1.3.1.01.00releaseJava 2 SDK 1.3 for HP-UX (700/800), PA1.1 + PA2.0 Add On
BUNDLE B.11.11 Patch Bundle
BUNDLE11i B.11.11.0102.2 Required Patch Bundle for HP-UX 11i, February 2001
CDE-ChineseS B.11.11 Simplified Chinese CDE Environment
CDE-ChineseT B.11.11 Traditional Chinese CDE Environment
CDE-English B.11.11 English CDE Environment
CDE-French B.11.11 French CDE Environment
CDE-German B.11.11 German CDE Environment
CDE-Italian B.11.11 Italian CDE Environment
CDE-Japanese B.11.11 Japanese CDE Environment
CDE-Korean B.11.11 Korean CDE Environment
CDE-Spanish B.11.11 Spanish CDE Environment
CDE-Swedish B.11.11 Swedish CDE Environment
FDDI-00 B.11.11.01 PCI FDDI;Supptd HW=A3739A/A3739B;SW=J3626AA
FibrChanl-00 B.11.11.06 PCI/HSC FibreChannel;Supptd HW=A6684A,A6685A,A5158A
GCC+more A.1.0 GCC 3.3.2; binutils 2.14; PHSS_28871
GigEther-00 B.11.11.14 PCI/HSC GigEther;Supptd HW=A4926A/A4929A/A4924A/A4925A;SW=J1642AA
HPUX11i-TCOE B.11.11.0106 HP-UX Technical Computing OE Component
HPUXBase64 B.11.11 HP-UX 64-bit Base OS
HPUXBaseAux B.11.11.0106 HP-UX Base OS Auxiliary
HWEnable11i B.11.11.0106.8 Hardware Enablement Patches for HP-UX 11i, June 2001
OnlineDiag B.11.11.03.08 HPUX 11.11 Support Tools Bundle, Jun 2001
RAID-00 B.11.11.01 PCI RAID; Supptd HW=A5856A
T1456AA 1.4.0.00.00 Java2 1.4 SDK for HP-UX
T72091-32-64 11i-2.3 TAMS I/O Libraries for HP-UX
mozilla_93k 1.0 Mozilla 1.6 and Gnome 1.4 GTK+ Libraries


LVM File System Configuration

This system is configured with Logical Volume Manager (LVM) file systems.
Refer to the File System layout section for information on the LVM layout.


JFS File System Configuration

This system is configured with a Journaled File System (referred to
as either JFS or VXFS). Refer to the File System layout section for
information on JFS/VXFS file systems.


Disk layout

LVM disk Device file HW Addr size vol. grp
IBM IC35L01XXXXXXX-0 /dev/dsk/c3t5d0 10/0/15/1.5.0 17501 /dev/vg00


File System layout

LVM Device file mount point size fs type
/dev/vg00:
/dev/vg00/lvol1 /stand 112 hfs
/dev/vg00/lvol2 swap 2048
/dev/vg00/lvol3 swap 2048
/dev/vg00/lvol4 / 13288 vxfs
/dev/vg00 unallocated 0


Swap configuration

type size priority device/location
dev 2048 1 /dev/vg00/lvol2
dev 2048 1 /dev/vg00/lvol3


Kernel Configuration

The following drivers or parameters are configured into your system's
kernel. After installing HP-UX, use the sam(1m) command to configure
the following items into the kernel:
default_disk_ir 1
STRMSGSZ 65535
nstrpty 60
maxswapchunks 2048
maxdsiz 1073741824
maxfiles 512
maxssiz 33554432
maxuprc 200
msgmni 80
msgtql 256
ncallout 690
nproc 376
semmni 256
semmns 256
semmnu 128
semume 20
shmmax 67108864
shmmni 200
shmseg 120
maxdsiz_64bit 1073741824
maxssiz_64bit 33554432
nfile 4096
ninode 4096
dbc_max_pct 20
dbc_min_pct 20


System Information

The following parameters were set on the configured target:
hostname: hawaii
IP address: 10.20.30.40
IP address: 192.168.1.11
subnet mask: 255.255.255.0
subnet mask: 255.255.255.0
gateway IP address: 10.20.30.1
time zone: PST8PDT
DNS domain name: domainname.com
DNS IP address: 10.20.30.99
NIS domain name: nisdomainname

Tuesday, May 20, 2008

NTP client setup on Solaris/HP/Linux

Steps for setting up NTP client on Solaris 10:

Note: NTP server name in this case is "ntp



# ping ntp
ntp is alive

# cd /etc/inet

# vi ntp.conf
"ntp.conf" 0 lines, 0 characters
driftfile /var/lib/ntp/drift
server ntp
authenticate no
~
~
"ntp.conf" 3 lines, 56 characters


# svcs ntp
disabled May_12 svc:/network/ntp:default

bash-3.00# svcadm enable ntp

bash-3.00# svcs ntp
STATE STIME FMRI
online 14:48:53 svc:/network/ntp:default

bash-3.00# ps -eaf grep ntp
root 5475 5435 0 14:49:07 pts/3 0:00 grep ntp
root 5471 1 2 14:48:54 ? 0:01 /usr/lib/inet/xntpd

bash-3.00# ntpq -p
remote refid st t when poll reach delay offset disp
==============================================================================
serverB serverA 3 u 11 64 1 0.31 -3.220 15875.0


Steps for setting up NTP client on Solaris 8 & 9:


# vi /etc/inet/ntp.conf
"/etc/inet/ntp.conf" [New file]
driftfile /var/tmp/drift
server ntp
authenticate no
~
~
~
~
~
"/etc/inet/ntp.conf" [New file] 3 lines, 52 characters

# touch /var/tmp/drift

# /etc/init.d/xntpd start

# ls -l /etc/rc2.d/S74*
-rwxr--r-- 5 root sys 364 Jan 5 2000 /etc/rc2.d/S74autofs
-rwxr--r-- 5 root sys 911 Jan 5 2000 /etc/rc2.d/S74syslog
-rwxr--r-- 5 root sys 945 Jan 5 2000 /etc/rc2.d/S74xntpd

# ps -eaf grep ntp
root 5390 5372 0 18:11:20 pts/9 0:00 grep ntp
root 5386 1 0 18:10:52 ? 0:00 /usr/lib/inet/xntpd

# ntpq -p
remote refid st t when poll reach delay offset disp
==============================================================================
serverB serverA 3 u 1 64 1 0.44 -1.662 15875.0

Steps for setting up NTP client on RedHat Linux:

# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
*clock1.redhat.c .CDMA. 1 u 66 1024 377 80.699 -1.231 0.722

# ls -l /etc/ntp.conf*
-rw-r--r-- 1 root root 2852 Jul 2 2007 /etc/ntp.conf

# cp -p /etc/ntp.conf /etc/ntp.conf.ORIG

# ls -l /etc/ntp.conf*
-rw-r--r-- 1 root root 2852 Jul 2 2007 /etc/ntp.conf
-rw-r--r-- 1 root root 2852 Jul 2 2007 /etc/ntp.conf.ORIG

# service ntpd stop
Shutting down ntpd: [ OK ]

# pgrep ntpd

# cat /dev/null > /etc/ntp.conf

# vi /etc/ntp.conf

# cat /etc/ntp.conf
driftfile /var/lib/ntp/drift
server ntp
authenticate no

# service ntpd start
Starting ntpd: [ OK ]

# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
serverB serverA 3 u 24 64 1 0.220 -4.881 0.004

# pgrep ntpd
1587

Steps for setting up NTP for HP-UX:

# cat /etc/rc.config.d/netdaemons grep -v ^$ grep -v ^#
export INETD_ARGS=
export START_RBOOTD=0
export RBOOTD_DEVICES=
export NTPDATE_SERVER=ntp
export XNTPD=1
export XNTPD_ARGS=
export MROUTED=0
export MROUTED_ARGS=""
export RWHOD=0
export DDFA=0

# cat /etc/ntp.conf
driftfile /var/lib/ntp/drift
server ntp
authenticate no


# /sbin/init.d/xntpd start

# /usr/sbin/ntpq -p
remote refid st t when poll reach delay offset disp
==============================================================================
serverB serverA 3 u 26 64 1 0.46 -1.219 15875.0



NOTE: serverA is NTP server in this case.


After setting up NTP, for first time sync, following command can be used:

# rdate -s serverA


"rdate" sync the date/time with NTP server keeping the local timezone of the client node in mind.