Skip to content

Instantly share code, notes, and snippets.

@faxm0dem
Created June 25, 2014 06:08
Show Gist options
  • Select an option

  • Save faxm0dem/f4ebf04fe2fe98b4a0c2 to your computer and use it in GitHub Desktop.

Select an option

Save faxm0dem/f4ebf04fe2fe98b4a0c2 to your computer and use it in GitHub Desktop.
collectd-syslog_ng plugin oneliner hack
while DATE=$(date +%s); do syslog-ng-ctl stats | awk -vhost=$HOSTNAME -F\; 'NR!=1 && $1 != "src.none" {if ($2 == "") { t=$3 } else {t=$2} printf "PUTVAL %s/syslog_ng-%s/derive-%s %s:%s\n",host,t,$5,systime(),$6}'; sleep 10; done | socat - UNIX-CLIENT:/var/run/collectd/sock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment