Showing posts with label Unix OS. Show all posts
Showing posts with label Unix OS. Show all posts

Monday, June 1, 2026

Configure mailx and Send email alert from OS Solaris

 

* Configure in file below:

# vi /etc/mail/cf/cf/email.cf

DMemail.mydomain.com.kh

 

# vi /etc/mail/cf/cf/email.mc

MASQUERADE_AS(`email.mydomain.com.kh')

 

 # vi /etc/mail/main.cf

DSemail.mydomain.com.kh

DMemail.mydomain.com.kh

 

#vgrep mydomain*

 

 * Restart Service sendmail 

# svcadm disable svc:/network/smtp:sendmail

# svcadm enable svc:/network/smtp:sendmail

# svcs -a network/smtp:sendmail


* Send test

/usr/bin/mailx -s "Test Mail" -v hornrim@mydomain.com.kh < /dev/nul

Friday, September 11, 2020

Change hostname in Solaris 11

 1. To list the current hostname (i.e. config/nodename property) :

# svccfg -s system/identity:node listprop config
config                       application
config/enable_mapping       boolean     true
config/ignore_dhcp_hostname boolean     false
config/loopback             astring
config/nodename             astring     labsvr


2. Change the hostname to geekserver by setting the property config/nodename to geekserver

# svccfg -s system/identity:node setprop config/nodename="labserver"

3. Refresh and restart the system/identity:node service for the changes to take effect.

# svcadm refresh system/identity:node
or
# svcadm restart system/identity:node

4. Verify the changes

# svccfg -s system/identity:node listprop config
config                       application
config/enable_mapping       boolean     true
config/ignore_dhcp_hostname boolean     false
config/nodename             astring     labserver
config/loopback             astring     labserver


# hostname
labserver

5. Changes to /etc/hosts

– In Solaris 11, the loopback interface entry acts as the server’s own entry (In Solaris 10 it was the primary interface IP) and thus there is no need to add the hostname entry to the /etc/hosts file.
– But some application installers may fail due to this. So make sure you edit this file and change the hostname.

# cat /etc/hosts
#
# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
# Internet host table
#
::1             localhost
127.0.0.1       localhost    loghost
192.168.1.20    labserver



Change IP Address in Solaris 11

 Check IP Detail
# ipadm show-addr

Delete network interface
# ipadm delete-ip net0

Recreate network interface
# ipadm create-ip net0

Add IP Address to network interface
# ipadm create-addr -T static -a 192.168.10.2/24 net0/v4


if we want to change IP Address from Static to DHCP:

Configure an interface with DHCP:

# ipadm delete-addr net0
# ipadm create-addr -T dhcp net0/v4

Monday, April 22, 2019

Configure DNS client on Solaris 11

List the domains to search and the IP addresses for the DNS name servers, then update the SMF repository.

# svccfg -s network/dns/client
        svc:/network/dns/client> setprop config/search = astring: ("
domain.com")
        svc:/network/dns/client> setprop config/nameserver = net_address: (DNS_IP)  

* If we want to remove "delprop config/domain"
        svc:/network/dns/client> select network/dns/client:default
        svc:/network/dns/client:default> refresh
        svc:/network/dns/client:default> quit


Make sure to refresh the service for the changes to take effect.
Update the name service switch information to use DNS.

The first command updates the DNS configuration information in the SMF repository.

    # svccfg -s system/name-service/switch
        svc:/system/name-service/switch> setprop config/host = astring: "files dns"
        svc:/system/name-service/switch> select system/name-service/switch:default
        svc:/system/name-service/switch:default> refresh
        svc:/system/name-service/switch:default> quit


Start the services that are needed to run the DNS client.
 
  # svcadm enable network/dns/client
  # svcadm enable system/name-service/switch

Verify that the DNS client is enabled by using one or both of the following commands:

    # dig EXAMPLE.domain.com
  # getent hosts EXAMPLE.domain.com

The dig command when used alone checks that the DNS client is enabled. The getent hosts command verifies the /etc/nsswitch.conf file's use of the DNS client.

The following example shows how you would set multiple /etc/resolv.conf options.

  # svccg
    svc:> select /network/dns/client

        svc:/network/dns/client> setprop config/options = "ndots:2 retrans:3 retry:1"
    svc:/network/dns/client> listprop config/options
config/options astring     ndots:2 retrans:3 retry:1

         svc:/network/dns/client> exit
  # svcadm refresh dns/client
  # grep options /etc/resolv.conf
options ndots:2 retrans:3 retry:1

Monday, January 21, 2019

How to replace a disk AIX OS?

How do I replace a disk?

 

Extend the Volume Group

# extendvg VolumeGroup hdisk_new

Migrate the physical Volumes

# migratepv hdisk_old hdisk_new

Reduce the VG with disk without issues

# reducevg -d VolumeGroup hdisk_old

Thursday, June 29, 2017

Topas command on AIX

Description

The topas command reports selected statistics about the activity on the local system. The command uses the curses library to display its output in a format suitable for viewing on an 80 x 25 character-based display or in a window of at least the same size on a graphical display. The topas command requires the bos.perf.tools and perfagent.tools file sets to be installed on the system.
The topas command can also report a limited set of performance metrics from remote AIX® partitions that belong to the same hardware platform

Download PDF: File

How to remove Disaster Recovery Media on TSM

Code:
tsm: TSMSRV>q drm
Volume Name State Last Update Automated Date/Time LibName
---------------- ----------------- ------------------- ----------------

DCTAP056   Mountable 09/03/2013 08:15:29 TS3100
/tsmdisks/TSMDBBACK/78170403.DBV Mountable 09/03/2013 08:00:29
/tsmdisks/TSMDBBACK/78170349.DBV Mountable 09/03/2013 08:00:29
/tsmdisks/TSMDBBACK/78170296.DBV Mountable 09/03/2013 08:00:29
/tsmdisks/TSMDBBACK/78170244.DBV Mountable 09/03/2013 08:00:29
/tsmdisks/TSMDBBACK/78170190.DBV Mountable 09/03/2013 08:00:29
/tsmdisks/TSMDBBACK/78170137.DBV Mountable 09/03/2013 08:00:29
/tsmdisks/TSMDBBACK/78170084.DBV Mountable 09/03/2013 08:00:29
/tsmdisks/TSMDBBACK/78170444.DBV Mountable 09/03/2013 08:00:29
/tsmdisks/TSMDBBACK/78170030.DBV Mountable 09/03/2013 08:00:29
TAP059 Mountable 09/02/2013 11:17:05 TS3000
/tsmdisks/TSMDBBACK/78086537.DBV Mountable 09/02/2013 08:41:25
/tsmdisks/TSMDBBACK/78086484.DBV Mountable 09/02/2013 08:41:25
/tsmdisks/TSMDBBACK/78086430.DBV Mountable 09/02/2013 08:41:25
/tsmdisks/TSMDBBACK/78086375.DBV Mountable 09/02/2013 08:41:25
/tsmdisks/TSMDBBACK/78086322.DBV Mountable 09/02/2013 08:41:25
/tsmdisks/TSMDBBACK/78086268.DBV Mountable 09/02/2013 08:41:25
/tsmdisks/TSMDBBACK/78086214.DBV Mountable 09/02/2013 08:41:25
/tsmdisks/TSMDBBACK/78086578.DBV Mountable 09/02/2013 08:41:25
/tsmdisks/TSMDBBACK/78086160.DBV Mountable 09/02/2013 08:41:25

Code:
tsm: TSMSRV>del volhist t=a todate=09/02/2013
Do you wish to proceed? (Yes (Y)/No (N)) Y

ANR2467I DELETE VOLHISTORY: 10 sequential volume history entries were successfully deleted.


Result after deleted

Code:
tsm: TSMSRV>q drm

Volume Name State Last Update Automated Date/Time LibName
---------------- ----------------- ------------------- ----------------

TAP056 Mountable 09/03/2013 08:15:29 TS3000
/tsmdisks/TSMDBBACK/78170403.DBV Mountable 09/03/2013 08:00:29
/tsmdisks/TSMDBBACK/78170349.DBV Mountable 09/03/2013 08:00:29
/tsmdisks/TSMDBBACK/78170296.DBV Mountable 09/03/2013 08:00:29
/tsmdisks/TSMDBBACK/78170244.DBV Mountable 09/03/2013 08:00:29
/tsmdisks/TSMDBBACK/78170190.DBV Mountable 09/03/2013 08:00:29
/tsmdisks/TSMDBBACK/78170137.DBV Mountable 09/03/2013 08:00:29
/tsmdisks/TSMDBBACK/78170084.DBV Mountable 09/03/2013 08:00:29
/tsmdisks/TSMDBBACK/78170444.DBV Mountable 09/03/2013 08:00:29
/tsmdisks/TSMDBBACK/78170030.DBV Mountable 09/03/2013 08:00:29

How to update Drive and Path from Offline to Online on TSM

INTRODUCTION

Path and Drive are importance for backup data to tapes. So, if Drive or Piece of Path on TSM not online, The TSM will error to backup data to tape. Below is the procedure to check and update Path or Drive in TSM if they are not online.


1- CHECK AND UPDATE PATH

A. CHECK PATH
Code:
tsm: TSMSERV>q path

B. UPDATE PATH
Code:
tsm: TSMSERV>update path TSMSRV DRIVE1 SRCType=SERVER DESTType=DRIVE LIBRary=TS3100 ONLINE=YES

ANR1722I A path from TSMSRV to TS3100 DRIVE1 has been updated.

C. CHECK PATH AFTER UPDATE
Code:
tsm: TSMSERV>q path

2 - CHECK AND UPDATE DRIVE

A. CHECK DRIVE
Code:
tsm: TSMSERV>q drive

B. UPDATE DRIVE
Code:
tsm: TSMSERV>UPDate DRIve TS3100 DRIVE1 ONLINE=YES

ANR8467i Drive DRIVE1 in library TS3100 updated.

C. CHECK DRIVE AFTER UPDATE
Code:
tsm: TSMSERV>q drive

Creating users and groups for database for AIX server

For AIX® installations, create and configure the oinstall and dba groups and the oracle user on the server that hosts the Oracle database.

About this task

Use the following table to help you create the required users and user groups for the database server.

Procedure

1. Log on to the database server as root.
2. To create a group called oinstall, open an AIX shell and type the following command:

Code:
mkgroup id=500 oinstall
mkgroup id=501 dba

This group is the primary group for the oracle user. This group is the inventory group.
Note: The Oracle database requires these names.
3. Create a user called oracle, assign the initial login group (oinstall), and add the user to the dba group.
• Go to the /usr/sbin/ directory
• Type the following command:

Code:
/usr/sbin/useradd -m -g oinstall -G dba oracle

4. Change the password for the oracle user by using the following command:
Code:
passwd oracle

5. At the New Password prompt, enter a new password.
6. To limit the size of a file the user can create, configure the oracle user by typing the following command:
Code:
chuser fsize=-1 data=-1 stack=-1 rss=-1 nproc=-1 oracle

The following list describes the parameters:
• fsize sets the largest file that a user process can create or extend
• data sets the largest data segment for a user's process
• stack sets the largest process stack segment for a user's process
• rss sets the largest amount of physical memory a user's process can allocate
• nproc Maximum number of processes available to a single user

Thursday, February 11, 2016

IBM AIX commands

          As you know, AIX has a vast array of commands that enable you to do a multitude of tasks. Depending on what you need to accomplish, you use only a certain subset of these commands. These subsets differ from user to user and from need to need. However, there are a few core commands that you commonly use. You need these commands either to answer your own questions or to provide answers to the queries of the support professionals. In this article, I'll discuss some of these core commands. The intent is to provide a list that you can use as a ready reference. The behavior of these commands should be identical in all releases of AIX. The exceptions have been noted where that is not true.

Download file detail below:
IBM AIX Commands (PDF)

Restart or Stop/Start FTP/FTPS

Find ftp service running
root@hostname(/)$ ps -ef | grep inetd
    root  4194452  4522006   0   Dec 18      -  0:00 /usr/sbin/inetd


Stop ftp service
root@hostname(/)$ kill -9 4194452  4522006

Start ftp service
root@hostname(/)$ startsrc -s inetd
0513-059 The inetd Subsystem has been started. Subsystem PID is 11534388.

Thursday, November 5, 2015

Command to display/show Hardware specs of an AIX Server

#  prtconf
In order to be able to read the info, you should off course pipe to more:

#  prtconf | more

Thursday, September 17, 2015

Set terminal connection time out (TMOUT TIMEOUT) on AIX

# vi /etc/security/user

# set a 60 min timeout policy for bash shell
TMOUT=3600;
TIMEOUT=3600;
readonly TMOUT TIMEOUT;
export TMOUT TIMEOUT;

Set JAVA_HOME environment variable for root user on AIX

Setting variables in /etc/profile

For setting JAVA_HOME in /etc/profile enter following statements:

    JAVA_HOME=/usr/java6_64/jre
    export JAVA_HOME

    PATH=$JAVA_HOME/bin:$PATH
    export PATH


You have to login again to see the changes. I am using putty, so will re-open it and login with root user.
Verifying variables

To verify your changes you can echo JAVA_HOME and PATH variables.

    # echo $JAVA_HOME
    /usr/java6_64/jre

  # echo $PATH
    /usr/java6_64/jre/bin:/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin

  # which java
    /usr/java6_64/jre/bin/java

Count file on AIX

Count Files

Verb: countFiles

Counts the number of files contained in a directory, and a mask can be used as a filter.

Example:

# cd /tmp/test/
# ls -1 *.txt | wc -l

Command search file in tar on AIX

Overview

    We usually pack multiple files into one single archive using the tar command. Further, tar with the -z option allows us to compress the archive using gzip to save disk space.
    We’ll learn how to do grep on a .tar archive to find which files contain an interesting pattern for us.

Command:

# tar -tvf Folder.tar|grep testing.txt

Increase size of partition on AIX


Check space
========  
# df -gs 
Filesystem    GB blocks     Free* %Used    Iused %Iused Mounted on
/dev/hd4           2.00      0.98    1%      212     1% /tmp
#
Increase space
=========
# chfs -a size=+3G /tmp
#
Verify space
========  
# df -gs 
Filesystem    GB blocks     Free* %Used    Iused %Iused Mounted on
/dev/hd4           5.00      0.31    1%      212     1% /tmp
#

Note: Command decrease space
# chfs -a size=-3G /tmp

Change user limit on AIX

Check limit on user root
=================
# ulimit -a
time(seconds)        unlimited
file(blocks)         2097151
data(kbytes)         131072
stack(kbytes)        32768
memory(kbytes)       32768
coredump(blocks)     2097151
nofiles(descriptors) 2000
threads(per process) unlimited
processes(per user)  unlimited
#
Change limit on user root
==================
# vi /etc/security/limits
 root:
        fsize = -1
        data = -1
        stack = -1
        rss = -1
        nproc = -1

:wq


Verify after changed
==============
# ulimit -a
time(seconds)        unlimited
file(blocks)         unlimited
data(kbytes)         unlimited
stack(kbytes)        4194304
memory(kbytes)       unlimited
coredump(blocks)     2097151
nofiles(descriptors) 2000
threads(per process) unlimited
processes(per user)  unlimited
 

#
Must to close terminal ssh/telnet and try to reconnect and verify.