-
Notifications
You must be signed in to change notification settings - Fork 56
Building sysdig
Below versions of Sysdig are available in respective distributions at the time of creation of these build instructions:
- Ubuntu 18.04 has
0.24.1 - Ubuntu 20.04 has
0.26.4 - Ubuntu 20.10 has
0.26.7 - SLES 12 SP5 has
0.15.1
The instructions provided below specify the steps to build Sysdig version 0.27.1 on Linux on IBM Z for following distributions:
- RHEL (7.8, 7.9, 8.1, 8.2, 8.3)
- SLES (12 SP5, 15 SP2)
- Ubuntu (18.04, 20.04, 20.10)
General Notes:
- When following the steps below please use a standard permission user unless otherwise specified.
- A directory
/<source_root>/will be referred to in these instructions, this is a temporary writable directory anywhere you'd like to place it.
If you want to build Sysdig using manual steps, go to step 2.
Use the following commands to build Sysdig using the build script. Please make sure you have wget installed.
wget https://raw.githubusercontent.com/linux-on-ibm-z/scripts/master/Sysdig/0.27.1/build_sysdig.sh
# Run bash build_sysdig.sh
bash build_sysdig.sh [Provide -t option for executing build with tests]
In case of error, check logs for more details or go to Step 2 to follow manual build steps.
-
RHEL (7.8, 7.9)
sudo yum install -y devtoolset-7 devtoolset-7-elfutils-libelf-devel cmake automake curl \ glibc-static libcurl-devel git pkgconfig wget patch kernel-devel-$(uname -r) kmod #switch to GCC 7 source /opt/rh/devtoolset-7/enable
-
RHEL (8.1, 8.2, 8.3)
sudo yum install -y gcc gcc-c++ git make cmake autoconf automake pkg-config libtool wget patch \ curl elfutils-libelf-devel kernel-devel-$(uname -r) glibc-static libstdc++-static kmod libarchive -
SLES (12 SP5)
sudo zypper install -y gcc7 gcc7-c++ git cmake automake autoconf libtool zlib-devel wget pkg-config \ curl patch glibc-devel-static libelf-devel "kernel-default-devel=$(uname -r | sed 's/-default//g')" kmod #switch to GCC 7 sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-7 40 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 40 sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 40 sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-7 40 -
SLES (15 SP2)
sudo zypper install -y gcc gcc-c++ git cmake patch automake autoconf libtool wget pkg-config \ curl glibc-devel-static libelf-devel "kernel-default-devel=$(uname -r | sed 's/-default//g')" kmod -
Ubuntu (18.04)
sudo apt-get update sudo apt-get install -y git cmake build-essential pkg-config autoconf \ wget curl patch libtool libelf-dev linux-headers-$(uname -r) kmod -
Ubuntu (20.04, 20.10)
sudo apt-get update sudo apt-get install -y git cmake build-essential pkg-config autoconf wget patch libtool \ curl libelf-dev linux-headers-$(uname -r) kmod libgrpc++-dev protobuf-compiler-grpc -
Install CMake v3.7.2 (Only for RHEL 7.x)
cd $SOURCE_ROOT wget https://cmake.org/files/v3.7/cmake-3.7.2.tar.gz tar xzf cmake-3.7.2.tar.gz cd cmake-3.7.2 ./configure --prefix=/usr/ ./bootstrap --system-curl --parallel=16 make -j16 sudo make install export PATH=/usr/local/bin:$PATH cmake --version
export SOURCE_ROOT=/<source_root>/
cd $SOURCE_ROOT
git clone https://github.com/draios/sysdig.git
cd sysdig
git checkout 0.27.1
mkdir build cd $SOURCE_ROOT/sysdig/build-
Ubuntu 20.04, 20.10
cmake -DUSE_BUNDLED_PROTOBUF=Off -DPROTOBUF_PREFIX=/usr/lib/s390x-linux-gnu \ -DUSE_BUNDLED_GRPC=Off -DGRPC_PREFIX=/usr/lib/s390x-linux-gnu \ .. -DSYSDIG_VERSION=0.27.1 -
RHEL, SLES and Ubuntu 18.04
cmake .. -DSYSDIG_VERSION=0.27.1
make
sudo make install #Unload any existing module
sudo rmmod sysdig-probe || true
#Insert Sysdig kernel module
cd $SOURCE_ROOT/sysdig/build/driver/
sudo insmod sysdig-probe.ko- Run unit tests
cd $SOURCE_ROOT/sysdig/build/ make run-unit-tests
- Validate Sysdig's version
The output should be:
sysdig --version
sysdig version 0.27.1
Note:
- Refer to this for more information on running Sysdig as a non-root user.
The information provided in this article is accurate at the time of writing, but on-going development in the open-source projects involved may make the information incorrect or obsolete. Please open issue or contact us on IBM Z Community if you have any questions or feedback.