Skip to content

Instantly share code, notes, and snippets.

@rushipkar90
Created September 11, 2015 15:17
Show Gist options
  • Save rushipkar90/3776a191adaa860a8c5e to your computer and use it in GitHub Desktop.
Save rushipkar90/3776a191adaa860a8c5e to your computer and use it in GitHub Desktop.
Installing CDP Agent (R1Soft slave)
Installing Agent on CentOS, RHE and Fedora (Refer this URL: http://wiki.r1soft.com/display/CDP3/Installing+Agent+on+CentOS,+RHE+and+Fedora)
Please do the below steps on the slave server on which we would like to install CDP agent
========================================
There two ways by using which you can install the agent
1) Installing Agent Using YUM
2) Install Agent Manually (Using RPM)
1) Installing Agent Using YUM
=>
1.1 Configure YUM Repository
===============
cd /etc/yum.repos.d
vi r1soft.repo
Insert the following text into the file and save the file:
[r1soft]
name=R1Soft Repository Server
baseurl=http://repo.r1soft.com/yum/stable/$basearch/
enabled=1
gpgcheck=0
cat /etc/yum.repos.d/r1soft.repo ---------- To verify what is written to the file.
===============
1.2 Install the Package
===============
yum install r1soft-cdp-enterprise-agent
===============
2) Install Agent Manually (Using RPM)
=>
2.1 Download CDP Agent
===================
Refer this URL [http://wiki.r1soft.com/display/CDP3/Obtaining+Linux+CDP+Enterprise+Agent] for the more details.
===================
2.2 Make Sure You Can Unzip the Download
===================
which unzip ---- This should return an output similar to the following:
# which unzip
/usr/bin/unzip
If it returns the following output, you need to install the unzip utility first: unzip: Command not found.
Run - yum install unzip
===================
2.3 Extract the ZIP File (We recommend creating a temporary directory to which you can extract the contents of the ZIP file.)
===================
mkdir cdp-agent
mv r1soft-enterprise-agent-linux64-3.18.2.zip cdp-agent
cd cdp-agent
unzip r1soft-enterprise-agent-linux64-3.18.2.zip
The archive you have extracted contains two folders: one with .deb packages (in our case, "deb-linux64") and one with .rpm packages ("rpm-linux64"). On RedHat and CentOS, select the .rpm package.
Each folder contains a set of CDP components:
r1soft-setup
r1soft-cdp-enterprise-agent
r1soft-cdp-agent
r1soft-cdp-async-agent-2-6
You will need to install all of them in one step. Use the cd command to go to the folder with the packages (in our case, rpm-linux64) and run the following command:
RPM 32-bit (x86) / RPM 64-bit (x86_64)
rpm -i *.rpm
===================
3. Install CDP Linux Device Driver (Please note before doing this step, you have either done step 1 OR step 2 completely)
=>
3.1 Compiling CDP Kernel Module Against Kernel Headers or Kernel Source Tree
=============
r1soft-setup --test-connection
=============
3.2 Install Kernel Sources
============
yum install kernel-devel
===========
3.3 Verify that the Source Matches Your Running Kernel
===============
In order to proceed to the steps 4, first please make sure that kernel-devel version is equal to kernel version on the server.
uname -a ---- To check all the server details like version, contron panel, architexture, etc.
uname -r ---- To check the current Kernel Version.
rpm -qa |grep kernel ---- It will show up with the o/p window like below
-------------------------------
[root@host5 ~]# rpm -qa |grep kernel
kernel-firmware-2.6.32-531.23.3.lve1.2.66.el6.noarch
dracut-kernel-004-356.el6.noarch
kernel-devel-2.6.32-531.1.2.lve1.2.54.el6.x86_64
kernel-2.6.32-458.23.2.lve1.2.45.el6.x86_64
kernel-2.6.32-531.1.2.lve1.2.54.el6.x86_64
kernel-devel-2.6.32-531.23.3.lve1.2.65.el6.x86_64
kernel-2.6.32-458.18.1.lve1.2.39.el6.x86_64
abrt-addon-kerneloops-2.0.8-26.el6.x86_64
libreport-plugin-kerneloops-2.0.9-21.el6.x86_64
lp-kernelupdate-1.1-1.noarch
kernel-headers-2.6.32-531.23.3.lve1.2.66.el6.x86_64
kernel-devel-2.6.32-531.23.3.lve1.2.66.el6.x86_64
-------------------------------
(Here, make sure that version of kernel-devel = kernel version. If its different, then you will need to either upgrade Kernel version to match the kernel-Devel version or vice-versa.)
If Kernel version <
kernel-devel version then do below
===================
yum -y update kernel ----- To update the kenel version
If above command doesn't find anything to update, then you will need to manually update the kenel version
=>
Download corresponding Kernel RPM for e.g.
cd ~/rpmbuild/SPECS
wget http://vault.centos.org/6.6/updates/Source/SPackages/kernel-2.6.32-504.3.3.el6.src.rpm
rpm -Uvh kernel-2.6.32-504.3.3.el6.src.rpm ---- To install the RPM
rpmbuild -bp --target=$(uname -m) kernel.spec
pico /etc/grub.conf ----- Keep default=0 and reboot the server.
reboot
Once the server is online again, check the kernel version again,
uname -r --- it must be showing updated kernel version
====================
Once the Kernel version matched
kernel-devel version, we can proceed further for the step 4.
4) Build the CDP Kernel Module
=>
To attempt to build the kernel module, run the following command
r1soft-setup --get-module
If module has been compiled and installed successfully, you will see an output similar to the following:
------------------------
Saving kernel module to '/lib/modules/r1soft/hcpdriver-cki-2.6.32-220.4.1.el6.x86_64.ko'
Kernel module is now installed.
Use '/etc/init.d/cdp-agent restart' to load the new driver
------------------------
Run this: lsmod | grep hcpdriver ----- To check module is there or not.
for e.g
------------------
root@server36 [~]# lsmod | grep hcpdriver
hcpdriver 75728 4
------------------
Once done, just restart the cdp agent service by using below command
/etc/init.d/cdp-agent restart
5) Connect this cdp agent or slave to its master backup server
=>
5.1 Open ports on slave server
===================
iptables -A INPUT -p tcp --dport 1167 -j ACCEPT
iptables -A INPUT -p tcp --dport 8080 -j ACCEPT
===================
5.2 Connect Slave to backup master server
=================
r1soft-setup --get-key http://masterserver ip:8080/
for e.g. r1soft-setup --get-key http://162.246.60.104:8080/
=================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment