Monday, December 21, 2009

Useful HACMP Commands

Advanced HACMP Commands
 


clstart -m -s -b -i -l           To start cluster daemons (m-clstrmgr, s-clsmuxpd, b-broadcast message, -i-clinfo, -l cllockd)

clstop -f -N           To force shutdown cluster immediately without releasing resources


clstop -g -N            To do graceful shutdown immediately with no takeover


clstop -gr -N            To do graceful shutdown immediately with takeover 


cldare  -t                To sync the cluster toplogy 

cldare -t -f            To do the mock sync of topology

cldare -r                To sync the cluster resources


cldare -r -f            To do the mock sync of resources
 

clverify                cluster verification utility

cllscf                To list clustur topology information

cllsclstr                To list the name and security level of the cluster


cllsnode                To list the info about the cluster nodes


cllsnode -i node1            To list info about node1


cllsdisk -g shrg            To list the PVID of the shared hard disk for resource group shrg


cllsnw                To list all cluster networks
 

cllsnw -n ether1            To list the details of network ether1

cllsif                To list the details by network adapter


cllsif -n node1_service        To list the details of network adapter node1_service


cllsvg                To list the shared vgs which can be accessed by all nodes


cllsvg -g sh1            To list the shared vgs in resource group sh1


cllslv                 To list the shared lvs


cllslv -g sh1            To list the shared lvs in the resource group sh1


cllsdisk -g sh1            To list the PVID of disks in  the resource group sh1


cllsfs                To list the shared  file systems


cllsfs -g sh1            To list the shared file systems in the resource group sh1


cllsnim                Show info about all network modules


cllsnim -n ether            Show info about ether network module


cllsparam -n node1        To list the runtime parameters for the node node1


cllsserv                To list all the application servers


claddclstr -i 3 -n dcm         To add a cluster definition with name dcm and id 3


claddnode             To add an adapter


claddnim            To add network interface module


claddgrp -g sh1 -r cascading -n n1 n2       To create resource group sh1 with nodes n1,n2 in cascade


claddserv -s ser1 -b /usr/start -e /usr/stop       Creates an application server ser1 with startscript as /usr/start and stop script as /usr/stop



clchclstr -i 2 -n dcmds          To change cluster definitions name to dcmds and id to 2


clchclstr -s enhanced        To change the clustur security to enhanced



clchnode            To change the adapter parameters

clchgrp                To change the resource group name or node relationship


clchparam            To change the run time parameters (like verbose logging)


clchserv                To change the name of app. server or change the start/end scripts


clrmclstr                To remove the cluster definition

clrmgrp -g sh1            To delete the resource group sh1 and related resources


clrmnim    ether            To remove the network interface module ether


clrmnode -n node1        To remove the node node1


clrmnode -a node1_svc        To remove the adapter named node1_svc


clrmres -g sh1            To remove all resources from resource group sh1


clrmserv  app1            To remove the application server app1


clrmserv ALL            To remove all applicaion servers


clgetactivenodes -n node1        To list the nodes with active cluster manager processes from cluster manager on node node1


clgetaddr node1            returns a pingable address from node node1


clgetgrp -g sh1            To list the info about resource group sh1


clgetgrp -g sh1 -f nodes        To list the participating nodes in the resource group sh1


clgetif                To list interface name/interface device name/netmask associated with a specified ip label / ip address of a specific node


clgetip sh1            To get the ip label associated to the resource group

clgetnet 193.9.200.2  255.255.255.0     To list the network for ip 193.9.200.2, netmask 255.255.255.0

clgetvg -l nodelv            To list the VG of LV nodelv


cllistlogs            To list the logs


clnodename -a node5           To add node5 to the cluster


clnodename -o node5 -n node3       To change the cluster node name node5 to node3


clshowres            Lists resources defined for all resource group


clfindres                To find the resource group within a cluster


xclconfig             X utility for cluster configuration


xhacmpm            X utility for hacmp management


xclstat                X utility for cluster status



HACMP LOGS

=========

/tmp/hacmp.out        Detailed event script output logged in 7 day rolling history


/var/adm/cluster.log      High level view of cluster events (No clean up on this file)


/usr/sbin/cluster/history/cluster.mmdd    Day by day view of cluster events. (one file / day of month)


/tmp/cm.log        Clstrmgr messages


/tmp/cspoc.log           Output from C-SPOC commands (similar to smit.log)


/tmp/emuhacmp.out    Output from event emulation


rdist  -b -f  /etc/disfile1       To distribute the files in disfile1 to all nodes in disfile1 in binary mode

Sample entry for disfile1
 
            HOSTS = ( root@node1 root@node3 )
            FILES = ( /etc/passwd /etc/security/passwd)
            ${FILES} -> ${HOSTS}
 

/usr/es/sbin/cluster/utility/*   (All commands)



***************

Friday, December 4, 2009

Useful TIVOLI Commands



USEFUL TIVOLI COMMANDS

q sess   To see currently working sessions

can sess  ( sess no)  To cancel a session

q eve domainname schedulename    To see schedule time,nodename, scgedule name and progress of the scheeduled backup. ( q eve * * to see all scheduled backups)

q proc    To see currently running background processes


cancel process (process no)    To cancel a process

q node   To view assigned nodes in a Tivoli server 


q filespace   To check backup space utilized for each file system of a server, filesystem type...


q actlog  To view activity log


q act begind=mm/dd/yyyy begint=hh:mm:ss  endd=mm/dd/yyyy endt=hh:mm:ss     To view activity log for a specified period by begining date and end date


q act begind=today-1 begint=00:00   To view activity log from yesterday 12:00 am


q act search=transferred begint=00:00   To see all completed backup size of servers from 12:00 am


q act search=nodename     To view activity log for a node

q drive f=d   To get detailed report of drive, it's status ... 

q library f=d    To get detailed information about tape library 

q libvol    To see volumes in the tape library and it's status


q vol   To see volumes and it's storage pool name, capacity, status 

q req     To see requests 

reply (request no)  To continue request 

q sched     To show schedule name domain, action , start date & time 

q sched f=d   To show detailed report about schedules including schedule backup path

UPDATE LIBVOLUME TS3200 L41117L4  STATUS=SCRATCH    To change a library volume ( L41117L4 ) status to scratch from private 

update node nodename "admin" domain=domainname forcepwreset=Yes    To change a tivoli login password of a node

define vol storagepoolname L41116L4    Add new tape L41116L4 to a storagepool


delete volume L41116L4 discarddata=yes    To delete data inside a tape media L41116L4


To create a new schedule backup (incremental ) for a node
======================================== 

UPDATE SCHEDULE domainname nodename desc="daily incremental backup for a server" action=Incremental options=-subdir=yes objects=""/fs1/*" "/fs2/*" "/home/user1/*"" priority=5 startdate=mm/dd/yyyy starttime=hh:mm duration=1 duru=Hou period=1 perunits=Day dayofweek=Any expiration=never

To start tivoli services in an AIX client
========================

#cd /usr/tivoli/tsm/client/ba/bin

nohup dsmc sched &     To start scheduled backup service


nohup dsmcad &   To start BA client ( webmode backup i.e. http://ip.address.of.server>:1581)



#cd /usr/tivoli/tsm/StorageAgent/bin

nohup ./dsmsta &        To start storage agent ( LANFREE BACKUP= backup directly from SAN to Tape library ) 

#ps -ef | grep dsm     To view currently running Tivoli services in server


To update drive status of a server to online
==============================
update path sourceservername TAPE0 srct=server destt=drive libr=ts3200 online=yes
 


To set serial number of a drive in tape library
==============================

UPDATE DRIVE TS3200 TAPE0 ELEMENT=autodetect ONLINE=Yes WWN="2002000E11107B6C" SERIAL=autodetect


To detect label of a tape in tape library
==========================

label libvol t3200 checkin=scratch labelsource=barcode search=bulk waittime=0
 


To remove tape media from tape library
===========================

checkout libvol ts3200 VOLLIST=A00015L3,A00019L3 CHECKLABEL=YES REMOVE=YES


To add and label new tapes into library
===========================


LABEL libvol TS3200 search=yes labelsource=barcode overwrite=NO checkin=SCRATCH WAITTIME=0
 


To take full backup of Tivoli database manually to a file in local disk

=============================================

backup db dev=FILECLASS type=full


to assign a tape drive to a server
=======================

UPDATE PATH servername TAPE0 SRCTYPE=SERVER DESTTYPE=DRIVE LIBRARY=TS3200 DEVICE=\\.\Tape0 ONLINE=YES AUTODETECT=no




Important
=======


If you are not able to take backup through any of Tivoli backup methods ( BA client, dsmc , schedule ) then check any NFS mounted filesystems are there in the server and that server is available or not. If that server is not powered on, either unmount the NFS filesyatem or make that server available...



****************




Thursday, December 3, 2009

SRC (System Resource Controller)commands in AIX


SRC commands in AIX

lssrc -a      To list the status of all subsystems

lssrc -h node1-a    To list the status of all subsystems  on foreign host node1


lssrc -s inetd            To list the status of the subsystem inetd

lssrc -g tcpip            To get the status of the subsystem group tcpip 

startsrc -s inetd         To start the subsystem inetd

startsrc -g tcpip        To start the subsystem group tcpip


stopsrc -s inetd      To stop the subsystem inetd (if process is under srcmstr. ie PPID of process=PID of srcmstr)


stopsrc -g tcpip   
        To stop the subsystem group tcpip


refresh -s nfsd            To refresh nfsd subsystem


refresh -g tcpip  
          To refresh tcpip subsystem group


lssrc -p [PID of process]  To get  status of the subsystem by process ID 

kill  [PID of process]   To kill a process that not started by srcmstr 

mkssys       To add a subsystem

rmssys -s kerberos        To remove the subsystem kerberos


chssys -s kerb -s kad        To rename the subsystem kerb to kad





*************

Wednesday, December 2, 2009

User related commands in AIX


User related commands in AIX


id                To list all system identifications for current user

id -gn                To list the default group for current user

id -Gn                 To list all system groups for current user

lsuser root            To list the attribute of user root

lsuser ALL            To list the attributes of all users

lsuser -a ALL            To list all usernames 

lsuser -a HOME ALL        To list the home directory of all users

lsuser -a auth1 auth2 ALL        To list the authentication method for all users

lsuser -a expires ALL        To list expiry date

lsuser -a account_locked ALL     To check account lock status of all users

chuser -a login=true praveen        To enable the user praveen

chuser -a rlogin=true username        Enable user to login remotely to server 

mkuser praveen   Creates user si with default values in /usr/lib/security/mkuser.default

passwd   To change password of current user

passwd username  To change password of a user

pwdadm username  To change password of a user by security (admin) member

mkuser su=false username       Create user without su facility

rmuser username            To remove a user

rmuser -p praveen            To remove user praveen and his all attributes

who          List users with tty nos and ip numbers

who /var/adm/wtmp        Lists history of login logout system startup and shutdown

last root  All previous login and logoff time of root user

who -r     To list the current run level ( cat /etc/.init.state )

whoami   show current user

who am i         To list the exact user (who -m) ( ie. difference between su and su - After su shows previous username bcoz environment not set for current user and su - shows current username bcoz environment has been set)

mkgroup dcm            To create the group dcm

chgroup users=user1,user2,user3 dcm    To add users user1,user2 and user3 to dcm  group

rmgroup dcm            To delete the group dcm

chauthent            To change the authentication methods

chuser unsuccessful_login_count=0 username   To change the unsuccessful login count

pwdck -t ALL / Username  To verify user passwords ( Report error and ask to fix it)

usrck -t ALL / Username   To verify user definition.

grpck -t ALL / groupname  To verify a group




*************


Print commands in AIX

Print commands in AIX

switch.prt  -d    to Display current print subsytem (AIX, System V, BSD) 

switch.prt  -s AIX   to change current print subsytem to AIX 

switch.prt  -d systemV    to change current print subsytem to systemV

qprt -P  qname filename   To submit print jobs (AIX Printing)


qprt -P:lp1 filename   To submit a print job if multiple queue / printer is there 

qprt -N   No. of print copy required 

qchk -q                To display the default q

qchk -P lp0            To display the status of the printer lp0


qchk -# 123           To display the status of job number 123


qchk -A                To display the status of all queues (AIX Printing) 


qcan -x 123            To cancel the print job 123 (AIX Printing)

qcan -X -P lp0            To cancel all jobs submitted to lp0
(AIX Printing)

qchk -L  to show job priorities 

qpri -#570 -a 25            To change the priority of the job to 25

qhld -# 569            To hold the  job 569


qhld -r -#569            To remove holding job 569 (release)


qmov -m pq1 -#11        To move the job 11 to queue pq1


enable psq            To enable queue psq


disable psq            To disable queue psq


lp -d qname filename  To submit printjob (System V printing)

lp -n   No. of print copy required


lpstat                 To display the status all queues (System V printing) 

lpstat -p lp0            To display the status of print queue lp0

lpstat -u root            To display the jobs submitted by user root


cancel -#111            To cancel job 111
(System V printing)

lpq -P lp0            To display the status of queue lp0  ( BSD Printing )






************



Backup commands in AIX


Backup commands in AIX


mksysb -i -X /dev/rmt0        Creates image.data and system backup (-X expands /tmp if required)

mksysb -m /dev/rmt0        Creates image.data file with map file and system backup


mksysb -e /dev/rmt0        Creates system data but excludes the files listed in /etc/exclude.rootvg


mkszfile                Creates /image.data file


mkcd -d /dev/cd1            Creates system boot backup to the CD-R device /dev/cd1    (mksysb)



mkcd -d /dev/cd1 -v datavg        Creates  backup of VG datavg to CD-R device /dev/cd1   (savevg)


savevg -i -f /dev/rmt0 datavg    Creates datavg.data image file and backup vg datavg (path = /tmp/vgdata/datavg/datavg.data)



savevg -ef  /dev/rmt0 datavg        Creates datavg backup but excludes files listed in the /etc/exclude.datavg


find / -print | backup -ivf /dev/rmt0    Backup entire system to rmt0


backup -0vf /dev/rmt0 /home    Backup /home directory to rmt0 with backup level 0


restore -Tvf /dev/rmt0        List the archive in rmt0


restore -xvf /dev/rmt0 /home    Restore /home from archive in device rmt0


restore –xvf /export/mksysb ./etc/sshd.conf    Restores particular file from /export/mksysb image

restore -Pa -vf /dev/rmt0 ./etc/passwd    Restore only a file attribute from tape

 find ./home -print |cpio -ocvumB > /dev/rmt0  Archives /home directory 

cpio -icvdumB < /dev/rmt0  Restores cpio archive from rmt0

cpio -ivt < /dev/rmt0      List the contents of cpio archive from rmt0

cpio -icvd < /dev/rmt0 /home  Restores /home directory from rmt0


tar -cvf /dev/rmt0 /home        Archives /home to rmt0 device


tar -tvf /dev/rmt0            List the archives in rmt0


tar -xvf /dev/rmt0 /home        Extract /home from rmt0


dd if=file1 of=file2 conv=ebcdic    Convert and copy ascii file to ebcdic file2


dd count=1 bs=4k skip 31 seek=1 if=/dev/hd4 of=/dev/hd4    copy 31st block and paste to 1st block in the hd4 ( ie.to fix currupted superblock by restoring it's backup copy to original location)



dd if=/dev/rmt0 ibs=512 obs=1024 of=/dev/rmt1  To copy blocks from rmt0 with 512 blocks to rmt1 with 1024 blocks 


tctl -f /dev/rmt0 rewind        To rewind the tape


tctl -f /dev/rmt0 offline        To eject the tape


tctl -f /dev/rmt0 status        To show the status of tape

tcopy /dev/rmt0.0 /dev/rmt1.0   to copy contents of 1st tape(tape0) to 2nd tape(tape1). It is useful when the size of the tapes are different.


tcopy /dev/rmt0     to show no. of files and block size in the tape



chdev -l rmt0 -a block_size=512    To change the block size of the tape to 51201






******************



Tuesday, December 1, 2009

How to's in AIX

1) How to disable telnet in AIX

How to disable telnet in AIX

  
#vi /etc/inetd.conf

comment out telnet from this file (#telnet ... ... .. )

save it and

#refresh -s inetd

Then telnet session will be disabled in that server from now.


2) HOW TO FIX A CORRUPTED BLV IN AIX



3) HOW TO DO LINK AGREGATION IN AIX



4) HOW TO CONFIGURE NTP IN AIX