Saturday, 26 July 2014

PowerHA/HACMP Moving Resource Group (RG) one node to other

We are going to discuss about the resource group (RG) movement one node to other in PowerHA.
Here are the steps

1) Extending PATH vairable with cluster paths

Sometimes cluster paths are not included in default path ,run below command incase if you are not able to run commands directly.
export PATH=$PATH:/usr/es/sbin/cluster:/usr/es/sbin/cluster/utilities:/usr/es/sbin/cluster/sbin:/usr/es/sbin/cluster/cspoc

2) Check the cluster services are up  or not in destination node

#clshowsrv -v
Status of the RSCT subsystems used by HACMP:
Subsystem         Group            PID          Status
 topsvcs          topsvcs          278684       active
 grpsvcs          grpsvcs          332026       active
 grpglsm          grpsvcs                       inoperative
 emsvcs           emsvcs           446712       active
 emaixos          emsvcs           294942       active
 ctrmc            rsct             131212       active

Status of the HACMP subsystems:
Subsystem         Group            PID          Status
 clcomdES         clcomdES         204984       active
 clstrmgrES       cluster          86080        active

Status of the optional HACMP subsystems:
Subsystem         Group            PID          Status
 clinfoES         cluster          360702       active

3) Check the availability of resource group

# clRGinfo
Group Name     Type           State      Location
UMRG1            non-concurrent OFFLINE    umhaserv1
                                ONLINE     umhaserv2

4) Move the resourcegroup by using below command

==>  clRGmove -g <RG> -n  <node> -m

# clRGmove -g UMRG1 -n umhaserv1 -m
Attempting to move group UMRG1 to node umhaserv1.
Waiting for cluster to process the resource group movement request....
Waiting for the cluster to stabilize..................
Resource group movement successful.
Resource group UMRG1 is online on node umhaserv1.

You can use smitty path also

smitty cl_admin => HACMP Resource Group and Application Management => Move a Resource Group to Another Node / Site

5) Verify the RG movement

# clRGinfo
Group Name     Type           State      Location
UMRG1          non-concurrent   ONLINE     umhaserv1
                                OFFLINE    umhaserv2

Thursday, 24 July 2014

Editing the /etc/inittab File in Maintenance Mode


This technote describes a technique for creating a minimal /etc/inittab file if no other tools are available.


System hangs or crashes at boot time.


A bad entry in the /etc/inittab is keeping the system from booting properly.

Resolving the problem

Ordinarily if there is a problem with one or more entries in the /etc/inittab the preferred method of editing it is:

1. Boot into Maintenance Mode off AIX install CDs, mksysb, or NIM
2. Access the rootvg and start a shell with the filesystems mounted.
3. Edit /etc/inittab down to a minimum 3 lines:
brc::sysinit:/sbin/rc.boot 3 >/dev/console 2>&1 # Phase 3 of system boot
cons:0123456789:respawn:/usr/sbin/getty /dev/console
In cases where the rootvg filesystems cannot be mounted automatically (for example the CD media is a different Technology Level than what exists on hard disk; or the filesystems for some reason won't automatically mount), commands such as the "vi" editor won't be available to edit the inittab.

In this case a hard-luck method can be used to create a minimal inittab.
1. Boot into Maintenance Mode and choose Option 2 "Access rootvg and start a shell before mounting filesystems".

2. Once in Maintenance Mode, fsck all rootvg filesystems necessary:
# fsck /dev/hd1
# fsck /dev/hd2
# fsck /dev/hd3
# fsck /dev/hd4
# fsck /dev/hd9var

3. Mount root on a temporary mount point:
# mount /dev/hd4 /mnt

4. Copy the bad inittab to a backup:
# cd /mnt/etc
# mv inittab inittab.bad

5. Use grep to create a minimal new inittab:
# grep "init:" inittab.bad > inittab (adds both the init: and brc: entries)
# grep "^cons:" inittab.bad >> inittab (adds the cons: entry)

6. Reboot using the new inittab:
# sync; sync; sync
# cd /
# umount /mnt

power cycle the system from the front panel or HMC

How to enable the Name Service cache Daemon (NSCD)


How do you enable NSCD to improve the performance of the hostname, password, name and group lookup which is frequently being done by IBM Rational ClearCase?


By enabling the Name Service cache Daemon (NSCD) of the operating system, a significant performance improvement can be achieved when using naming services like DNS, NIS, NIS+, LDAP.


Benefit of name service cache daemon (NSCD) for ClearCase


[user@host]$ time cleartool co -nc "/var/tmp/file"
Checked out "/var/tmp/file" from version "/main/10".
real    0m3.355s
user    0m0.020s
sys     0m0.018s
[user@host]$ time cleartool co -nc "/var/tmp/file"
Checked out "/var/tmp/file" from version "/main/11".
real    0m0.556s
user    0m0.021s
sys     0m0.016s
Enabling NSCD
/etc/init.d/nscd start

service nscd start

startsrc -s netcd
Note: In addition to having nscd started it is mandatory to be sure this service will be started after a reboot. For instance on Red Hat and SuSE you can run:
chkconfig nscd  on
For more details on how to configure and or enable NSCD refer to your respective operating system vendor's manpage.

Note that this service is not yet available on HP-UX platforms.

Monday, 21 July 2014

Howto fix delay in SSH Login

Have you ever faced  login delays  when you tried to connect to the Linux systems, if yes this is happening due to  reverse DNS look-up  query that is been made to DNS Server.

We can fix this issue as mentioned below steps:

1) Take /etc/ssh/sshd_config  backup
# cp -p /etc/ssh/sshd_config /etc/ssh/sshd_config.`date '+%m-%d-%Y_%H:%M:%S'`
2) Edit  /etc/ssh/sshd_config  on sshd  Server
vi /etc/ssh/sshd_config

  And add this DNS option to the file:

  UseDNS no
