Tuesday, December 14, 2021

KPATCH - live patch load/unloading in running kernel

Prerequisite
=============
apt-get install gcc-7-plugin-dev
yum install python2-devl
yum install python3-devel
yum install yum-utils
Install kpatch
================
git clone https://github.com/dynup/kpatch.git
cd kpatch
source test/integration/lib.sh
kpatch_dependencies
make -j
make install

Run kpatch on kernel src with patch to be applied
==================================================
1.build kernel from source
2.kpatch-build -j20 nvme.patch -s <kernel_src> -c <kernel_src/.config>

This will create kpatch-nvme.ko 

Installing module
==================
kpatch install kpatch-nvme.ko
kpatch list

Loading/unloading kpatch module.
=============================
kpatch load kpatch-nvme.ko
kpatch unload kpatch-nvme.ko

to check build  logs- > tail -f /root/.kpatch/build.log
Good Read -> https://blog.kernelcare.com/live-patching-debian-10-linux-kernel-with-kpatch

Wednesday, July 28, 2021

Pyverbs - RDMA with Python

 


Skip to end of metadata

>>Install following packaes prerequiste for pyverbs compilation in rdma-core

rpm -ivh http://mirror.centos.org/centos/8/PowerTools/x86_64/os/Packages/python3-Cython-0.28.1-3.el8.x86_64.rpm
yum install python3-devel
yum install libudev-devel
yum install pkgconfig valgrind-devel libudev-devel cmake libnl3-devel python3-devel python3-docutils

>>with above package installed , now build rdma-core

./build.sh → with above packages will compile pyvers in rdma-core

>>run sample application present in rdma-core using
PYTHONPATH='/opt/rdma-core/build/python' python3 pyverbs/examples/ib_devices.py


Good resources

https://github.com/linux-rdma/rdma-core/blob/master/Documentation/pyverbs.md

https://webcache.googleusercontent.com/search?q=cache:ichFGVm_EvkJ:https://bugzilla.redhat.com/show_bug.cgi%3Fid%3D1894516+&cd=2&hl=en&ct=clnk&gl=in

Server and DRAC Identification via SNMP

 Sometimes Network IP Changes creates a problem in identifying DRAC Ip or Server IP , with SNMP agent Enable on DRAC and Server


we can use Advance IP Scanner to Quickly Scan network range and with Name appear we can easily get the IP.


Setting Name FOR DRAC

Enable SNMP and Change DNS name


FastLinQ Documentation > Server and DRAC Identification via SNMP > image2021-2-19_22-58-46.png






FastLinQ Documentation > Server and DRAC Identification via SNMP > image2021-2-19_22-55-11.png


Assign DNS IDRAC and enable SNMP Agent






Setting Name on Servers

RHEL/CENTOS

Installation

Execute the command:

yum install -y net-snmp

Add the line below to the configuration file (/etc/snmp/snmpd.conf):

rocommunity public

agentAddress udp:161,udp6:[::1]:161

Start the snmpd service:

systemctl enable snmpd && systemctl start snmpd

Allowing SNMP ports in firewall

Execute the following commands:


firewall-cmd --zone=public --add-port=161/udp --permanent

firewall-cmd --zone=public --add-port=162/udp --permanent

firewall-cmd --reload






CentOS

Installation

Execute the commands:


> yum update

> yum install net-snmp


Configuration

Edit the file: /etc/snmp/snmpd.conf 


Add the line:

rocommunity public

Replace the line below:

view systemview included .1.3.6.1.2.1.25.1.1

with the following line:

view systemview included .1.3.

Restart the SNMP Service:

service snmpd restart

Allowing SNMP ports in Firewall

Execute the commands:


firewall-cmd --zone=public --add-port=161/udp --permanent

firewall-cmd --zone=public --add-port=162/udp --permanent

firewall-cmd --reload


Ubuntu

Installation

Execute the command:


> apt update

> apt install snmpd


Configuration

Edit the file: /etc/snmp/snmpd.conf 


Add the line:

rocommunity public

Comment the line:

#agentAddress udp:127.0.0.1:161

Uncomment the line: 

agentAddress udp:161,udp6:[::1]:161

Restart the SNMP Service:

service snmpd restart

Allowing SNMP ports in firewall

Execute the following commands to allow necessary ports:


ufw allow 161/udp

ufw allow 162/udp




Using Advance IP Scanner  To Scan network 


Now Running IP Scanner will Show the Name of the Server and DRAC


FastLinQ Documentation > Server and DRAC Identification via SNMP > image2021-2-19_23-6-14.png








https://www.site24x7.com/help/admin/adding-a-monitor/configuring-snmp-linux.html


Featured Post

XDP - Getting Started with XDP (Linux)