summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f4e7500)
raw | patch | inline | side by side (parent: f4e7500)
author | Josh Yotty <jyotty@bluebox.net> | |
Thu, 28 Feb 2013 00:53:03 +0000 (16:53 -0800) | ||
committer | Josh Yotty <jyotty@bluebox.net> | |
Thu, 28 Feb 2013 00:53:03 +0000 (16:53 -0800) |
bindings/perl/lib/Collectd/Plugins/OpenVZ.pm | patch | blob | history |
diff --git a/bindings/perl/lib/Collectd/Plugins/OpenVZ.pm b/bindings/perl/lib/Collectd/Plugins/OpenVZ.pm
index 68d81ba48cadd8c84ce23c1b39f3783b37b6018e..54192f2859eebf1f7c1e6c643a8eea86b16c6a25 100644 (file)
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`;
# 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,
+ });
}
}
}