--- /dev/null
+#!/bin/sh
+
+host=$1
+test -z "$host" && echo "usage: $0 host" && exit 1
+
+:> /dev/shm/atop-import-$host.sh
+#ssh mjesec.ffzg.hr 'ls -t /var/log/atop/atop_*' | tee /dev/shm/atop.$host.logs | while read log
+ssh $host 'ls -t /var/log/atop/atop_* || ls -t /var/log/atop.log*' | tee /dev/shm/atop.$host.logs
+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
+done
+sh -x /dev/shm/atop-import-$host.sh