3) Now add the following line to your /etc/resolv.conf
   options single-request-reopen 4) Restart ssh daemon
# service sshd restart
Sometimes adding the client's net address to the server's /etc/hosts can fix this issue  which is an alternative method. 

Monday, 14 July 2014

Install SNMP Service on RHEL or CentOS

Install SNMP Service on RHEL or CentOS

In this article  we are going to learn  how to install and start  SNMP service in RHEL/CentOS.

We need  to have  net-snmp rpm package installed on the servers , generally it would come with repository.

1. Install net-snmp with yum:

#yum install net-snmp
[root@umserv]# yum install net-snmp
Loaded plugins: dellsysid, fastestmirror
Loading mirror speeds from cached hostfile
Dependencies Resolved

Package    Arch         Version          Repository        Size
net-snmp     x86_64   1:    updates  708 k
Installing for dependencies:
 lm_sensors     x86_64  2.10.7-9.el5       base     525 k
Updating for dependencies:
 net-snmp-libs  i386    1:    updates  1.3 M
 net-snmp-libs  x86_64  1:    updates  1.3 M

Transaction Summary
Install      2 Package(s)
Update       2 Package(s)
Remove       0 Package(s)

Total download size: 3.8 M
Is this ok [y/N]: y
Downloading Packages:
(1/4): lm_sensors-2.10.7-9.el5.x86_64.rpm        | 525 kB     00:01
(2/4): net-snmp-   | 708 kB     00:02
(3/4): net-snmp-libs-      | 1.3 MB     00:04
(4/4): net-snmp-libs-    | 1.3 MB     00:03
Total   168 kB/s | 3.8 MB     00:23
Running rpm_check_debug
Running Transaction Test

Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  net-snmp.x86_64 1:

Dependency Installed:
  lm_sensors.x86_64 0:2.10.7-9.el5

Dependency Updated:
  net-snmp-libs.i386 1: net-snmp-libs.x86_64 1:


2. Simple SNMP configuration:

mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.old
Add   below configuration to /etc/snmp/snmpd.conf
rocommunity  public
rocommunity  public
syslocation  "HYD, UM DataCenter"
syscontact  [email protected]

Replace with the IP address of the server that you want to allow SNMP lookups from:
rocommunity public

3. Start the SNMP service, and set it to auto-start on reboot:

/etc/init.d/snmpd start
chkconfig snmpd on
Note:If you have a firewall configured, ensure that you have UDP port 161 open to your SNMP lookup server.

4) Validation:

On your SNMP lookup server, you can do the following to perform a quick SNMP test to ensure that it’s working.
snmpwalk -v 2c -c public or snmpwalk -v 1 -c public -O e
[root@umserv ~]# snmpwalk -v 1 -c public -O e
SNMPv2-MIB::sysDescr.0 = STRING: Linux umserv 2.6.18-92.1.17.el5 #1 SMP Mon Jul 14 06:07:13 IST 2014 i686
SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.10
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (16748) 0:02:47.48
SNMPv2-MIB::sysContact.0 = STRING: [email protected]
SNMPv2-MIB::sysName.0 = STRING: umserv
SNMPv2-MIB::sysLocation.0 = STRING: "HYD, UM DataCenter"
SNMPv2-MIB::sysORLastChange.0 = Timeticks: (1) 0:00:00.01
Yes, it is working