=== removed file 'bin/zsv-collectd' --- bin/zsv-collectd 2016-03-14 23:40:29 +0000 +++ bin/zsv-collectd 1970-01-01 00:00:00 +0000 @@ -1,40 +0,0 @@ -#!/bin/zsh -setopt no_unset extended_glob -H=${COLLECTD_HOSTNAME:-$HOST} -INTERVAL=${COLLECTD_INTERVAL:-60} - -putval(){ - printf 'PUTVAL %s/%s/gauge-%s N:%s\n' "$@" -} - -a() { - awk ' -BEGIN{ - FS=": " -} -function putval(name, val) { - printf "PUTVAL %s/zsv-%s/gauge-%s N:%f\n", H, $3, name, val -} -/^(ok|timeout): (run|down|finish): /{ - sub(/\(pid [0-9]*\) /,"",$4) - sub(/s.*/,"",$4) - sub(/.*\//,"",$3) - putval("ok", $1 == "ok" ? 1 : 0) - putval("uptime", $2 == "run" ? $4 : -$4) -} -' "$@" -} - -while sleep $INTERVAL; do - sv check /run/service/*(N) | a H=$H - - for d in /etc/vservers/*(/); do - vs=$d:t - vserver $vs running - up=$? - putval $H exe-vserver ${vs}_running $up - if (($up == 0)); then - vserver $vs exec /bin/sh -c 'sv check /run/service/*' | a H=$vs.$H - fi - done -done