Sabtu, 07 Juli 2018

Install pyTelegramBotAPI on Linux machine

  Tidak ada komentar
Some time as sysadmin we need to setup the host to login using ssh without typing password
Step 1: Install Requirement environment
First we need install epel release before we can install pip
[maswachid@ccontrol90 ~]$ sudo yum install epel-release
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.nes.co.id
 * extras: repo.apiknet.co.id
 * updates: repo.apiknet.co.id
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:7-11 will be installed
--> Finished Dependency Resolution
.....         
 Install pip by running following command
[maswachid@ccontrol90 ~]$ sudo yum install -y python-pip
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
....
Install BeautifulSoap plugin with pip by running following command 
[maswachid@ccontrol90 ~]$
[maswachid@ccontrol90 ~]$ sudo pip install BeautifulSoup4
Collecting BeautifulSoup4
  Downloading https://files.pythonhosted.org/packages/a6/29/bcbd41a916ad3faf517780a0af7d0254e8d6722ff6414723eedba4334531/beautifulsoup4-4.6.0-py2-none-any.whl (86kB)
    100% |████████████████████████████████| 92kB 1.1MB/s
Installing collected packages: BeautifulSoup4
Successfully installed BeautifulSoup4-4.6.0
Step 2: Install pyTelegramBotAPI
Install the telegram bot api using pip by running following command 
[maswachid@ccontrol90 ~]$
[maswachid@ccontrol90 ~]$ sudo pip install pyTelegramBotAPI
Collecting pyTelegramBotAPI
  Downloading https://files.pythonhosted.org/packages/9e/7c/fcc6beb6f3f4030714ced7ac640c1b1158ea03ae674c87d925d6e07152be/pyTelegramBotAPI-3.6.3.tar.gz (53kB)
    100% |████████████████████████████████| 61kB 1.4MB/s
Collecting requests (from pyTelegramBotAPI)
  Downloading https://files.pythonhosted.org/packages/65/47/7e02164a2a3db50ed6d8a6ab1d6d60b69c4c3fdf57a284257925dfc12bda/requests-2.19.1-py2.py3-none-any.whl (91kB)
    100% |████████████████████████████████| 92kB 2.2MB/s
Collecting six (from pyTelegramBotAPI)
  Downloading https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
Collecting idna<2.8,>=2.5 (from requests->pyTelegramBotAPI)
  Downloading https://files.pythonhosted.org/packages/4b/2a/0276479a4b3caeb8a8c1af2f8e4355746a97fab05a372e4a2c6a6b876165/idna-2.7-py2.py3-none-any.whl (58kB)
    100% |████████████████████████████████| 61kB 2.4MB/s
Collecting chardet<3.1.0,>=3.0.2 (from requests->pyTelegramBotAPI)
  Downloading https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB)
    100% |████████████████████████████████| 143kB 2.6MB/s
Collecting urllib3<1.24,>=1.21.1 (from requests->pyTelegramBotAPI)
  Downloading https://files.pythonhosted.org/packages/bd/c9/6fdd990019071a4a32a5e7cb78a1d92c53851ef4f56f62a3486e6a7d8ffb/urllib3-1.23-py2.py3-none-any.whl (133kB)
    100% |████████████████████████████████| 143kB 1.6MB/s
Collecting certifi>=2017.4.17 (from requests->pyTelegramBotAPI)
  Downloading https://files.pythonhosted.org/packages/7c/e6/92ad559b7192d846975fc916b65f667c7b8c3a32bea7372340bfe9a15fa5/certifi-2018.4.16-py2.py3-none-any.whl (150kB)
    100% |████████████████████████████████| 153kB 1.3MB/s
Installing collected packages: idna, chardet, urllib3, certifi, requests, six, pyTelegramBotAPI
  Running setup.py install for pyTelegramBotAPI ... done
Successfully installed certifi-2018.4.16 chardet-3.0.4 idna-2.7 pyTelegramBotAPI-3.6.3 requests-2.19.1 six-1.11.0 urllib3-1.23
You are using pip version 8.1.2, however version 10.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
[maswachid@ccontrol90 ~]$
Create file for telegram bot command and config
[maswachid@ccontrol90 ~]$ vi TelegramBot.py
[maswachid@ccontrol90 ~]$ vi config.py
[maswachid@ccontrol90 ~]$
[maswachid@ccontrol90 ~]$ ls
config.py  TelegramBot.py
[maswachid@ccontrol90 ~]$
[maswachid@ccontrol90 ~]$ chmod 755 TelegramBot.py config.py
[maswachid@ccontrol90 ~]$ ls
config.py  s9s_tmp  TelegramBot.py
[maswachid@ccontrol90 ~]$
[maswachid@ccontrol90 ~]$ phyton TelegramBot.py

Jumat, 06 Juli 2018

How to delete or listing file more than x days on linux

  Tidak ada komentar
Some time as sysadmin we need to find or remove the old files that more than x days on our Linux Server, here are some command to find or remove some old files
Step 1: Listing file ( ls )
Command syntax

find /path/to/files* -type f -mtime +5 -exec ls {} \;
Note that there are spaces between ls, {}, and \;

Explanation:

  • find: the unix command for finding files/directories/links and etc.
  • /path/to/: the directory to start your search in.
  • -type f: only find files.
  • -files*: list files that starts with files.
  • -mtime +5: only consider the ones with modification time older than 5 days.
  • -exec ... \;: for each such result found, do the following command ....
  • ls -- '{}': list the file; the {} part is where the find result gets substituted into from the previous part. -- means end of command parameters avoid prompting error for those files starting with hyphen.

Listing the file and filter the file shown file that have modified time more than x days
[maswachid@dbserver backup]$ ls
MSCHED-2018-07-01_00-57-49.dmp.tar.bz2  LALABIM-2018-07-01_00-57-50.dmp.tar.bz2
MSCHED-2018-07-02_00-57-44.dmp.tar.bz2  LALABIM-2018-07-02_00-57-44.dmp.tar.bz2
MSCHED-2018-07-03_00-57-38.dmp.tar.bz2  LALABIM-2018-07-03_00-57-39.dmp.tar.bz2
MSCHED-2018-07-04_00-57-33.dmp.tar.bz2  LALABIM-2018-07-04_00-57-33.dmp.tar.bz2
MSCHED-2018-07-05_00-57-28.dmp.tar.bz2  LALABIM-2018-07-05_00-57-29.dmp.tar.bz2
MSCHED-2018-07-06_00-57-22.dmp.tar.bz2  LALABIM-2018-07-06_00-57-23.dmp.tar.bz2
MSCHED-2018-07-07_00-57-17.dmp.tar.bz2  LALABIM-2018-07-07_00-57-17.dmp.tar.bz2
[maswachid@dbserver backup]$
[maswachid@dbserver backup]$ find MSCHED* -mtime +5 -exec ls {} \;
MSCHED-2018-07-01_00-57-49.dmp.tar.bz2
[maswachid@dbserver backup]$
[maswachid@dbserver backup]$ find MSCHED* -mtime +4 -exec ls {} \;
MSCHED-2018-07-01_00-57-49.dmp.tar.bz2
MSCHED-2018-07-02_00-57-44.dmp.tar.bz2
[maswachid@dbserver backup]$

Step 2: Remove file ( rm )
Command syntax

find /path/to/files* -type f -mtime +5 -exec rm {} \;
Note that there are spaces between rm, {}, and \;
[maswachid@dbserver backup]$
[maswachid@dbserver backup]$ find MSCHED* -mtime +4 -exec ls {} \;
MSCHED-2018-07-01_00-57-49.dmp.tar.bz2
MSCHED-2018-07-02_00-57-44.dmp.tar.bz2
[maswachid@dbserver backup]$
[maswachid@dbserver backup]$ find MSYSSCHED* -mtime +4 -exec rm {} \;
[maswachid@dbserver backup]$
[maswachid@dbserver backup]$ find MSYSSCHED* -mtime +4 -exec ls {} \;
[maswachid@dbserver backup]$
Be careful with special file names (spaces, quotes) when piping to rm.
There is a safe alternative - the -delete option:
find /path/to/directory/ -type f -mindepth 1 -mtime +5 -delete
That's it, no separate rm call and you don't need to worry about file names.
Replace -delete with -depth -print to test this command before you run it (-delete implies -depth).
Alternatively, if you want to do the same for all files NEWER than five days you can running following syntax
Command syntax

find /path/to/files* -type f -mindepth 1 -mtime -5 -exec rm {} \;

Kamis, 05 Juli 2018

How to fix [ALERT] 186/075705 (16762) : Could not open configuration file /etc/haproxy/haproxy.cfg : Permission denied

  Tidak ada komentar
Some time as sysadmin we face error [ALERT] 186/075705 (16762) : Could not open configuration file /etc/haproxy/haproxy.cfg : Permission denied on haproxy
Step 1: Set Selinux permissive to haproxy
Completely haproxy error status
[maswachid@localhost ~]$ sudo service haproxy status
[sudo] password for yudha:
Redirecting to /bin/systemctl status  haproxy.service
● haproxy.service - HAProxy Load Balancer
   Loaded: loaded (/usr/lib/systemd/system/haproxy.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Fri 2018-07-06 07:57:05 WIB; 1min 26s ago
  Process: 16761 ExecStart=/usr/sbin/haproxy-systemd-wrapper -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid $OPTIONS (code=exited, status=1/FAILURE)
 Main PID: 16761 (code=exited, status=1/FAILURE)

Jul 06 07:57:05 localhost.localdomain systemd[1]: Started HAProxy Load Balancer.
Jul 06 07:57:05 localhost.localdomain systemd[1]: Starting HAProxy Load Balancer...
Jul 06 07:57:05 localhost.localdomain haproxy-systemd-wrapper[16761]: haproxy-systemd-wrapper: executing /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /run/hap....pid -Ds
Jul 06 07:57:05 localhost.localdomain haproxy-systemd-wrapper[16761]: [ALERT] 186/075705 (16762) : Could not open configuration file /etc/haproxy/haproxy.cfg : Pe...n denied
Jul 06 07:57:05 localhost.localdomain haproxy-systemd-wrapper[16761]: haproxy-systemd-wrapper: exit, haproxy RC=1
Jul 06 07:57:05 localhost.localdomain systemd[1]: haproxy.service: main process exited, code=exited, status=1/FAILURE
Jul 06 07:57:05 localhost.localdomain systemd[1]: Unit haproxy.service entered failed state.
Jul 06 07:57:05 localhost.localdomain systemd[1]: haproxy.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
[maswachid@localhost ~]$
Set permissive to selinux by running following command
[maswachid@localhost ~]$ sudo semanage permissive -a haproxy_t

Step 2: Restart the haproxy and check the status
Restart and check haproxy status by running following command line
[maswachid@localhost ~]$ sudo service haproxy start
Redirecting to /bin/systemctl start  haproxy.service
[yudha@localhost ~]$ sudo service haproxy status
Redirecting to /bin/systemctl status  haproxy.service
● haproxy.service - HAProxy Load Balancer
   Loaded: loaded (/usr/lib/systemd/system/haproxy.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2018-07-06 08:12:34 WIB; 3s ago
 Main PID: 1018 (haproxy-systemd)
   CGroup: /system.slice/haproxy.service
           ├─1018 /usr/sbin/haproxy-systemd-wrapper -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid
           ├─1019 /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -Ds
           └─1020 /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -Ds

Jul 06 08:12:34 localhost.localdomain systemd[1]: Started HAProxy Load Balancer.
Jul 06 08:12:34 localhost.localdomain systemd[1]: Starting HAProxy Load Balancer...
Jul 06 08:12:34 localhost.localdomain haproxy-systemd-wrapper[1018]: haproxy-systemd-wrapper: executing /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -Ds
Hint: Some lines were ellipsized, use -l to show in full.
[maswachid@localhost ~]$

How to setting Keyless SSH key, Generate RSA key Copy RSA

  Tidak ada komentar
Some time as sysadmin we need to setup the host to login using ssh without typing password
Step 1: Generate RSA key
Generate RSA public and private key by running following command line
[maswachid@ccontrol90 ~]$ ssh-keygen -t rsa
Step 2: Copy rsa public key to target machine
Copy rsa public key by running follomand line
[maswachid@ccontrol90 ~]$  ssh-copy-id -i ~/.ssh/id_rsa.pub maswachid@192.168.1.32/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/maswachid/.ssh/id_rsa.pub"
The authenticity of host '192.168.1.32 (192.168.1.32)' can't be established.
ECDSA key fingerprint is SHA256:8AEC+g3kNIwoCTf7oMySfVMESepOX+EW/2z7UB2R6AE.
ECDSA key fingerprint is MD5:08:be:f7:78:11:1b:70:7b:64:dc:33:b5:f9:35:68:c1.
Are you sure you want to continue connecting (yes/no)? yes
/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
[email protected]'s password:

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh '[email protected]'"
and check to make sure that only the key(s) you wanted were added.

you can enter to target machine via ssh without password now
[maswachid@ccontrol90 ~]$  ssh [email protected]

How to setting SSH keyless linux system Centos

  Tidak ada komentar
Some time as sysadmin we need to setup the host to login using ssh without typing password
Step 1: Generate RSA key
Generate RSA public and private key by running following command line
[maswachid@ccontrol90 ~]$ ssh-keygen -t rsa
Step 2: Create .ssh directory on target machine
Create .ssh directory by running following command line
[maswachid@ccontrol90 ~]$  ssh [email protected] mkdir -p .ssh
Step 3: Copy the client public key to target machine
Create .ssh directory by running following command line
[maswachid@ccontrol90 ~]$ cat .ssh/id_rsa.pub | ssh [email protected] 'cat >> .ssh/authorized_keys'
Change directory and file privileges
[maswachid@ccontrol90 ~]$ ssh [email protected] "chmod 700 .ssh; chmod 640 .ssh/authorized_keys"
you can enter to target machine via ssh without password now

[maswachid@ccontrol90 ~]$  ssh [email protected] 

Rabu, 04 Juli 2018

How to find out or check conflict ip address Linux System Centos 7

  Tidak ada komentar
Some time as sysadmin we face a problem where a server some time unreachable some time reachable but when we ping never rto, and the problem gone when we restart the network, i can be caused by conflict IP address, it happen when more than one interface have same IP address on same network
Step 1: Install arp scan
Install by running command line bellow
[root@ccontrol ~]# yum install epel-release
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.buana.web.id
 * extras: mirror.buana.web.id
 * updates: mirror.buana.web.id
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:7-11 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                Arch             Version         Repository        Size
================================================================================
Installing:
 epel-release           noarch           7-11            extras            15 k

Transaction Summary
================================================================================
Install  1 Package

Total download size: 15 k
Installed size: 24 k
Is this ok [y/d/N]: y
Downloading packages:
epel-release-7-11.noarch.rpm                               |  15 kB   00:02
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : epel-release-7-11.noarch                                     1/1
  Verifying  : epel-release-7-11.noarch                                     1/1

Installed:
  epel-release.noarch 0:7-11

Complete!
[root@ccontrol ~]#
[root@ccontrol ~]# yum install arp-scan
Loaded plugins: fastestmirror
epel/x86_64/metalink                                     | 8.5 kB     00:00
epel                                                     | 4.7 kB     00:00
(1/3): epel/x86_64/group_gz                                |  95 kB   00:00
(2/3): epel/x86_64/primary_db                              | 6.7 MB   00:02
(3/3): epel/x86_64/updateinfo                              | 1.0 MB   00:12
Loading mirror speeds from cached hostfile
 * base: mirror.buana.web.id
 * epel: mirror.telkomuniversity.ac.id
 * extras: mirror.buana.web.id
 * updates: mirror.buana.web.id
Resolving Dependencies
--> Running transaction check
---> Package arp-scan.x86_64 0:1.9.2-1.el7 will be installed
--> Processing Dependency: perl(LWP::Simple) for package: arp-scan-1.9.2-1.el7.x86_64
--> Processing Dependency: perl(LWP::UserAgent) for package: arp-scan-1.9.2-1.el7.x86_64
--> Running transaction check
---> Package perl-libwww-perl.noarch 0:6.05-2.el7 will be installed
--> Processing Dependency: perl(WWW::RobotRules) >= 6 for package: perl-libwww-perl-6.05-2.el7.noarch
--> Processing Dependency: perl(URI) >= 1.10 for package: perl-libwww-perl-6.05-2.el7.noarch
--> Processing Dependency: perl(Net::HTTP) >= 6.04 for package: perl-libwww-perl-6.05-2.el7.noarch
--> Processing Dependency: perl(LWP::MediaTypes) >= 6 for package: perl-libwww-perl-6.05-2.el7.noarch
--> Processing Dependency: perl(HTTP::Status) >= 6 for package: perl-libwww-perl-6.05-2.el7.noarch
--> Processing Dependency: perl(HTTP::Response) >= 6 for package: perl-libwww-perl-6.05-2.el7.noarch
--> Processing Dependency: perl(HTTP::Request::Common) >= 6 for package: perl-libwww-perl-6.05-2.el7.noarch
--> Processing Dependency: perl(HTTP::Request) >= 6 for package: perl-libwww-perl-6.05-2.el7.noarch
--> Processing Dependency: perl(HTTP::Negotiate) >= 6 for package: perl-libwww-perl-6.05-2.el7.noarch
--> Processing Dependency: perl(HTTP::Date) >= 6 for package: perl-libwww-perl-6.05-2.el7.noarch
--> Processing Dependency: perl(HTTP::Daemon) >= 6 for package: perl-libwww-perl-6.05-2.el7.noarch
--> Processing Dependency: perl(HTTP::Cookies) >= 6 for package: perl-libwww-perl-6.05-2.el7.noarch
--> Processing Dependency: perl(File::Listing) >= 6 for package: perl-libwww-perl-6.05-2.el7.noarch
--> Processing Dependency: perl(URI::Heuristic) for package: perl-libwww-perl-6.05-2.el7.noarch
--> Processing Dependency: perl(URI::Escape) for package: perl-libwww-perl-6.05-2.el7.noarch
--> Processing Dependency: perl(HTML::HeadParser) for package: perl-libwww-perl-6.05-2.el7.noarch
--> Processing Dependency: perl(HTML::Entities) for package: perl-libwww-perl-6.05-2.el7.noarch
--> Processing Dependency: perl(Encode::Locale) for package: perl-libwww-perl-6.05-2.el7.noarch
--> Processing Dependency: perl(Digest::MD5) for package: perl-libwww-perl-6.05-2.el7.noarch
--> Running transaction check
---> Package perl-Digest-MD5.x86_64 0:2.52-3.el7 will be installed
--> Processing Dependency: perl(Digest::base) >= 1.00 for package: perl-Digest-MD5-2.52-3.el7.x86_64
---> Package perl-Encode-Locale.noarch 0:1.03-5.el7 will be installed
---> Package perl-File-Listing.noarch 0:6.04-7.el7 will be installed
---> Package perl-HTML-Parser.x86_64 0:3.71-4.el7 will be installed
--> Processing Dependency: perl(HTML::Tagset) >= 3 for package: perl-HTML-Parser-3.71-4.el7.x86_64
---> Package perl-HTTP-Cookies.noarch 0:6.01-5.el7 will be installed
---> Package perl-HTTP-Daemon.noarch 0:6.01-8.el7 will be installed
--> Processing Dependency: perl(IO::Socket::IP) for package: perl-HTTP-Daemon-6.01-8.el7.noarch
---> Package perl-HTTP-Date.noarch 0:6.02-8.el7 will be installed
--> Processing Dependency: perl(Time::Zone) for package: perl-HTTP-Date-6.02-8.el7.noarch
---> Package perl-HTTP-Message.noarch 0:6.06-6.el7 will be installed
--> Processing Dependency: perl(IO::Uncompress::Bunzip2) >= 2.021 for package: perl-HTTP-Message-6.06-6.el7.noarch
--> Processing Dependency: perl(IO::Compress::Bzip2) >= 2.021 for package: perl-HTTP-Message-6.06-6.el7.noarch
--> Processing Dependency: perl(IO::Uncompress::RawInflate) for package: perl-HTTP-Message-6.06-6.el7.noarch
--> Processing Dependency: perl(IO::Uncompress::Inflate) for package: perl-HTTP-Message-6.06-6.el7.noarch
--> Processing Dependency: perl(IO::Uncompress::Gunzip) for package: perl-HTTP-Message-6.06-6.el7.noarch
--> Processing Dependency: perl(IO::HTML) for package: perl-HTTP-Message-6.06-6.el7.noarch
--> Processing Dependency: perl(IO::Compress::Gzip) for package: perl-HTTP-Message-6.06-6.el7.noarch
--> Processing Dependency: perl(IO::Compress::Deflate) for package: perl-HTTP-Message-6.06-6.el7.noarch
--> Processing Dependency: perl(Compress::Raw::Zlib) for package: perl-HTTP-Message-6.06-6.el7.noarch
---> Package perl-HTTP-Negotiate.noarch 0:6.01-5.el7 will be installed
---> Package perl-LWP-MediaTypes.noarch 0:6.02-2.el7 will be installed
--> Processing Dependency: mailcap for package: perl-LWP-MediaTypes-6.02-2.el7.noarch
---> Package perl-Net-HTTP.noarch 0:6.06-2.el7 will be installed
--> Processing Dependency: perl(IO::Socket::SSL) >= 1.38 for package: perl-Net-HTTP-6.06-2.el7.noarch
---> Package perl-URI.noarch 0:1.60-9.el7 will be installed
--> Processing Dependency: perl(Business::ISBN) for package: perl-URI-1.60-9.el7.noarch
---> Package perl-WWW-RobotRules.noarch 0:6.02-5.el7 will be installed
--> Running transaction check
---> Package mailcap.noarch 0:2.1.41-2.el7 will be installed
---> Package perl-Business-ISBN.noarch 0:2.06-2.el7 will be installed
--> Processing Dependency: perl(Business::ISBN::Data) >= 20120719.001 for package: perl-Business-ISBN-2.06-2.el7.noarch
---> Package perl-Compress-Raw-Zlib.x86_64 1:2.061-4.el7 will be installed
---> Package perl-Digest.noarch 0:1.17-245.el7 will be installed
---> Package perl-HTML-Tagset.noarch 0:3.20-15.el7 will be installed
---> Package perl-IO-Compress.noarch 0:2.061-2.el7 will be installed
--> Processing Dependency: perl(Compress::Raw::Bzip2) >= 2.061 for package: perl-IO-Compress-2.061-2.el7.noarch
---> Package perl-IO-HTML.noarch 0:1.00-2.el7 will be installed
---> Package perl-IO-Socket-IP.noarch 0:0.21-5.el7 will be installed
---> Package perl-IO-Socket-SSL.noarch 0:1.94-7.el7 will be installed
--> Processing Dependency: perl-Net-SSLeay >= 1.55-5 for package: perl-IO-Socket-SSL-1.94-7.el7.noarch
--> Processing Dependency: perl(Net::SSLeay) >= 1.21 for package: perl-IO-Socket-SSL-1.94-7.el7.noarch
--> Processing Dependency: perl(Net::SSLeay) for package: perl-IO-Socket-SSL-1.94-7.el7.noarch
--> Processing Dependency: perl(Net::LibIDN) for package: perl-IO-Socket-SSL-1.94-7.el7.noarch
--> Processing Dependency: perl(Mozilla::CA) for package: perl-IO-Socket-SSL-1.94-7.el7.noarch
---> Package perl-TimeDate.noarch 1:2.30-2.el7 will be installed
--> Running transaction check
---> Package perl-Business-ISBN-Data.noarch 0:20120719.001-2.el7 will be installed
---> Package perl-Compress-Raw-Bzip2.x86_64 0:2.061-3.el7 will be installed
---> Package perl-Mozilla-CA.noarch 0:20130114-5.el7 will be installed
---> Package perl-Net-LibIDN.x86_64 0:0.12-15.el7 will be installed
---> Package perl-Net-SSLeay.x86_64 0:1.55-6.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package                     Arch       Version                  Repository
                                                                           Size
================================================================================
Installing:
 arp-scan                    x86_64     1.9.2-1.el7              epel     336 k
Installing for dependencies:
 mailcap                     noarch     2.1.41-2.el7             base      31 k
 perl-Business-ISBN          noarch     2.06-2.el7               base      25 k
 perl-Business-ISBN-Data     noarch     20120719.001-2.el7       base      24 k
 perl-Compress-Raw-Bzip2     x86_64     2.061-3.el7              base      32 k
 perl-Compress-Raw-Zlib      x86_64     1:2.061-4.el7            base      57 k
 perl-Digest                 noarch     1.17-245.el7             base      23 k
 perl-Digest-MD5             x86_64     2.52-3.el7               base      30 k
 perl-Encode-Locale          noarch     1.03-5.el7               base      16 k
 perl-File-Listing           noarch     6.04-7.el7               base      13 k
 perl-HTML-Parser            x86_64     3.71-4.el7               base     115 k
 perl-HTML-Tagset            noarch     3.20-15.el7              base      18 k
 perl-HTTP-Cookies           noarch     6.01-5.el7               base      26 k
 perl-HTTP-Daemon            noarch     6.01-8.el7               base      21 k
 perl-HTTP-Date              noarch     6.02-8.el7               base      14 k
 perl-HTTP-Message           noarch     6.06-6.el7               base      82 k
 perl-HTTP-Negotiate         noarch     6.01-5.el7               base      17 k
 perl-IO-Compress            noarch     2.061-2.el7              base     260 k
 perl-IO-HTML                noarch     1.00-2.el7               base      23 k
 perl-IO-Socket-IP           noarch     0.21-5.el7               base      36 k
 perl-IO-Socket-SSL          noarch     1.94-7.el7               base     115 k
 perl-LWP-MediaTypes         noarch     6.02-2.el7               base      24 k
 perl-Mozilla-CA             noarch     20130114-5.el7           base      11 k
 perl-Net-HTTP               noarch     6.06-2.el7               base      29 k
 perl-Net-LibIDN             x86_64     0.12-15.el7              base      28 k
 perl-Net-SSLeay             x86_64     1.55-6.el7               base     285 k
 perl-TimeDate               noarch     1:2.30-2.el7             base      52 k
 perl-URI                    noarch     1.60-9.el7               base     106 k
 perl-WWW-RobotRules         noarch     6.02-5.el7               base      18 k
 perl-libwww-perl            noarch     6.05-2.el7               base     205 k

Transaction Summary
================================================================================
Install  1 Package (+29 Dependent packages)

Total download size: 2.0 M
Installed size: 5.0 M
Is this ok [y/d/N]: y
Downloading packages:
(1/30): perl-Business-ISBN-Data-20120719.001-2.el7.noarch. |  24 kB   00:00
(2/30): perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64.rpm     |  32 kB   00:00
(3/30): perl-Business-ISBN-2.06-2.el7.noarch.rpm           |  25 kB   00:00
(4/30): perl-Digest-1.17-245.el7.noarch.rpm                |  23 kB   00:00
(5/30): perl-Encode-Locale-1.03-5.el7.noarch.rpm           |  16 kB   00:00
(6/30): perl-Digest-MD5-2.52-3.el7.x86_64.rpm              |  30 kB   00:00
(7/30): perl-File-Listing-6.04-7.el7.noarch.rpm            |  13 kB   00:00
(8/30): perl-HTML-Tagset-3.20-15.el7.noarch.rpm            |  18 kB   00:00
(9/30): perl-Compress-Raw-Zlib-2.061-4.el7.x86_64.rpm      |  57 kB   00:00
(10/30): perl-HTML-Parser-3.71-4.el7.x86_64.rpm            | 115 kB   00:00
(11/30): perl-HTTP-Cookies-6.01-5.el7.noarch.rpm           |  26 kB   00:00
(12/30): perl-HTTP-Daemon-6.01-8.el7.noarch.rpm            |  21 kB   00:00
(13/30): perl-HTTP-Date-6.02-8.el7.noarch.rpm              |  14 kB   00:00
(14/30): perl-HTTP-Message-6.06-6.el7.noarch.rpm           |  82 kB   00:00
(15/30): perl-HTTP-Negotiate-6.01-5.el7.noarch.rpm         |  17 kB   00:00
(16/30): perl-IO-Compress-2.061-2.el7.noarch.rpm           | 260 kB   00:00
(17/30): perl-IO-HTML-1.00-2.el7.noarch.rpm                |  23 kB   00:00
(18/30): perl-LWP-MediaTypes-6.02-2.el7.noarch.rpm         |  24 kB   00:00
(19/30): perl-IO-Socket-SSL-1.94-7.el7.noarch.rpm          | 115 kB   00:00
(20/30): perl-Net-HTTP-6.06-2.el7.noarch.rpm               |  29 kB   00:00
(21/30): perl-Mozilla-CA-20130114-5.el7.noarch.rpm         |  11 kB   00:00
(22/30): perl-IO-Socket-IP-0.21-5.el7.noarch.rpm           |  36 kB   00:00
(23/30): perl-Net-LibIDN-0.12-15.el7.x86_64.rpm            |  28 kB   00:00
(24/30): perl-URI-1.60-9.el7.noarch.rpm                    | 106 kB   00:00
(25/30): perl-WWW-RobotRules-6.02-5.el7.noarch.rpm         |  18 kB   00:00
(26/30): perl-TimeDate-2.30-2.el7.noarch.rpm               |  52 kB   00:00
(27/30): perl-libwww-perl-6.05-2.el7.noarch.rpm            | 205 kB   00:00
(28/30): perl-Net-SSLeay-1.55-6.el7.x86_64.rpm             | 285 kB   00:00
(29/30): mailcap-2.1.41-2.el7.noarch.rpm                   |  31 kB   00:02
warning: /var/cache/yum/x86_64/7/epel/packages/arp-scan-1.9.2-1.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY
Public key for arp-scan-1.9.2-1.el7.x86_64.rpm is not installed
(30/30): arp-scan-1.9.2-1.el7.x86_64.rpm                   | 336 kB   00:03
--------------------------------------------------------------------------------
Total                                              535 kB/s | 2.0 MB  00:03
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Importing GPG key 0x352C64E5:
 Userid     : "Fedora EPEL (7) <[email protected]>"
 Fingerprint: 91e9 7d7c 4a5e 96f1 7f3e 888f 6a2f aea2 352c 64e5
 Package    : epel-release-7-11.noarch (@extras)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : 1:perl-Compress-Raw-Zlib-2.061-4.el7.x86_64                 1/30
  Installing : perl-IO-Socket-IP-0.21-5.el7.noarch                         2/30
  Installing : perl-Encode-Locale-1.03-5.el7.noarch                        3/30
  Installing : perl-HTML-Tagset-3.20-15.el7.noarch                         4/30
  Installing : perl-Digest-1.17-245.el7.noarch                             5/30
  Installing : perl-Digest-MD5-2.52-3.el7.x86_64                           6/30
  Installing : perl-Net-LibIDN-0.12-15.el7.x86_64                          7/30
  Installing : 1:perl-TimeDate-2.30-2.el7.noarch                           8/30
  Installing : perl-HTTP-Date-6.02-8.el7.noarch                            9/30
  Installing : perl-File-Listing-6.04-7.el7.noarch                        10/30
  Installing : perl-Net-SSLeay-1.55-6.el7.x86_64                          11/30
  Installing : perl-Business-ISBN-Data-20120719.001-2.el7.noarch          12/30
  Installing : perl-Business-ISBN-2.06-2.el7.noarch                       13/30
  Installing : perl-URI-1.60-9.el7.noarch                                 14/30
  Installing : perl-WWW-RobotRules-6.02-5.el7.noarch                      15/30
  Installing : perl-Mozilla-CA-20130114-5.el7.noarch                      16/30
  Installing : perl-IO-Socket-SSL-1.94-7.el7.noarch                       17/30
  Installing : perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64                 18/30
  Installing : perl-IO-Compress-2.061-2.el7.noarch                        19/30
  Installing : perl-Net-HTTP-6.06-2.el7.noarch                            20/30
  Installing : perl-IO-HTML-1.00-2.el7.noarch                             21/30
  Installing : mailcap-2.1.41-2.el7.noarch                                22/30
  Installing : perl-LWP-MediaTypes-6.02-2.el7.noarch                      23/30
  Installing : perl-HTTP-Message-6.06-6.el7.noarch                        24/30
  Installing : perl-HTTP-Cookies-6.01-5.el7.noarch                        25/30
  Installing : perl-HTML-Parser-3.71-4.el7.x86_64                         26/30
  Installing : perl-HTTP-Negotiate-6.01-5.el7.noarch                      27/30
  Installing : perl-HTTP-Daemon-6.01-8.el7.noarch                         28/30
  Installing : perl-libwww-perl-6.05-2.el7.noarch                         29/30
  Installing : arp-scan-1.9.2-1.el7.x86_64                                30/30
  Verifying  : perl-Business-ISBN-2.06-2.el7.noarch                        1/30
  Verifying  : mailcap-2.1.41-2.el7.noarch                                 2/30
  Verifying  : perl-HTTP-Cookies-6.01-5.el7.noarch                         3/30
  Verifying  : perl-IO-HTML-1.00-2.el7.noarch                              4/30
  Verifying  : perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64                  5/30
  Verifying  : perl-HTML-Parser-3.71-4.el7.x86_64                          6/30
  Verifying  : perl-LWP-MediaTypes-6.02-2.el7.noarch                       7/30
  Verifying  : perl-WWW-RobotRules-6.02-5.el7.noarch                       8/30
  Verifying  : perl-Digest-MD5-2.52-3.el7.x86_64                           9/30
  Verifying  : perl-HTTP-Date-6.02-8.el7.noarch                           10/30
  Verifying  : perl-HTTP-Message-6.06-6.el7.noarch                        11/30
  Verifying  : perl-Encode-Locale-1.03-5.el7.noarch                       12/30
  Verifying  : perl-IO-Socket-SSL-1.94-7.el7.noarch                       13/30
  Verifying  : perl-Mozilla-CA-20130114-5.el7.noarch                      14/30
  Verifying  : arp-scan-1.9.2-1.el7.x86_64                                15/30
  Verifying  : perl-Business-ISBN-Data-20120719.001-2.el7.noarch          16/30
  Verifying  : perl-IO-Socket-IP-0.21-5.el7.noarch                        17/30
  Verifying  : perl-Net-SSLeay-1.55-6.el7.x86_64                          18/30
  Verifying  : perl-HTTP-Negotiate-6.01-5.el7.noarch                      19/30
  Verifying  : 1:perl-Compress-Raw-Zlib-2.061-4.el7.x86_64                20/30
  Verifying  : perl-libwww-perl-6.05-2.el7.noarch                         21/30
  Verifying  : perl-HTTP-Daemon-6.01-8.el7.noarch                         22/30
  Verifying  : perl-IO-Compress-2.061-2.el7.noarch                        23/30
  Verifying  : perl-Net-HTTP-6.06-2.el7.noarch                            24/30
  Verifying  : 1:perl-TimeDate-2.30-2.el7.noarch                          25/30
  Verifying  : perl-Net-LibIDN-0.12-15.el7.x86_64                         26/30
  Verifying  : perl-Digest-1.17-245.el7.noarch                            27/30
  Verifying  : perl-HTML-Tagset-3.20-15.el7.noarch                        28/30
  Verifying  : perl-URI-1.60-9.el7.noarch                                 29/30
  Verifying  : perl-File-Listing-6.04-7.el7.noarch                        30/30

Installed:
  arp-scan.x86_64 0:1.9.2-1.el7

Dependency Installed:
  mailcap.noarch 0:2.1.41-2.el7
  perl-Business-ISBN.noarch 0:2.06-2.el7
  perl-Business-ISBN-Data.noarch 0:20120719.001-2.el7
  perl-Compress-Raw-Bzip2.x86_64 0:2.061-3.el7
  perl-Compress-Raw-Zlib.x86_64 1:2.061-4.el7
  perl-Digest.noarch 0:1.17-245.el7
  perl-Digest-MD5.x86_64 0:2.52-3.el7
  perl-Encode-Locale.noarch 0:1.03-5.el7
  perl-File-Listing.noarch 0:6.04-7.el7
  perl-HTML-Parser.x86_64 0:3.71-4.el7
  perl-HTML-Tagset.noarch 0:3.20-15.el7
  perl-HTTP-Cookies.noarch 0:6.01-5.el7
  perl-HTTP-Daemon.noarch 0:6.01-8.el7
  perl-HTTP-Date.noarch 0:6.02-8.el7
  perl-HTTP-Message.noarch 0:6.06-6.el7
  perl-HTTP-Negotiate.noarch 0:6.01-5.el7
  perl-IO-Compress.noarch 0:2.061-2.el7
  perl-IO-HTML.noarch 0:1.00-2.el7
  perl-IO-Socket-IP.noarch 0:0.21-5.el7
  perl-IO-Socket-SSL.noarch 0:1.94-7.el7
  perl-LWP-MediaTypes.noarch 0:6.02-2.el7
  perl-Mozilla-CA.noarch 0:20130114-5.el7
  perl-Net-HTTP.noarch 0:6.06-2.el7
  perl-Net-LibIDN.x86_64 0:0.12-15.el7
  perl-Net-SSLeay.x86_64 0:1.55-6.el7
  perl-TimeDate.noarch 1:2.30-2.el7
  perl-URI.noarch 0:1.60-9.el7
  perl-WWW-RobotRules.noarch 0:6.02-5.el7
  perl-libwww-perl.noarch 0:6.05-2.el7

Complete!
[root@ccontrol ~]#
Step 2 : Perform arp scan
Scan the ARP by running command line bellow
[maswachid@ccontrol ~]$ sudo arp-scan --interface ens32 -l
Interface: ens32, datalink type: EN10MB (Ethernet)
Starting arp-scan 1.9.2 with 256 hosts (http://www.nta-monitor.com/tools-resources/security-tools/arp-scan/)
192.168.1.1    00:b4:00:80:d2:9c       (Unknown)
192.168.1.2    40:f2:e9:bc:24:10       IBM
192.168.1.3    a0:36:9f:82:18:cc       Intel Corporate
192.168.1.4    40:f2:e9:bc:26:28       IBM
192.168.1.5    a0:36:9f:82:46:98       Intel Corporate
192.168.1.6    34:40:b5:9e:24:88       IBM
192.168.1.7    34:40:b5:9e:20:9c       IBM
192.168.1.8    5c:f3:fc:4c:2f:c4       IBM Corp
192.168.1.9    5c:f3:fc:4c:bc:d8       IBM Corp
192.168.1.10   00:0c:29:77:c1:86       VMware, Inc.
192.168.1.11   00:0c:29:b6:d9:77       VMware, Inc.
192.168.1.80   00:0c:29:5f:5d:d5       VMware, Inc.
192.168.1.80   00:50:56:88:ad:77       VMware, Inc. (DUP: 2)
192.168.1.81   00:0c:29:0b:c8:25       VMware, Inc.
192.168.1.82   00:0c:29:3e:88:49       VMware, Inc.
192.168.1.83   00:0c:29:f0:45:f5       VMware, Inc.

From figure above you can find that IP 192.168.1.80 is duplicate, the sign is (DUP: 2) it is mean that there are 2 interface that use the same IP address, 

Step 3 : Perform arp ping
You can use arping to test the IP address and mac address, the arping utility performs an action similar to ping command, but at the Ethernet layer. You can send ARP REQUEST to a neighbor host / computers.
[maswachid@ccontrol ~]$ sudo arping -I ens32 -c 2 192.168.1.82
ARPING 192.168.1.82 from 192.168.72.90 ens32
Unicast reply from 192.168.1.82 [00:0C:29:3E:88:49]  0.921ms
Unicast reply from 192.168.1.82 [00:0C:29:3E:88:49]  0.893ms
Sent 2 probes (1 broadcast(s))
Received 2 response(s)
[maswachid@ccontrol ~]$ sudo arping -I ens32 -c 2 192.168.1.80
ARPING 192.168.1.80 from 192.168.1.90 ens32
Unicast reply from 192.168.1.80 [00:0C:29:5F:5D:D5]  0.941ms
Unicast reply from 192.168.1.80 [00:50:56:88:AD:77]  1.031ms
Unicast reply from 192.168.1.80 [00:50:56:88:AD:77]  0.862ms
Sent 2 probes (1 broadcast(s))
Received 3 response(s)

-I ens32 : Specify network interface i.e. name of network device where to send ARP REQUEST packets. This option is required.

-c 2           :  Stop after sending 2 ARP REQUEST packets

From figure above you can see the different, normal IP address replay ping with same mac address, duplicate IP address reply ping with some mac address

Step 4 : Conclusions
From figure above we know that 192.168.1.80 is conflic because when we perform arp-scan it appears twice and when we perform arp ping it replay form different mac