百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
S

stylus

> 编程语言
开源

家用基础设施轻量级状态页面

331 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

家用基础设施轻量级状态页面

stylus

Stylus (stylish + status) is a lightweight status page for infrastructure and networks. Configure a set of bash scripts that test the various parts of your infrastructure, set up visualizations with minimal configuration, and Stylus will generate you a dashboard for your system.

Running

Stylus is easy to install and run. Docker images are available for the most common platforms.

bash
mkdir ~/stylus
docker run --rm --name stylus -p 8000:8000 -v ~/stylus/:/srv mmastrac/stylus:latest init
docker run --rm --name stylus -p 8000:8000 -v ~/stylus/:/srv mmastrac/stylus:latest

You can also run Stylus without Docker by installing the stylus binary from crates.io.

bash
cargo install stylus
stylus init ~/stylus
stylus run ~/stylus

For more information, see the book page on running Stylus here.

Configuration

Example config.yaml for a Stylus install. This configuration attaches metadata to the various states and has selectors that apply to both and HTML (for a status table) and CSS (for a status SVG image).

yaml
version: 1
server:
  port: 8000
  static: static/

monitor:
  dir: monitor.d/

ui:
  title: Stylus Monitor
  description: Real-time monitoring of your services
  visualizations:
    - title: Monitor List
      description: List of all monitors in table view
      type: table

The monitors are configured by creating a subdirectory in the monitor directory (default monitor.d/) and placing a config.yaml in that monitor subdirectory.

yaml
# ID is optional and will be inferred from the directory
id: router-1
test:
  interval: 60s
  timeout: 30s
  command: test.sh

Test scripts

The test scripts are usually pretty simple. Note that the docker container ships with a number of useful utilities, but you can consider manually installing additional packages (either creating an additional docker container or manually running alpine's apk tool inside the container) to handle your specific cases.

Ping

Stylus has a built-in ping monitor that can be used to monitor network connectivity to a host.

yaml
ping:
  host: 8.8.8.8

cURL

For hosts with services that may be up or down, you may want to use cURL to test whether the service itself is reachable.

bash
#!/bin/bash
set -xeuf -o pipefail
curl --retry 2 --max-time 5 --connect-timeout 5 http://192.168.1.1:9000

SNMP

Stylus has a built-in SNMP monitor that can be used to monitor network devices.

yaml
snmp:
  id: router-{{ index }}
  interval: 60s
  timeout: 30s
  exclude: |
    ifType != 'ethernetCsmacd'
  red: |
    ifOperStatus == "up" and ifSpeed < 1000000000
  target:
    host: 192.168.1.254
    community: public

Advanced techniques

Tools such as jq, sed, or awk can be used for more advanced tests (ie: APIs). If needed, ssh can be used to connect to hosts and remote tests can be executed. snmpwalk and snmpget can also be used to construct tests for devices that speak SNMP.

If you have an existing grafana instance, you can use that as a monitoring source. See the Grafana HTTP API documentation for more information.

Performance

Stylus is very lightweight, both from a processing and memory perspective.

On a Raspberry Pi 1B, Stylus uses less than 1% of CPU while refreshing CSS at a rate of 1/s. On a 2015 MacBook Pro, Stylus uses approximately 0.1% of a single core while actively refreshing.

Stylus uses approxmately 2MB to monitor 15 services on a Raspberry Pi (according to ps_mem).

When not actively monitored, Stylus uses a nearly unmeasurable amount of CPU and is pretty much limited by how heavyweight your test scripts are.

More Screenshots

D3.js example

A basic home network diagram

Historical Note

Note that this project was originally written using deno, but was rewritten in Rust to support Raspberry Pis. The original deno source is available in the deno branch.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rust

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言