Home

Awesome

Sheer Heart Attack GitHub release

sheer-heart-attack is a debugging tool that can execute any command on process/host metrics trigger.

screencast

Features

Quick Start

This is the recommended usage.

root@kilr_q:~# source <(curl -sL https://raw.githubusercontent.com/k1LoW/sheer-heart-attack/main/use)
You can use `sheer-heart-attack` command in this session.
root@kilr_q:~# sheer-heart-attack launch

In the case of fish :fish:

root@kilr_q:~# curl -sL https://git.io/sheer-heart-attack-fish | source
You can use `sheer-heart-attack` command in this session.
root@kilr_q:~# sheer-heart-attack launch

Install

manually:

Download binany from releases page

go get:

go get github.com/k1LoW/sheer-heart-attack

Usage

Just execute sheer-heart-attack launch.

Launch Options (Flags):

OptionDefaultPurpose
pidPID of the process.
thresholdcpu > 5 || mem > 10Threshold conditions.
interval5sInterval of checking if the threshold exceeded.
attempts1Maximum number of attempts continuously exceeding the threshold.
commandCommand to execute when the maximum number of attempts is exceeded.
times1Maximum number of command executions. If times < 1, track and execute until timeout.
timeout1dayTimeout of tracking.
slack-channelSlack channel to notify.
slack-mentionSlack mention. (@here or user_id @UXXXXXXXXX)

Set threshold using operators

The following operators can be used to set the threshold:

+, -, *, /, ==, !=, <, >, <=, >=, not, and, or, !, &&, ||

For example, you can set the threshold as follows

Slack Notification

sheer-heart-attack find and use Slack Incomming Webhook URL via envirionment variables ( SLACK_INCOMMING_WEBHOOK_URL, SLACK_WEBHOOK_URL, SLACK_URL )

slack

Support Metrics

Metric
proc_cpuPercentage of the CPU time the process uses (percent).
proc_memPercentage of the total RAM the process uses (percent).
proc_rssNon-swapped physical memory the process uses (bytes).
proc_vmsAmount of virtual memory the process uses (bytes).
proc_swapAmount of memory that has been swapped out to disk the process uses (bytes).
proc_open_filesAmount of files and file discripters opend by the process. linux only
cpuPercentage of cpu used.
memPercentage of RAM used.
swapAmount of memory that has been swapped out to disk (bytes).
userPercentage of CPU utilization that occurred while executing at the user level.
systemPercentage of CPU utilization that occurred while executing at the system level.
idlePercentage of time that CPUs were idle and the system did not have an outstanding disk I/O request.
nicePercentage of CPU utilization that occurred while executing at the user level with nice priority.
iowaitPercentage of time that CPUs were idle during which the system had an outstanding disk I/O request.
irqPercentage of time spent by CPUs to service hardware interrupts.
softirqPercentage of time spent by CPUs to service software interrupts.
stealPercentage of time spent in involuntary wait by the virtual CPUs while the hypervisor was servicing another virtual processor.
guestPercentage of time spent by CPUs to run a virtual processor.
guest_nicePercentage of time spent by CPUs to run a virtual processor with nice priority.
load1Load avarage for 1 minute.
load5Load avarage for 5 minutes.
load15Load avarage for 15 minutes.

Alternatives