script_exporter

Shell script prometheus exporter

  • 所有者: adhocteam/script_exporter
  • 平台:
  • 許可證: MIT License
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

Script Exporter

GitHub: https://github.com/adhocteam/script_exporter

Prometheus exporter written to execute and collect metrics on script exit status
and duration. Designed to allow the execution of probes where support for the
probe type wasn't easily configured with the Prometheus blackbox exporter.

Minimum supported Go Version: 1.7.3

Sample Configuration

scripts:
  - name: success
    script: sleep 5

  - name: failure
    script: sleep 2 && exit 1

  - name: timeout
    script: sleep 5
    timeout: 1

Running

You can run via docker with:

docker run -d -p 9172:9172 --name script-exporter \
  -v `pwd`/config.yml:/etc/script-exporter/config.yml:ro \
  adhocteam/script-exporter:master \
  -config.file=/etc/script-exporter/config.yml \
  -web.listen-address=":9172" \
  -web.telemetry-path="/metrics" \
  -config.shell="/bin/sh"

You'll need to customize the docker image or use the binary on the host system
to install tools such as curl for certain scenarios.

Probing

To return the script exporter internal metrics exposed by the default Prometheus
handler:

$ curl http://localhost:9172/metrics

To execute a script, use the name parameter to the /probe endpoint:

$ curl http://localhost:9172/probe?name=failure

script_duration_seconds{script="failure"} 2.008337
script_success{script="failure"} 0

A regular expression may be specified with the pattern paremeter:

$ curl http://localhost:9172/probe?pattern=.*

script_duration_seconds{script="timeout"} 1.005727
script_success{script="timeout"} 0
script_duration_seconds{script="failure"} 2.015021
script_success{script="failure"} 0
script_duration_seconds{script="success"} 5.013670
script_success{script="success"} 1

Design

YMMV if you're attempting to execute a large number of scripts, and you'd be
better off creating an exporter that can handle your protocol without launching
shell processes for each scrape.

主要指標

概覽
名稱與所有者adhocteam/script_exporter
主編程語言Go
編程語言Makefile (語言數: 3)
平台
許可證MIT License
所有者活动
創建於2016-11-16 17:03:31
推送於2023-09-13 10:50:37
最后一次提交2023-01-05 13:45:53
發布數5
最新版本名稱v1.2.0 (發布於 )
第一版名稱v0.0.1 (發布於 )
用户参与
星數195
關注者數6
派生數51
提交數37
已啟用問題?
問題數18
打開的問題數9
拉請求數10
打開的拉請求數7
關閉的拉請求數25
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?