项目作者: msantos

项目描述 :
stdout to collectd notification
高级语言: C
项目地址: git://github.com/msantos/collectd-prv.git
创建时间: 2017-10-04T14:05:12Z
项目社区:https://github.com/msantos/collectd-prv

开源协议:ISC License

下载


collectd-prv: stdout to collectd notifications

collectd-prv converts stdout from a process into collectd notifications,
optionally acting like a pressure relief valve during event floods.

Usage

Example

  • script
  1. #!/bin/bash
  2. set -o errexit
  3. set -o nounset
  4. set -o pipefail
  5. # plugin = tail
  6. # type = syslog
  7. # limit = 30 lines/second
  8. tail -F $1 | collectd-prv --service="tail/syslog" --limit=30
  1. LoadPlugin exec
  2. <Plugin exec>
  3. Exec "nobody:nobody" "collectd-tail" "/var/log/syslog"
  4. </Plugin>

Build

  1. make
  2. # Recommended: build a static executable using musl
  3. ## sudo apt install musl-dev musl-tools
  4. ./musl-make clean all
  5. # select a different method for process restriction
  6. RESTRICT_PROCESS=null make clean all
  7. # musl: enabling seccomp process restriction requires downloading linux
  8. # kernel headers
  9. export MUSL_INCLUDE=/tmp
  10. git clone https://github.com/sabotage-linux/kernel-headers.git $MUSL_INCLUDE/kernel-headers
  11. ./musl-make

Process Restrictions

Options

-s, —service plugin/type
: collectd service (default: stdout/prv)

-H, —hostname name
: collectd hostname (max: 16 bytes) (default: gethostname())

-l, —limit number
: message rate limit (default: 0 (no limit))

-w, —window seconds
: message rate window (default: 1 second)

-W, —write-error exit|drop|block
: behaviour if write buffer is full

-M, —max-event-length number
: max message fragment length (default: 255 - 10)

-I, —max-event-id number
: max message fragment header id (default: 99)

-v, —verbose
: verbose mode

-h, —help
: help

Examples

TODO