=== modified file 'bin/zsv-collectd' --- bin/zsv-collectd 2016-03-15 00:11:26 +0000 +++ bin/zsv-collectd 2016-03-14 23:40:29 +0000 @@ -1,10 +1,10 @@ #!/bin/zsh setopt no_unset extended_glob H=${COLLECTD_HOSTNAME:-$HOST} -INTERVAL=${COLLECTD_INTERVAL:-10} +INTERVAL=${COLLECTD_INTERVAL:-60} putval(){ - printf 'PUTVAL %s/%s/gauge-%s N:%s\n' "$@" || exit $? + printf 'PUTVAL %s/%s/gauge-%s N:%s\n' "$@" } a() { @@ -22,13 +22,13 @@ putval("ok", $1 == "ok" ? 1 : 0) putval("uptime", $2 == "run" ? $4 : -$4) } -' "$@" || exit $? +' "$@" } while sleep $INTERVAL; do sv check /run/service/*(N) | a H=$H - for d in /etc/vservers/*(/N); do + for d in /etc/vservers/*(/); do vs=$d:t vserver $vs running up=$? === removed file 'zsh-functions/zsv_defaults_zsv-collectd' --- zsh-functions/zsv_defaults_zsv-collectd 2016-03-15 00:11:26 +0000 +++ zsh-functions/zsv_defaults_zsv-collectd 1970-01-01 00:00:00 +0000 @@ -1,13 +0,0 @@ -zsv_collectd_unixsock=/run/collectd-unixsock - -cond() { - [[ -S $zsv_collectd_unixsock ]] -} -condf cond - -zsv_run_zsv-collectd() { - zmodload zsh/net/socket || exit $? - zsocket $zsv_collectd_unixsock || exit $? - exec zsv-collectd >$REPLY -} -# vim: ft=zsh noet ts=4 sts=4 sw=4