Tuesday, 27 March 2018

Issues: the semaphore value occupied more than the default value.

Error Log: 
[root@sankar ~]#  grep "A semaphore set has to be" /var/log/messages | head
Mar 18 03:05:27 xxx Server Administrator (Shared Library): Data Engine EventID: 0  A semaphore set has to be created but the system limit for the maximum number of semaphore sets has been exceeded
Mar 18 03:05:34 xxx  Server Administrator (Shared Library): Data Engine EventID: 0  A semaphore set has to be created but the system limit for the maximum number of semaphore sets has been exceeded
Mar 18 03:05:34 xxxx Server Administrator (Shared Library): Data Engine EventID: 0  A semaphore set has to be created but the system limit for the maximum number of semaphore sets has been exceeded



[root@sankar ~]# ipcs -ls
------ Semaphore Limits --------
max number of arrays = 128  //default value
max semaphores per array = 250
max semaphores system wide = 32000
max ops per semop call = 32
semaphore max value = 32767

Currently occupied values are
[root@sankar ~]#ipcs -s |wc -l
131

So, we need to increase the 128 to some bigger value.
But in our case we’ve find multiple values occupied Nagios. Like as below

[[root@sankar ~]# ipcs -s

------ Semaphore Arrays --------
key        semid      owner      perms      nsems    
0x000000a7 2359296    root      600        1        
0x00000000 2719745    root      600        1        
0x00000000 2752514    root      600        1        
0x00000000 2785283    root      600        1        
0x00000000 3047428    root      600        1        
0x00000000 3014661    root      600        1        
0x00000000 2883590    root      600        1        
0x00000000 2916359    root      600        1        
0x00000000 2949128    root      600        1        
0x00000000 2981897    root      600        1        
0x00000000 3080202    root      600        1        
0x00000000 3112971    root      600        1        
0x00000000 3145740    root      600        1        
0x00000000 3178509    root      600        1        
0x00000000 3211278    root      600        1        
0x00000000 3244047    root      600        1        
0x00000000 3276816    root      600        1        
0x00000000 3309585    root      600        1        
0x00000000 3375122    root      600        1         
0x00000000 3407891    root      600        1        
0x00000000 3440660    root      666        1        
0x00000000 3473429    root      600        1        
0x00000000 3506198    root      600        1        
0x00000000 1875542039 www       600        1        
0x00000000 399966232  www       600        1        
0x00000000 3866649    root      600        1        
0x00000000 3899418    root      600        1        
0x00000000 3932187    root      600        1        
0x00000000 1065222172 www       600        1        
0x00000000 1734672413 www       600        1        
0x00000000 268402718  www       600        1        
0x00000000 991526943  www       600        1        
0x00000000 1003716640 www       600        1        
0x00000000 214138913  www       600        1        
0x00000000 893124642  www       600        1        
0x00000000 12419107   root      600        1        
0x00000000 12451876   root      600        1        
0x00000000 12484645   root      600        1        
0x00000000 12517414   root      600        1        
0x00000000 12550183   root      600        1        
0x00000000 12582952   root      600        1        
0x00000000 12615721   root      600        1        
0x00000000 12648490   root      600        1        
0x00000000 893157419  www       600        1        
0x00000000 892960812  www       600        1        
0x00000000 1351516205 www       600        1        
0x00000000 1351548974 www       600        1         
0x00000000 1351581743 www       600        1        
0x00000000 1351614512 www       600        1        
0x00000000 1378058289 nagios    600        1        
0x00000000 1378091058 nagios    600        1        
0x00000000 1378123827 nagios    600        1        
0x00000000 1378156596 nagios    600        1        
0x00000000 1396604981 nagios    600        1        
0x00000000 1396637750 nagios    600        1        
0x00000000 1396670519 nagios    600        1        
0x00000000 1396703288 nagios    600        1        
0x00000000 1401192505 nagios    600        1        
0x00000000 1401225274 nagios    600        1        
0x00000000 1401258043 nagios    600        1        
0x00000000 1401290812 nagios    600        1        
0x00000000 1405780029 nagios    600        1        
0x00000000 1405812798 nagios    600        1        
0x00000000 1405845567 nagios    600        1        
0x00000000 1405878336 nagios    600        1        
0x00000000 1408041025 nagios    600        1        
0x00000000 1408073794 nagios    600        1        
0x00000000 1408106563 nagios    600        1        
0x00000000 1408139332 nagios    600        1        
0x00000000 1410302021 nagios    600        1        
0x00000000 1410334790 nagios    600        1        
0x00000000 1410367559 nagios    600        1        
0x00000000 1410400328 nagios    600        1        
0x00000000 1421869129 nagios    600        1        
0x00000000 1421901898 nagios    600        1         
0x00000000 1421934667 nagios    600        1        
0x00000000 1421967436 nagios    600        1        
0x00000000 1449721933 nagios    600        1        
0x00000000 1449754702 nagios    600        1        
0x00000000 1449787471 nagios    600        1        
0x00000000 1449820240 nagios    600        1        
0x00000000 2029092945 nagios    600        1        
0x00000000 2029125714 nagios    600        1        
0x00000000 2029158483 nagios    600        1        
0x00000000 993919060  www       600        1        
0x00000000 2029191253 nagios    600        1        
0x00000000 2045313110 nagios    600        1        
0x00000000 2045345879 nagios    600        1        
0x00000000 2045378648 nagios    600        1        
0x00000000 2045411417 nagios    600        1        
0x00000000 2047574106 nagios    600        1        
0x00000000 2047606875 nagios    600        1        
0x00000000 2047639644 nagios    600        1        
0x00000000 2047672413 nagios    600        1        
0x00000000 2049966174 nagios    600        1        
0x00000000 2049998943 nagios    600        1        
0x00000000 2052161632 nagios    600        1        
0x00000000 2052194401 nagios    600        1        
0x00000000 2052227170 nagios    600        1        
0x00000000 2052259939 nagios    600        1        
0x00000000 2054422628 nagios    600        1        
0x00000000 2054455397 nagios    600        1        
0x00000000 2054488166 nagios    600        1        
0x00000000 2054520935 nagios    600        1        
0x00000000 2056683624 nagios    600        1        
0x00000000 2056716393 nagios    600        1        
0x00000000 2056749162 nagios    600        1        
0x00000000 2056781931 nagios    600        1         
0x00000000 2105573484 nagios    600        1        
0x00000000 2105606253 nagios    600        1        
0x00000000 2105639022 nagios    600        1        
0x00000000 2105671791 nagios    600        1        
0x00000000 2107834480 nagios    600        1        
0x00000000 2107867249 nagios    600        1        
0x00000000 2107900018 nagios    600        1        
0x00000000 2107932787 nagios    600        1        
0x00000000 516325492  nagios    600        1        
0x00000000 516358261  nagios    600        1        
0x00000000 516391030  nagios    600        1        
0x00000000 516423799  nagios    600        1        
0x00000000 518586488  nagios    600        1        
0x00000000 1003618425 www       600        1        
0x00000000 518619258  nagios    600        1        
0x00000000 518652027  nagios    600        1        
0x00000000 518684796  nagios    600        1        
0x00000000 520945789  nagios    600        1        
0x00000000 520978558  nagios    600        1        
[root@sankar ~]#

[root@sankar ~]# ipcs -s |grep nagios |wc -l
76

We’ve restart the service nagios-agent and Data Engine(omsa) services.

[root@sankar ~]# service xinetd stop
Stopping xinetd:                                           [  OK  ]

[root@sankar ~]# /etc/init.d/dataeng stop
Stopping Systems Management Data Engine:
Stopping dsm_sa_eventmgrd:                                 [  OK  ]
Stopping dsm_sa_datamgrd:                                  [  OK  ]
[root@sankar ~]# /etc/init.d/dsm_sa_ipmi stop
Stopping dsm_sa_ipmi drivers:                              [  OK  ]
[root@sankar ~]#/etc/init.d/dsm_sa_ipmi start
Starting dsm_sa_ipmi drivers:                              [  OK  ]
[root@sankar ~]# /etc/init.d/dataeng start
Starting Systems Management Data Engine:
Starting dsm_sa_datamgrd:                                  [  OK  ]
Starting dsm_sa_eventmgrd:                                 [  OK  ]
[root@sankar ~]# service xinetd status
xinetd is stopped
[root@sankar ~]#service xinetd start

Starting xinetd:                                           [  OK  ]

Now currently occupied semaphore values like as below and that value under the default threshold.
 [root@sankar ~]## ipcs -s |wc -l
55

Now we did not get the above errors on /var/log/messages.

Upgrade Python from 2.6.x to 2.7.x on RHEL/CentOS 6

Downloading latest Python version:

[root@sankar ~]# cd /opt

[root@sankar ~]#pwd
/opt
[root@sankar ~]# wget http://www.python.org/ftp/python/2.7.8/Python-2.7.8.tar.xz 
--2018-03-23 16:40:12--  http://www.python.org/ftp/python/2.7.8/Python-2.7.8.tar.xz
Resolving www.python.org... 151.101.116.223, 2a04:4e42:1c::223
Connecting to www.python.org|151.101.116.223|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://www.python.org/ftp/python/2.7.8/Python-2.7.8.tar.xz [following]
--2018-03-23 16:40:12--  https://www.python.org/ftp/python/2.7.8/Python-2.7.8.tar.xz
Connecting to www.python.org|151.101.116.223|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 10525244 (10M) [application/octet-stream]
Saving to: “Python-2.7.8.tar.xz”

100%[=========================================================================================>] 10,525,244  --.-K/s   in 0.1s    

2018-03-23 16:40:12 (95.9 MB/s) - “Python-2.7.8.tar.xz” saved [10525244/10525244]

[root@sankar ~]# ls -ltrh
total 24M
-rw-r--r--   1 root    root   9.8M May 11  2013 Python-2.7.5.tar.xz
-rw-r--r--   1 root    root    11M Jun 29  2014 Python-2.7.8.tar.xz
drwxr-xr-x   3 root    root   4.0K Aug 24  2016 sun
drwxr-xr-x   4 root    bin    4.0K Aug 24  2016 SYMCquiesce
-rw-r--r--   1 root    root   3.8M Mar  3  2017 xymon-4.3.28.tar.gz
drwxrwxr-x  16     500 nagios 4.0K Mar  3  2017 xymon-4.3.28
drwxr-xr-x   5 monitor ctsrvp 4.0K Mar 24  2017 monitor
drwx------   7 ansible ctmemp 4.0K Aug  3  2017 ansible
drwxr-xr-x.  2 root    root   4.0K Oct  3 13:05 rh
drwxr-xr-x  18 root    root   4.0K Mar 20 03:46 Python-2.7.5
[root@sankar ~]#

[root@sankar ~]#tar -xvf  Python-2.7.8.tar.xz 
[root@sankar ~]#ls -ltrh
total 24M
-rw-r--r--   1 root    root   9.8M May 11  2013 Python-2.7.5.tar.xz
drwxr-xr-x  17    1000   1000 4.0K Jun 29  2014 Python-2.7.8
-rw-r--r--   1 root    root    11M Jun 29  2014 Python-2.7.8.tar.xz
drwxr-xr-x   3 root    root   4.0K Aug 24  2016 sun
drwxr-xr-x   4 root    bin    4.0K Aug 24  2016 SYMCquiesce
-rw-r--r--   1 root    root   3.8M Mar  3  2017 xymon-4.3.28.tar.gz
drwxrwxr-x  16     500 nagios 4.0K Mar  3  2017 xymon-4.3.28
drwxr-xr-x   5 monitor ctsrvp 4.0K Mar 24  2017 monitor
drwx------   7 ansible ctmemp 4.0K Aug  3  2017 ansible
drwxr-xr-x.  2 root    root   4.0K Oct  3 13:05 rh
drwxr-xr-x  18 root    root   4.0K Mar 20 03:46 Python-2.7.5
[root@sankar ~]#

[root@sankar ~]# ./configure --prefix=/usr/local

[root@sankar ~]# make

[root@sankar ~]# make altinstall


[root@sankar ~]# python2.7 -V
Python 2.7.8
[root@sankar ~]# python2.7
Python 2.7.8 (default, Mar 23 2018, 17:50:22) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-18)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> quit()

Now we need to create a alias from default python path to latest version
[root@sankar ~]#python -V
Python 2.6.6

[root@sankar ~]# vi ~/.bashrc
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi
# User specific aliases and functions
alias python=/usr/local/bin/python2.7

[root@sankar ~]#source ~/.bashrc

Now it's shows upgraded version only
[root@sankar ~]#python -V
Python 2.7.8

Tuesday, 6 March 2018

[Dell OMSA] Dell EMC OpenManage Version 9.0.1 installation on RHEL7

1. verify the Dell service tag on the server

# dmidecode -t system
# dmidecode 3.0
Getting SMBIOS data from sysfs.
SMBIOS 2.6 present.

Handle 0x0100, DMI type 1, 27 bytes
System Information
        Manufacturer: Dell Inc.
        Product Name: PowerEdge R610
        Version: Not Specified
        Serial Number: *******     eg:XG7TU1K
        UUID: *******************
        Wake-up Type: Power Switch
        SKU Number: Not Specified
        Family: Not Specified

Handle 0x0C00, DMI type 12, 5 bytes
System Configuration Options
        Option 1: NVRAM_CLR:  Clear user settable NVRAM areas and set defaults
        Option 2: PWRD_EN:  Close to enable password

Handle 0x2000, DMI type 32, 11 bytes
System Boot Information
        Status: No errors detected

2. Based on the service tag you need to search on Dell site: http://www.dell.com/support/ and download the OpenManger.

3. I am using script for this setup.

[root@sankar-HP ~]#wget -q -O - http://linux.dell.com/repo/hardware/latest/bootstrap.cgi | bash

[root@sankar-HP ~]#yum install srvadmin-all

Note: for first time it's need a reboot.

4. check the port is up or not
[root@sankar-HP ~]#netstat -ntlup |grep 1311
tcp6       0      0 :::1311                 :::*                    LISTEN      12135/dsm_om_connsv

5.Open browser on run the like host-name or IP: 1311 eg(https://192.168.1.1:1311)




How to Enable or Disable SELinux on CentOS/RHEL 7

1. Verify the current status:


[root@sankar-HP ~]# cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)

[root@sankar-HP ~]# uname -a
Linux AT-LC-CHAMBERLIN 3.10.0-693.17.1.el7.x86_64 #1 SMP Thu Jan 25 20:13:58 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux


[root@sankar-HP ~]# sestatus
SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   enforcing
Mode from config file:          enforcing
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Max kernel policy version:      28

2. Open a selinux config file,
[root@sankar-HP ~]# vi /etc/sysconfig/selinux

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted


[root@sankar-HP ~]#reboot
[root@sankar-HP ~]# sestatus
SELinux status:                 disabled


How to Start/Stop or Enable/Disable firewalld on CentOS/RHEL 7

[root@sankar-HP ~]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2018-03-02 18:39:44 PST; 3 days ago
     Docs: man:firewalld(1)
 Main PID: 1001 (firewalld)
   CGroup: /system.slice/firewalld.service
           â””─1001 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid

[root@sankar-HP ~]#systemctl disable firewalld
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.

[root@sankar-HP ~]# systemctl stop firewalld

[root@sankar-HP ~]#systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:firewalld(1)

systemd[1]: Starting firewalld - dynamic firewall daemon...
 systemd[1]: Started firewalld - dynamic firewall daemon.
 firewalld[1001]: WARNING: ICMP type 'beyond-scope' is not supported by the kernel for ipv6.
 firewalld[1001]: WARNING: beyond-scope: INVALID_ICMPTYPE: No supported ICMP type., ignoring for run-time.
.......
 systemd[1]: Stopping firewalld - dynamic firewall daemon...
 systemd[1]: Stopped firewalld - dynamic firewall daemon.