projects
/
angular-mojolicious.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
ddb2e42
)
store date and ip
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Mon, 29 Nov 2010 13:55:06 +0000
(14:55 +0100)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Mon, 29 Nov 2010 13:55:06 +0000
(14:55 +0100)
scripts/snmp-printer.pl
patch
|
blob
|
history
diff --git
a/scripts/snmp-printer.pl
b/scripts/snmp-printer.pl
index
2f74a38
..
d12504d
100755
(executable)
--- a/
scripts/snmp-printer.pl
+++ b/
scripts/snmp-printer.pl
@@
-23,6
+23,11
@@
sub save_json {
warn "# $path ", -s $path, " bytes\n";
}
+sub iso_datetime {
+ my ($ss,$mm,$hh,$d,$m,$y) = localtime(time);
+ return sprintf "%04d-%02d-%02dT%02d:%02d:%02d", $y+1900, $m, $d, $hh, $mm, $ss;
+}
+
my $debug = $ENV{DEBUG} || 0;
my $community = 'public';
@@
-140,6
+145,8
@@
foreach my $host ( $resp->hosts ) {
delete $status->{$group};
}
+ $status->{ip} = $host->hostname;
+ $status->{date} = iso_datetime;
print "$host = ",dump($status);
save_json $host => $status;
$collected->{$host} = $status;