Created
January 12, 2016 23:53
-
-
Save DanielG/abf2d285f6050147a10b to your computer and use it in GitHub Desktop.
collectd exec plugin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
HOSTNAME="${COLLECTD_HOSTNAME:-localhost}" | |
INTERVAL="${COLLECTD_INTERVAL:-60}" | |
while sleep $INTERVAL; do | |
v=$(curl -s http://it-syndikat.org/status.txt | awk -vFS=, '{ print $1 }') | |
if [ x"$v" = x"true" ]; then | |
VALUE=1 | |
else | |
VALUE=0 | |
fi | |
echo "PUTVAL \"$HOSTNAME/exec-isitopen/gauge-isitopen\" interval=$INTERVAL N:$VALUE" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment