From: Dobrica Pavlinusic Date: Sun, 11 Dec 2016 11:50:27 +0000 (+0100) Subject: read ifstat from pipe X-Git-Url: http://git.rot13.org/?p=influxdb-pipes;a=commitdiff_plain;h=1e61428737a3f953af8b271a369f33df8e218238 read ifstat from pipe --- 1e61428737a3f953af8b271a369f33df8e218238 diff --git a/ifstat.pl b/ifstat.pl new file mode 100755 index 0000000..4b213f9 --- /dev/null +++ b/ifstat.pl @@ -0,0 +1,20 @@ +#!/usr/bin/perl +use warnings; +use strict; +use autodie; +use Data::Dump; +sub XXX { warn "### ",Data::Dump::dump(@_) }; + +open(my $ifstat, '-|', +qq{ifstat -s 'infosl_com_koo7Kaph@#10.20.0.2' -t -b -a -n -A 1 1}); + +while(<$ifstat>) { + chomp; + warn "# [$_]\n"; + s/^\s+//; + my @v = split(/\s+/); + XXX(@v); + +} + +