This Blog is to share our knowledge and expertise on Linux System Administration and VMware Administration

Friday, December 15, 2017

Identify the differentiation between Oracle Enterprise Linux from Redhat Enterprise Linux

Friday, December 15, 2017 0

Identify the differentiation between Oracle Enterprise Linux from Redhat Enterprise Linux

We can differentiate the OEL from RHEL by checking below things

1. Kernel  - uname -mrs command

RHEL runs with normal Redhat Kernel
[root@nsk ~]# uname -mrs
Linux 3.10.0-693.5.2.el7.x86_64 x86_64

OEL runs with Unbreakable Enterprise Kernel
[root@testserver ~]# uname -mrs
Linux 3.8.13-118.16.2.el6uek.x86_64 x86_64

2.  Yum repositiry

RHEL points to  RHEL repo name (only 3)
ex: RHEL-7 - Base 
      RHEL-7 - Extras
      RHEL-7 - Updates

OEL points to Oracle repo name ( customized many repo)
ex: Oracle Linux 6Server Latest (x86_64)
      OL 6Server - x86_64

3. MTA

RHEL: comes with sendmail and postfix
OEL : supports sendmail as a preferred MTA

4. Patching

RHEL gets update from  RHN satellite server
OEL gets update from  Oracle Spacewalk server

5. Linux Standard Base (lsb_release -a)
RHEL
Distributor ID : RHEL
Description    : RHEL Linux release 7.4.1708 (Core)
Codename     : Core
LSB Version   : core-4.1-amd64:core-4.1-noarch

OEL
Distributor ID : OracleServer
Description    : Oracle Linux Server release 6.8
Codename    : n/a
LSB Version:  :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch

6. Linux Release by version

[root@nsk ~]# cat /proc/version
Linux version 3.10.0-693.5.2.el7.x86_64 (brewbuilder@xx-xx.build.redhat.com) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC) ) #1 SMP Fri Oct 20 20:32:50 UTC 2017

[root@testserver ~]# cat /proc/version
Linux version 3.8.13-118.16.2.el6uek.x86_64 (mockbuild@x86-ol6-builder-04) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC) ) #2 SMP Wed Jan 11 17:19:24 PST 2017

Thursday, December 14, 2017

Understanding the Redhat Virtualization - Log files

Thursday, December 14, 2017 0

Understanding the Redhat Virtualization -  Log files

Red Hat Virtualization features the xend daemon and qemu-dm process, two utilities that write the multiple log files to the /var/log/xen/ directory:

xend.log is the log file that contains all the data collected by the xend daemon, whether it is a normal system event, or an operator initiated action. All virtual machine operations (such as create, shutdown, destroy, etc.) appears here. The xend.log is usually the first place to look when you track down event or performance problems. It contains detailed entries and conditions of the error messages.

xend-debug.log is the log file that contains records of event errors from xend and the Virtualization subsystems (such as framebuffer, Python scripts, etc.)

Xen-hotplug-log is the log file that contains data from hotplug events. If a device or a network script does not come online, the event appears here.

qemu-dm. [PID].log is the log file created by the qemu-dm process for each fully virtualized guest. When using this log file, you must retrieve the given qemu-dm process PID, by using the ps command to examine process arguments to isolate the qemu-dm process on the virtual machine. Note that you must replace the [PID] symbol with the actual PID qemu-dm process.

If you encounter any errors with the Virtual Machine Manager, you can review the generated data in the virt-manager.log file that resides in the /.virt-manager directory. Note that every time you start the Virtual Machine Manager, it overwrites the existing log file contents. Make sure to backup the virt-manager.log file, before you restart the Virtual Machine manager after a system error.

Wednesday, December 13, 2017

Unable to switch to root using sudo su – effective uid is not 0, is sudo installed setuid root

Wednesday, December 13, 2017 0

Unable to switch to root using sudo su –  effective uid is not 0, is sudo installed setuid root 

Error – While switching to root using sudo su - , throwing the below Error.

