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

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.

Thursday, December 7, 2017

OpenLdap user login issue asking to enter password again and again

Thursday, December 07, 2017 0
Situation:

              Openldap user is having issue while login to the server, it is asking password again and again.


Solution:

             Restart nslcd service. 

[root@testserver~]# /etc/init.d/nslcd restart
Stopping nslcd:                                            [  OK  ]
Starting nslcd:                                              [  OK  ]

NAME
       nslcd - local LDAP name service daemon. nslcd is a daemon that will do LDAP queries for local processes based on a simple configuration file.

Home directory Error oddjob-mkhomedir not working

Thursday, December 07, 2017 0

Home directory Error oddjob-mkhomedir not working

Situation:
While login as user, getting Error  oddjob-mkhomedir not working 

Solution:
1. yum install dbus oddjob oddjob-mkhomedir
2. service restart messagebus
3. service restart oddjob
4. Add the line "session required pam_oddjob_mkhomedir.so" to /etc/pam.d/sshd  file
5. Delete a users home directory (rm -rf /home/nskselvan)
6. Disable and enable the "Use LDAP Authentication" in authconfig-tui (authconfig-tui - an interface for configuring system authentication resources)
7. Log in using ssh as this user.

[root@testserver ~]# yum install dbus oddjob oddjob-mkhomedir
Setting up Install Process
Package 1:dbus-1.2.24-8.0.1.el6_6.x86_64 already installed and latest version
Package oddjob-0.30-5.el6.x86_64 already installed and latest version
Package oddjob-mkhomedir-0.30-5.el6.x86_64 already installed and latest version
Nothing to do

[root@testserver ~]# service  messagebus restart
Stopping system message bus:                               [  OK  ]
Starting system message bus:                                 [  OK  ]
[root@testserver ~]# chkconfig messagebus on
[root@testserver ~]# /etc/init.d/oddjobd status
oddjobd is stopped
[root@testserver ~]# /etc/init.d/oddjobd restart
Shutting down oddjobd:                                           [FAILED]
Starting oddjobd:                                                       [  OK  ]
[root@testserver ~]# /etc/init.d/oddjobd restart
Shutting down oddjobd:                                            [  OK  ]
Starting oddjobd:                                                       [  OK  ]
[root@testserver ~]# chkconfig oddjobd on

[root@testserver ~]# cat /etc/pam.d/sshd |  grep -i pam_oddjob_mkhomedir.so
#%PAM-1.0
session    required     pam_oddjob_mkhomedir.so

[root@testserver ~]# authconfig-tui
Here, disable (unselect)  the Use LDAP Authentication and save

[root@testserver ~]# authconfig-tui
Here, Enable (Select) the Use LDAP authentication and save. The result will be like below.
Starting nscd:                                             [  OK  ]
Starting nslcd:                                            [  OK  ]

Wednesday, December 6, 2017

Integrated Lights Out Manager Command to Turn On or Turn Off the Locator Indicator Remotely

Wednesday, December 06, 2017 0

Integrated Lights Out Manager Command  to Turn On or Turn Off  the Locator Indicator Remotely  

Below  Integrated Lights Out Manager Command is used to Turn On or Turn Off  the locator indicator .

Turn on the Locator indicator, type the following command at the  ILOM prompt:
set /System/ locator_indicator=on

Turn off the Locator indicator, type the following command at the ILOM prompt:
set /System/ locator_indicator=off

–> show /System/ locator_indicator

The output of the command appears:

/System

Properties:

locator_indicator = Off

The value locator_indicator shows the status as either On or Off.