projects
/
angular-mojolicious.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
save json log by date
[angular-mojolicious.git]
/
scripts
/
snmp-printer.pl
diff --git
a/scripts/snmp-printer.pl
b/scripts/snmp-printer.pl
index
d12504d
..
e9553c5
100755
(executable)
--- a/
scripts/snmp-printer.pl
+++ b/
scripts/snmp-printer.pl
@@
-28,6
+28,9
@@
sub iso_datetime {
return sprintf "%04d-%02d-%02dT%02d:%02d:%02d", $y+1900, $m, $d, $hh, $mm, $ss;
}
return sprintf "%04d-%02d-%02dT%02d:%02d:%02d", $y+1900, $m, $d, $hh, $mm, $ss;
}
+my $log_path = join('.', $dir, (split(/T/,iso_datetime,2))[0], 'json');
+open(my $log, '>>', $log_path) || die "$log_path: $!";
+
my $debug = $ENV{DEBUG} || 0;
my $community = 'public';
my $debug = $ENV{DEBUG} || 0;
my $community = 'public';
@@
-150,5
+153,9
@@
foreach my $host ( $resp->hosts ) {
print "$host = ",dump($status);
save_json $host => $status;
$collected->{$host} = $status;
print "$host = ",dump($status);
save_json $host => $status;
$collected->{$host} = $status;
+
+ print $log encode_json($status),"\n";
}
}
+close($log);
+warn "# log $log_path ", -s $log_path, " bytes\n";