[root@test ~]# ssh testserver.local.com -l nsk
nsk@testserver.local.com's password:
Last login: Tue Dec 12 09:24:48 2017 from 10.0.0.16
-bash-3.2$ sudo su -
sudo: effective uid is not 0, is sudo installed setuid root?

Reason:
/usr/bin/sudo executable don’t have the setuid permission 

Solution:
Set the setuid permission for /usr/bin/sudo command. #chmod u+s /usr/bin/sudo

Example:-
[root@testserver ~]# ls -al /usr/bin/sudo
-rwxr-xr-x 1 root root 697605 Mar  5  2014 /usr/bin/sudo
[root@testserver ~]# chmod u+s /usr/bin/sudo
[root@testserver ~]# ls -al /usr/bin/sudo
-rwsr-xr-x 1 root root 697605 Mar  5  2014 /usr/bin/sudo

Tuesday, December 12, 2017

Net Backup Activity Monitor shows backup jobs are in Queued state

Tuesday, December 12, 2017 0

Net Backup Activity Monitor shows backup jobs are in Queued state 

Login to the backup server and check the queue status

[root@Backupmaster ~]#  bpdbjobs | grep -i Queued
4097609         Backup           Queued            TEST-P-DB-PMTNGS1       Full-Weekly      testserver1.local.com
4097588         Backup           Queued                TEST-P-FS-WIN                Full-Weekly      testserver2.local.com
4097587         Backup           Queued                TEST-P-FS-WIN                Full-Weekly      testserver3-bkp.local.com

Queued process are getting increased 

[root@Backupmaster ~]#  bpdbjobs | grep -i Queued | wc -l
136
[root@Backupmaster ~]#  bpdbjobs | grep -i Queued | wc -l
151

Cause : nbrb process has stopped, terminated  or hung state. So there is no resource allocation for new backup jobs.

Solution : In Linux Backup Master server, run the below command.

#/usr/openv/netbackup/bin/nbrb

Now queued process are changed to Active state also in  job-details, can see the backup jobs are started.

Monday, December 11, 2017

How to set password non-expiry for user in linux

Monday, December 11, 2017 0

Set up password non-expiry for user in linux

NAME

       chage - change user password expiry information    

The chage command changes the number of days between password changes and the date of the last password change. This information is used by the system to determine when a user must change their password.

Below command is used to set non-expiry for testuser
   
#chage -I -1 -m 0 -M 4294967295 -E -1 testuser

[root@nsk-linux home]# chage -I -1 -m 0 -M 4294967295 -E -1 testuser1
[root@nsk-linux home]#
[root@nsk-linux home]# chage -l testuser1
Last password change                                    : Dec 10, 2017
Password expires                                        : never
Password inactive                                       : never
Account expires                                         : never
Minimum number of days between password change          : 0
Maximum number of days between password change          : 4294967295
Number of days of warning before password expires       : 7

Here
-I  Set the number of days of inactivity after a password has expired before the account is locked
-m  --mindays. Minimum number of days between password changes. A value of zero for this field indicates that the user may change their pssword at any time
-M  --maxdays. Maximum number of days during which a password is valid
-E  --expiredate. Set the date

Sunday, December 10, 2017

Ansible installation on Oracle Enterprise Linux Virtual Machine

Sunday, December 10, 2017 0

Ansible installation on Oracle Enterprise Linux Virtual Machine

Steps followed to install ansible on OEL VM

Go to  https://edelivery.oracle.com/osdc/faces/SearchSoftware
search for linux and from dropdown select OEL6.8 version
From the list of iso's provided select only the V138414-01.iso and download it.

Use the V138414-01.iso to build the VM

After building the VM and once you get the dhcp ip for the NIC, follow the below steps

Export Proxy Settings

[root@serv ~]# export http_proxy=http://www-proxy.myproxy.com:80
[root@serv ~]# export https_proxy=http://www-proxy.myproxy.com:80

Download EPEL RPM

[root@serv ~]# wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
--2016-06-08 15:21:40--  http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
Resolving www-proxy.oracleoutsourcing.com... 144.20.66.147
Connecting to www-proxy.oracleoutsourcing.com|144.20.66.147|:80... connected.
Proxy request sent, awaiting response... 302 Found
Location: http://mirror.us.leaseweb.net/epel/6/i386/epel-release-6-8.noarch.rpm [following]
--2016-06-08 15:21:41--  http://mirror.us.leaseweb.net/epel/6/i386/epel-release-6-8.noarch.rpm
Connecting to www-proxy.oracleoutsourcing.com|144.20.66.147|:80... connected.
Proxy request sent, awaiting response... 200 OK
Length: 14540 (14K) [application/x-redhat-package-manager]
Saving to: “epel-release-6-8.noarch.rpm”

100%[================================>] 14,540      27.8K/s   in 0.5s    

2016-06-08 15:21:42 (27.8 KB/s) - “epel-release-6-8.noarch.rpm” saved [14540/14540]

[root@serv ~]#

Install the EPEL RPM

[root@serv ~]# rpm -ivh epel-release-6-8.noarch.rpm
warning: epel-release-6-8.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Preparing...                  ########################################### [100%]
   1:epel-release           ########################################### [100%]

Load the Yum Repo List

[root@serv ~]# yum repolist
Loaded plugins: refresh-packagekit, security, ulninfo
epel/metalink                   | 4.1 kB     00:00     
epel                                 | 4.3 kB     00:00     
epel/primary_db              | 5.8 MB     00:04     
repo id                         repo name                                                                        status
epel                             Extra Packages for Enterprise Linux 6 - x86_64              2,117
public_ol6_UEKR4  Latest Unbreakable Enterprise Kernel Release 4 for Oracle Linux 6Server (x86_64)                                                                                                  115
public_ol6_latest      racle Linux 6Server Latest (x86_64)                                    36,028
repolist: 48,260

[root@serv ~]# yum install ansible
Loaded plugins: refresh-packagekit, security, ulninfo
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package ansible.noarch 0:2.0.2.0-1.el6 will be installed
--> Processing Dependency: sshpass for package: ansible-2.0.2.0-1.el6.noarch
--> Processing Dependency: python-six for package: ansible-2.0.2.0-1.el6.noarch
--> Processing Dependency: python-simplejson for package: ansible-2.0.2.0-1.el6.noarch
--> Processing Dependency: python-keyczar for package: ansible-2.0.2.0-1.el6.noarch
--> Processing Dependency: python-jinja2-26 for package: ansible-2.0.2.0-1.el6.noarch
--> Processing Dependency: python-httplib2 for package: ansible-2.0.2.0-1.el6.noarch
--> Processing Dependency: python-crypto2.6 for package: ansible-2.0.2.0-1.el6.noarch
--> Processing Dependency: PyYAML for package: ansible-2.0.2.0-1.el6.noarch
--> Running transaction check
---> Package PyYAML.x86_64 0:3.10-3.1.el6 will be installed
--> Processing Dependency: libyaml-0.so.2()(64bit) for package: PyYAML-3.10-3.1.el6.x86_64
---> Package python-crypto2.6.x86_64 0:2.6.1-2.el6 will be installed
---> Package python-httplib2.noarch 0:0.7.7-1.el6 will be installed
---> Package python-jinja2-26.noarch 0:2.6-3.el6 will be installed
--> Processing Dependency: python-babel >= 0.8 for package: python-jinja2-26-2.6-3.el6.noarch
---> Package python-keyczar.noarch 0:0.71c-1.el6 will be installed
--> Processing Dependency: python-pyasn1 for package: python-keyczar-0.71c-1.el6.noarch
---> Package python-simplejson.x86_64 0:2.0.9-3.1.el6 will be installed
---> Package python-six.noarch 0:1.9.0-2.el6 will be installed
---> Package sshpass.x86_64 0:1.05-1.el6 will be installed
--> Running transaction check
---> Package libyaml.x86_64 0:0.1.3-4.el6_6 will be installed
---> Package python-babel.noarch 0:0.9.4-5.1.el6 will be installed
---> Package python-pyasn1.noarch 0:0.0.12a-1.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================
 Package                           Arch              Version                    Repository                      Size
===================================================================
Installing:
 ansible                             noarch          2.0.2.0-1.el6          epel                            2.9 M
Installing for dependencies:
 PyYAML                            x86_64         3.10-3.1.el6       public_ol6_latest           157 k
 libyaml                              x86_64         0.1.3-4.el6_6      public_ol6_latest           51 k
 python-babel                   noarch          0.9.4-5.1.el6        public_ol6_latest           1.4 M
 python-crypto2.6            x86_64         2.6.1-2.el6            epel                               513 k
 python-httplib2                noarch         0.7.7-1.el6            epel                               70 k
 python-jinja2-26             noarch          2.6-3.el6               epel                               527 k
 python-keyczar               noarch          0.71c-1.el6          epel                               219 k
 python-pyasn1               noarch           0.0.12a-1.el6       public_ol6_latest          70 k
 python-simplejson        x86_64          2.0.9-3.1.el6          public_ol6_latest          126 k
 python-six                       noarch           1.9.0-2.el6           public_ol6_latest          28 k
 sshpass                         x86_64            1.05-1.el6           epel                              19 k
Transaction Summary
=====================================================================
Install      12 Package(s)

Total download size: 6.1 M
Installed size: 25 M
Is this ok [y/N]: y
Downloading Packages:
(1/12): PyYAML-3.10-3.1.el6.x86_64.rpm                   | 157 kB     00:00     
(2/12): ansible-2.0.2.0-1.el6.noarch.rpm                     | 2.9 MB     00:03     
(3/12): libyaml-0.1.3-4.el6_6.x86_64.rpm                   |  51 kB     00:00     
(4/12): python-babel-0.9.4-5.1.el6.noarch.rpm            | 1.4 MB     00:03     
(5/12): python-crypto2.6-2.6.1-2.el6.x86_64.rpm        | 513 kB     00:00     
(6/12): python-httplib2-0.7.7-1.el6.noarch.rpm            |  70 kB     00:00     
(7/12): python-jinja2-26-2.6-3.el6.noarch.rpm             | 527 kB     00:00     
(8/12): python-keyczar-0.71c-1.el6.noarch.rpm          | 219 kB     00:00     
(9/12): python-pyasn1-0.0.12a-1.el6.noarch.rpm        |  70 kB     00:00     
(10/12): python-simplejson-2.0.9-3.1.el6.x86_64.rpm  | 126 kB     00:00     
(11/12): python-six-1.9.0-2.el6.noarch.rpm                 |  28 kB     00:00     
(12/12): sshpass-1.05-1.el6.x86_64.rpm                    |  19 kB     00:00     
--------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                            263 kB/s | 6.1 MB     00:23     
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
Importing GPG key 0xEC551F03:
 Userid : Oracle OSS group (Open Source Software group) <build@oss.oracle.com>
 Package: 6:oraclelinux-release-6Server-8.0.3.x86_64 (@anaconda-OracleLinuxServer-201605181719.x86_64/6.8)
 From   : /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
Is this ok [y/N]: y
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
Importing GPG key 0x0608B895:
 Userid : EPEL (6) <epel@fedoraproject.org>
 Package: epel-release-6-8.noarch (installed)
 From   : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
===================================================================
 Package                           Arch              Version                    Repository                      Size
===================================================================
Installing:
 ansible                             noarch          2.0.2.0-1.el6          epel                              2.9 M
