X-Git-Url: http://git.rot13.org/?p=atop-influxdb;a=blobdiff_plain;f=import-host.sh;h=590469d6588a32762f5f1b4de272e97b6a8a6343;hp=12ef387e4221157ea1913a516128f1c72a4949d1;hb=34cfe3d86fad10ec3e5f73a2c7a50425a0e1cd41;hpb=b1e6bb4fe4f1f24781d873b02eabb71598090ee9 diff --git a/import-host.sh b/import-host.sh index 12ef387..590469d 100755 --- a/import-host.sh +++ b/import-host.sh @@ -1,6 +1,7 @@ #!/bin/sh host=$1 +tags=$2 test -z "$host" && echo "usage: $0 host" && exit 1 :> /dev/shm/atop-import-$host.sh @@ -9,6 +10,6 @@ ssh $host 'ls -t /var/log/atop/atop_* || ls -t /var/log/atop.log*' | tee /dev/sh cat /dev/shm/atop.$host.logs | while read log do echo "# $host:$log"; - echo ssh $host \"atopsar -A -r $log\" \| ./atop2influx.pl \| tee /dev/shm/atop.$host.influx \| curl -i -X POST http://localhost:8086/write?db=atop --data-binary '@-' >> /dev/shm/atop-import-$host.sh + echo ssh $host \"atopsar -A -r $log\" \| TAGS=$tags ./atop2influx.pl \| tee /dev/shm/atop.$host.influx \| curl -i -X POST http://localhost:8086/write?db=atop3 --data-binary '@-' >> /dev/shm/atop-import-$host.sh done sh -x /dev/shm/atop-import-$host.sh