get rid of some bashisms / clean up. add ping metric. add --metrics cli option

This commit is contained in:
Patrick Stadler
2015-03-15 14:55:36 +01:00
parent 470ed0a828
commit d018d6ea12
12 changed files with 166 additions and 48 deletions

View File

@@ -12,6 +12,7 @@ init () {
if [ "$INFLUXDB_SEND_HOSTNAME" = true ]; then
__influxdb_columns="[\"value\",\"host\"]"
__influxdb_hostname=$(hostname)
else
__influxdb_columns="[\"value\"]"
fi
@@ -22,7 +23,7 @@ report () {
local value=$2
local points
if [ "$INFLUXDB_SEND_HOSTNAME" = true ]; then
points="[$value,\"$HOSTNAME\"]"
points="[$value,\"$__influxdb_hostname\"]"
else
points="[$value]"
fi

View File

@@ -12,7 +12,7 @@ init() {
fi
if [ -z $KEEN_IO_EVENT_COLLECTION ]; then
KEEN_IO_EVENT_COLLECTION=$HOSTNAME
KEEN_IO_EVENT_COLLECTION=$(hostname)
fi
__keen_io_api_url="https://api.keen.io/3.0"
@@ -33,5 +33,5 @@ docs () {
echo "Send data to Keen IO (https://keen.io)."
echo "\$KEEN_IO_WRITE_KEY=<write_key>"
echo "\$KEEN_IO_PROJECT_ID=<project_id>"
echo "\$KEEN_IO_EVENT_COLLECTION=$HOSTNAME"
echo "\$KEEN_IO_EVENT_COLLECTION=$(hostname)"
}