Installing for dependencies:
 PyYAML                          x86_64         3.10-3.1.el6          public_ol6_latest           157 k
 libyaml                            x86_64         0.1.3-4.el6_6        public_ol6_latest            51 k
 python-babel                   noarch          0.9.4-5.1.el6        public_ol6_latest            1.4 M
 python-crypto2.6            x86_64         2.6.1-2.el6            epel                                 513 k
 python-httplib2                noarch         0.7.7-1.el6            epel                                 70 k
 python-jinja2-26             noarch          2.6-3.el6               epel                                 527 k
 python-keyczar               noarch         0.71c-1.el6            epel                                 219 k
 python-pyasn1               noarch          0.0.12a-1.el6         public_ol6_latest            70 k
 python-simplejson          x86_64         2.0.9-3.1.el6          public_ol6_latest            126 k
 python-six                       noarch         1.9.0-2.el6              public_ol6_latest             28 k
 sshpass                          x86_64        1.05-1.el6               epel                                 19 k

Installed:
  ansible.noarch 0:2.0.2.0-1.el6                                                                                                                                                 

Dependency Installed:
 PyYAML.x86_64 0:3.10-3.1.el6                   libyaml.x86_64 0:0.1.3-4.el6_6           
 python-babel.noarch 0:0.9.4-5.1.el6            python-crypto2.6.x86_64 0:2.6.1-2.el6      
python-httplib2.noarch 0:0.7.7-1.el6             python-jinja2-26.noarch 0:2.6-3.el6       
python-keyczar.noarch 0:0.71c-1.el6           python-pyasn1.noarch 0:0.0.12a-1.el6       
  python-simplejson.x86_64 0:2.0.9-3.1.el6       python-six.noarch 0:1.9.0-2.el6           sshpass.x86_64 0:1.05-1.el6              

Complete!
[root@serv ~]# ansible --version
ansible 2.0.2.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides

[root@serv ~]# 

Saturday, December 9, 2017

NTP client configuration in Windows Server - PowerShell

Saturday, December 09, 2017 0
Below procedure is used to configure NTP  client on windows server (power shell commands)

Open Power Shell as Administrator

Run the below commands

PS C:\Users\testuser>w32tm /config /manualpeerlist:"0.rhel.pool.ntp.org 1.rhel.pool.ntp.org 2.rhel.pool.ntp.org 3.rhel.pool.ntp.org 0.pool.ntp.org 1.pool.ntp.org 2.pool.ntp.org 3.pool.ntp.org" /syncfromflags:MANUAL

PS C:\Users\testuser>Stop-Service w32time
PS C:\Users\testuser>Start-Service w32time

PS C:\Users\testuser>w32tm /query /status

PS C:\Users\testuser> w32tm /query /status
Leap Indicator: 0(no warning)
Stratum: 3 (secondary reference - syncd by (S)NTP)
Precision: -6 (15.625ms per tick)
Root Delay: 0.0625000s
Root Dispersion: 0.3055127s
ReferenceId: 0xAC18000B (source IP:  172.0.0.11)
Last Successful Sync Time: 12/7/2017 8:44:49 AM
Source: 0.rhel.pool.ntp.org
Poll Interval: 15 (32768s)

PS C:\Users\testuser>w32tm /resync

Friday, December 8, 2017

Tree command in Linux Brief Explaination

Friday, December 08, 2017 0

Tree command is used to recursively check the number of files in folder.

tree - list contents of directories in a tree-like format

Tree is a recursive directory listing program that produces a depth indented listing of files. With no arguments, tree lists the files in the current directory.  When directory arguments are given, tree lists all the files and/or directories found in the given directories each in turn.  Upon completion of  listing all files/directories found, tree returns the total number of files and/or directories listed.

[root@testserver nsk]# tree -iLf 1 /home/nsk/
/home/nsk/
/home/nsk//audit.txt
/home/nsk//audit1.txt
/home/nsk//auditprod.txt
/home/nsk//auditprod1.txt
/home/nsk//dom
/home/nsk//ser.txt
/home/nsk//serv.txt
/home/nsk//serv1.txt
/home/nsk//server.txt
/home/nsk//umount
/home/nsk//umount-ser
/home/nsk//umount-ser1

0 directories, 12 files

Where:
    -i   Makes tree not print the indentation lines, useful when used in conjunction with the -f option.
    -L level Max display depth of the directory tree.