projects
/
influxdb-pipes
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (initial)
read ifstat from pipe
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Sun, 11 Dec 2016 11:50:27 +0000
(12:50 +0100)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Sun, 11 Dec 2016 11:50:27 +0000
(12:50 +0100)
ifstat.pl
[new file with mode: 0755]
patch
|
blob
diff --git a/ifstat.pl
b/ifstat.pl
new file mode 100755
(executable)
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);
+
+}
+
+