projects
/
influxdb-pipes
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
ac5e07b
)
reset date on each hour change in output
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Mon, 12 Dec 2016 06:13:05 +0000
(07:13 +0100)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Mon, 12 Dec 2016 06:13:05 +0000
(07:13 +0100)
ifstat.pl
patch
|
blob
|
history
diff --git
a/ifstat.pl
b/ifstat.pl
index
a43b626
..
832f24a
100755
(executable)
--- a/
ifstat.pl
+++ b/
ifstat.pl
@@
-46,6
+46,8
@@
my $lines;
my $host_tags = $host;
$host_tags =~ s/\./,domain=/;
+my $last_hour = $hour;
+
while(<$ifstat>) {
chomp;
#warn "# [$_]\n";
@@
-61,6
+63,12
@@
while(<$ifstat>) {
@direction = map { s/\W+/_/g; s/^K//; $_ } @v;
} elsif ( $v[0] =~ m/^(\d\d):(\d\d):(\d\d)/ ) {
next unless $first_skipped++;
+
+ if ( $last_hour != $hour ) {
+ ($sec,$min,$hour,$dd,$mm,$yyyy) = localtime(time); $mm++;
+ $last_hour = $hour;
+ }
+
$hour = $1; $min = $2; $sec = $3; update_time;
reopen_curl;