From 2161c99ba8eac8a910be187acc7ed03cb3a06537 Mon Sep 17 00:00:00 2001 From: Josh Yotty Date: Wed, 27 Feb 2013 16:53:03 -0800 Subject: [PATCH] typoed ref to hash; copy values --- bindings/perl/lib/Collectd/Plugins/OpenVZ.pm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/bindings/perl/lib/Collectd/Plugins/OpenVZ.pm b/bindings/perl/lib/Collectd/Plugins/OpenVZ.pm index 68d81ba4..54192f28 100644 --- a/bindings/perl/lib/Collectd/Plugins/OpenVZ.pm +++ b/bindings/perl/lib/Collectd/Plugins/OpenVZ.pm @@ -46,10 +46,7 @@ sub interface_read { my ($veid, $name) = @_ my @rx_fields = qw(if_octets if_packets if_errors drop fifo frame compressed multicast); my @tx_fields = qw(if_octets if_packets if_errors drop fifo frame compressed); - my $v = _build_report_hash($name); - - $v->{'plugin'} = 'interface'; - delete $v->{'plugin_instance'}; + my %v = _build_report_hash($name); my @lines = `$vzctl exec $veid cat /proc/net/dev`; @@ -67,11 +64,14 @@ sub interface_read { # Skip this interface if it is in the ignored list next if grep { $iface eq $_ } @ignored_interfaces; - $v->{'plugin_instance'} = $iface; for my $instance (qw(if_octets if_packets if_errors)) { - $v->{'type'} = $instance; - $v->{'values'} = [ $rx{$instance}, $tx{$instance} ]; - plugin_dispatch_values($v); + plugin_dispatch_values({ + 'plugin' => 'interface', + 'plugin_instance' => $iface, + 'type' => $instance, + 'values' => [ $rx{$instance}, $tx{$instance} ], + %v, + }); } } } -- 2.11.0