sysdig
Linux system exploration and troubleshooting tool with first class support for containers
Top Related Projects
Cloud Native Runtime Security
Monitoring, visualisation & management for Docker & Kubernetes
X-Ray Vision for your infrastructure!
Glances an Eye on your system. A top/htop alternative for GNU/Linux, BSD, Mac OS and Windows operating systems.
Analyzes resource usage and performance characteristics of running containers.
BCC - Tools for BPF-based Linux IO analysis, networking, monitoring, and more
Quick Overview
Sysdig is an open-source system-level exploration and troubleshooting tool for Linux. It captures system calls and other OS events using a Linux kernel module and provides a powerful command-line interface for analyzing the collected data. Sysdig can be used for system monitoring, security, and forensics.
Pros
- Comprehensive system visibility with minimal overhead
- Powerful filtering and output formatting capabilities
- Extensible through Lua scripts (chisels)
- Integrates well with containers and Kubernetes environments
Cons
- Requires root access for installation and usage
- Learning curve for advanced features and syntax
- Limited support for non-Linux operating systems
- Can generate large amounts of data, requiring careful management
Getting Started
To install Sysdig on a Linux system:
curl -s https://s3.amazonaws.com/download.draios.com/stable/install-sysdig | sudo bash
Basic usage examples:
- Capture all system events:
sudo sysdig
- Filter events for a specific process:
sudo sysdig proc.name=nginx
- View top processes by CPU usage:
sudo sysdig -c topprocs_cpu
- Analyze container activity:
sudo sysdig -pc container.name!=host
For more advanced usage and configuration options, refer to the official Sysdig documentation.
Competitor Comparisons
Cloud Native Runtime Security
Pros of Falco
- Focused on security and threat detection with pre-defined rules
- Easier to set up and use for security monitoring
- Better integration with container orchestration platforms like Kubernetes
Cons of Falco
- More limited in scope compared to Sysdig's broader system visibility
- Less flexibility for custom data collection and analysis
- Smaller community and ecosystem
Code Comparison
Falco rule example:
- rule: Unauthorized Process
desc: Detect unauthorized process execution
condition: spawned_process and not proc.name in (authorized_processes)
output: "Unauthorized process %proc.name started"
priority: WARNING
Sysdig system call capture example:
#include <sysdig/sysdig.h>
int main(int argc, char **argv)
{
scap_t* handle = scap_open_live(NULL);
scap_evt* ev;
while(scap_next(handle, &ev) == SCAP_SUCCESS) {
// Process system call event
}
}
Both projects offer powerful system monitoring capabilities, but Falco is more focused on security-specific use cases, while Sysdig provides broader system visibility and analysis tools. Falco excels in container environments and offers easier setup for security monitoring, while Sysdig provides more flexibility for custom data collection and analysis across various use cases.
Monitoring, visualisation & management for Docker & Kubernetes
Pros of Scope
- More user-friendly web UI for visualizing container and microservice interactions
- Better suited for real-time monitoring of containerized environments
- Easier to set up and use for beginners in container monitoring
Cons of Scope
- Less comprehensive system-level data collection compared to Sysdig
- Limited support for non-containerized environments
- Fewer advanced features for in-depth performance analysis
Code Comparison
Scope (JavaScript):
app.get('/api/topology', function(req, res) {
const topology = getTopology();
res.json(topology);
});
Sysdig (C):
int sysdig_init(void)
{
return scap_open(&g_syscall_evt_source, NULL, NULL);
}
The code snippets highlight the different approaches:
- Scope focuses on API endpoints for topology data
- Sysdig emphasizes low-level system call interception
Both tools serve different purposes in the container monitoring ecosystem. Scope excels in providing an intuitive visualization of container relationships, while Sysdig offers more comprehensive system-level monitoring and analysis capabilities. The choice between them depends on specific monitoring needs and the level of detail required for the target environment.
X-Ray Vision for your infrastructure!
Pros of Netdata
- Lightweight and efficient, with minimal system overhead
- Real-time, high-resolution metrics collection and visualization
- Easy to install and configure, with automatic detection of system services
Cons of Netdata
- Limited deep system-level analysis compared to Sysdig
- Fewer advanced features for container and Kubernetes monitoring
- Less comprehensive security and compliance capabilities
Code Comparison
Netdata configuration example:
[global]
update every = 1
memory mode = ram
history = 3600
Sysdig configuration example:
sysdig:
capture_file: /tmp/sysdig-capture.scap
snaplen: 80
filter: container.id != host
Both projects use YAML for configuration, but Sysdig's configuration tends to be more complex due to its broader feature set. Netdata's configuration is generally simpler and more focused on metrics collection and visualization.
Netdata excels in providing an easy-to-use, real-time monitoring solution with a user-friendly web interface. Sysdig offers more advanced features for system-level analysis, container monitoring, and security, but may require more setup and configuration.
Glances an Eye on your system. A top/htop alternative for GNU/Linux, BSD, Mac OS and Windows operating systems.
Pros of Glances
- Cross-platform support (Linux, macOS, Windows)
- Web-based interface for remote monitoring
- Extensive plugin system for customization
Cons of Glances
- Less detailed system-level information compared to Sysdig
- Limited container monitoring capabilities
- Fewer advanced features for performance analysis
Code Comparison
Glances (Python):
def get_stats():
stats = {}
stats['cpu'] = psutil.cpu_percent(interval=1)
stats['memory'] = psutil.virtual_memory().percent
return stats
Sysdig (C):
int sysdig_next_event(scap_t* handle, OUT scap_evt** pevent, OUT uint16_t* pcpuid)
{
return scap_next(handle, pevent, pcpuid);
}
Glances is written in Python, making it more accessible for scripting and customization. Sysdig is primarily written in C, offering lower-level access to system information and potentially better performance for intensive monitoring tasks.
Both tools provide valuable system monitoring capabilities, but Sysdig offers more advanced features for in-depth analysis and container monitoring, while Glances excels in ease of use and cross-platform support.
Analyzes resource usage and performance characteristics of running containers.
Pros of cAdvisor
- Lightweight and easy to deploy, especially in containerized environments
- Provides a web UI for real-time monitoring and visualization
- Integrates well with Kubernetes and other container orchestration platforms
Cons of cAdvisor
- Limited to container-level metrics, less comprehensive system-wide monitoring
- Fewer advanced features compared to Sysdig's extensive capabilities
- May require additional tools for complete infrastructure monitoring
Code Comparison
cAdvisor (Go):
func NewContainerHandler(name string, inHostNamespace bool) (ContainerHandler, error) {
if inHostNamespace {
return newRootContainerHandler(name)
}
return newDockerContainerHandler(name)
}
Sysdig (C):
int32_t scap_open(scap_open_args* args, scap_t** phandle, char* error)
{
scap_t* handle = NULL;
int32_t res;
res = scap_open_live(args, &handle, error);
if(res != SCAP_SUCCESS)
{
return res;
}
*phandle = handle;
return SCAP_SUCCESS;
}
Both projects focus on system monitoring, but cAdvisor is more specialized for containers, while Sysdig offers broader system-wide observability. cAdvisor is written in Go, making it more accessible for cloud-native environments, while Sysdig's C implementation provides lower-level system access and potentially better performance for complex monitoring scenarios.
BCC - Tools for BPF-based Linux IO analysis, networking, monitoring, and more
Pros of BCC
- More flexible and extensible for custom tracing and analysis
- Leverages eBPF for efficient kernel-level instrumentation
- Supports multiple programming languages (Python, Lua, C++)
Cons of BCC
- Steeper learning curve, requires more low-level knowledge
- Limited to newer Linux kernels with eBPF support
- Less out-of-the-box functionality compared to Sysdig
Code Comparison
BCC example (Python):
from bcc import BPF
prog = """
int hello(void *ctx) {
bpf_trace_printk("Hello, World!\\n");
return 0;
}
"""
b = BPF(text=prog)
b.attach_kprobe(event="sys_clone", fn_name="hello")
b.trace_print()
Sysdig example (Lua):
-- Capture all file opens
filter = "evt.type=open"
-- Print file name and process name
function on_event()
print(evt.arg.name .. " " .. evt.proc.name)
end
Both tools offer powerful system tracing capabilities, but BCC provides more flexibility for custom analysis at the cost of complexity, while Sysdig offers a more user-friendly approach with pre-built functionality.
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
sysdig
Dig Deeper
Sysdig is a universal system visibility tool with native support for containers:
~$ sysdig
Csysdig is a simple, intuitive, and fully customizable curses UI for sysdig:
~$ csysdig
Getting Started
Run Sysdig in a container:
sudo docker run --rm -i -t --privileged --net=host \
-v /var/run/docker.sock:/host/var/run/docker.sock \
-v /dev:/host/dev \
-v /proc:/host/proc:ro \
-v /boot:/host/boot:ro \
-v /src:/src \
-v /lib/modules:/host/lib/modules:ro \
-v /usr:/host/usr:ro \
-v /etc:/host/etc:ro \
docker.io/sysdig/sysdig
And then run the sysdig
or csysdig
tool from the container shell!
Or install the latest release with a deb
or rpm
package for your distribution.
What does sysdig do and why should I use it?
Sysdig is a simple tool for deep system visibility, with native support for containers.
The best way to understand sysdig is to try it - its super easy! Or here's a quick video introduction to csysdig, the simple, intuitive, and fully customizable curses-based UI for sysdig: https://www.youtube.com/watch?v=UJ4wVrbP-Q8
Far too often, system-level monitoring and troubleshooting still involves logging into a machine with SSH and using a plethora of dated tools with very inconsistent interfaces. And many of these classic Linux tools breakdown completely in containerized environments. Sysdig unites your Linux toolkit into a single, consistent, easy-to-use interface. And sysdig's unique architecture allows deep inspection into containers, right out of the box, without having to instrument the containers themselves in any way.
Sysdig instruments your physical and virtual machines at the OS level by installing into the Linux kernel and capturing system calls and other OS events. Sysdig also makes it possible to create trace files for system activity, similarly to what you can do for networks with tools like tcpdump and Wireshark. This way, problems can be analyzed at a later time, without losing important information. Rich system state is stored in the trace files, so that the captured activity can be put into full context.
Think about sysdig as strace + tcpdump + htop + iftop + lsof + ...awesome sauce.
Documentation / Support
Visit the wiki for full documentation on sysdig and its APIs.
For support using sysdig, please contact the official mailing list.
Join the Community
- Contact the official mailing list for support and to talk with other users
- Follow us on Twitter
- This is our blog. There are many like it, but this one is ours.
- Join our Public Slack channel for sysdig announcements and discussions.
Our code of conduct applies across all our projects and community places.
License Terms
The sysdig userspace programs and supporting code are licensed to you under the Apache 2.0 open source license.
Developer Certification of Origin (DCO)
The Apache 2.0 license tells you what rights you have that are provided by the copyright holder. It is important that the contributor fully understands what rights they are licensing and agrees to them. Sometimes the copyright holder isn't the contributor, such as when the contributor is doing work on behalf of a company.
To make a good faith effort to ensure these criteria are met, we require the Developer Certificate of Origin (DCO) process to be followed.
The DCO is an attestation attached to every contribution made by every developer. In the commit message of the contribution, the developer simply adds a Signed-off-by statement and thereby agrees to the DCO, which you can find at http://developercertificate.org.
DCO Sign-Off Methods
The DCO requires a sign-off message in the following format appear on each commit in the pull request:
Signed-off-by: John Doe <john.doe@sysdig.com>
You have to use your real name (sorry, no pseudonyms or anonymous contributions).
The DCO text can either be manually added to your commit body, or you can add either -s
or --signoff
to your usual git commit
commands. If you are using the GitHub UI to make a change, you can add the sign-off message directly to the commit message when creating the pull request. If you forget to add the sign-off you can also amend a previous commit with the sign-off by running git commit --amend -s
. If you've pushed your changes to GitHub already you'll need to force push your branch after this with git push -f
.
Commercial Support
Interested in a fully supported, fully distributed version of sysdig? Check out Sysdig Monitor!
Open source sysdig is proudly supported by Sysdig Inc.
Interested in what we're doing? Sysdig is hiring.
Reporting a vulnerability
Please refer to SECURITY.md.
Top Related Projects
Cloud Native Runtime Security
Monitoring, visualisation & management for Docker & Kubernetes
X-Ray Vision for your infrastructure!
Glances an Eye on your system. A top/htop alternative for GNU/Linux, BSD, Mac OS and Windows operating systems.
Analyzes resource usage and performance characteristics of running containers.
BCC - Tools for BPF-based Linux IO analysis, networking, monitoring, and more
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot