shell command的可视化工具Sampler

Tool for shell commands execution, visualization and alerting. Configured with a simple YAML file. 

https://sampler.dev/

Build Status Go Report Card

Sampler is a tool for shell commands execution, visualization and alerting. Configured with a simple YAML file.

Why do I need it?

One can sample any dynamic process right from the terminal — observe changes in the database, monitor MQ in-flight messages, trigger a deployment script and get notification when it's done.

If there is a way to get a metric using a shell command, then it can be visualized with Sampler momentarily.

Installation

macOS

HomeBrew:

brew install sampler

MacPorts:

sudo port install sampler

or

sudo curl -Lo /usr/local/bin/sampler https://github.com/sqshq/sampler/releases/download/v1.1.0/sampler-1.1.0-darwin-amd64
sudo chmod +x /usr/local/bin/sampler

Linux

sudo wget https://github.com/sqshq/sampler/releases/download/v1.1.0/sampler-1.1.0-linux-amd64 -O /usr/local/bin/sampler
sudo chmod +x /usr/local/bin/sampler

Note: libasound2-dev system library is required to be installed for Sampler to play a trigger sound tone. Usually the library is in place, but if not - you can install it with your favorite package manager, e.g apt install libasound2-dev

Packaging status

  • Fedora sudo dnf install golang-github-sqshq-sampler (F31+)
  • Arch yay -S sampler

Windows (experimental)

Recommended to use with advanced console emulators, e.g. Cmder

Via Chocolatey

choco install sampler

or

Download .exe

Usage

You specify shell commands, Sampler executes them with a required rate. The output is used for visualization.

Using Sampler is basically a 3-step process:

  • Define your shell commands in a YAML configuration file
  • Run sampler -c config.yml
  • Adjust components size and location on UI

But there are so many monitoring systems already

Sampler is by no means an alternative to full-scale monitoring systems, but rather an easy to setup development tool.

If spinning up and configuring Prometheus with Grafana is complete overkill for you task, Sampler might be the right solution. No servers, no databases, no deploy - you specify shell commands, and it just works.

Then it should be installed on every server I monitor?

No, you can run Sampler on local, but still gather telemetry from multiple remote machines. Any visualization might have init command, where you can ssh to a remote server. See the SSH example

from 

https://github.com/sqshq/sampler