From 9d885378da816c09d177792abf5aadd1eab81403 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Tue, 19 Jun 2007 00:12:05 +0200 Subject: [PATCH] Collectd::Unixsock: Implemented the `listval' method. --- contrib/PerlLib/Collectd/Unixsock.pm | 73 ++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/contrib/PerlLib/Collectd/Unixsock.pm b/contrib/PerlLib/Collectd/Unixsock.pm index 92e8772c..3b8a91cf 100644 --- a/contrib/PerlLib/Collectd/Unixsock.pm +++ b/contrib/PerlLib/Collectd/Unixsock.pm @@ -83,6 +83,33 @@ sub _create_identifier return ("$host/$plugin/$type"); } # _create_identifier +sub _parse_identifier +{ + my $string = shift; + my $host; + my $plugin; + my $plugin_instance; + my $type; + my $type_instance; + my $ident; + + ($host, $plugin, $type) = split ('/', $string); + + ($plugin, $plugin_instance) = split ('-', $plugin, 2); + ($type, $type_instance) = split ('-', $type, 2); + + $ident = + { + host => $host, + plugin => $plugin, + type => $type + }; + $ident->{'plugin_instance'} = $plugin_instance if (defined ($plugin_instance)); + $ident->{'type_instance'} = $type_instance if (defined ($type_instance)); + + return ($ident); +} # _parse_identifier + =head1 PUBLIC METHODS =over 4 @@ -217,6 +244,52 @@ sub putval return; } # putval +=item I<$res> = I<$obj>-EB () + +Queries a list of values from the daemon. The list is returned as an array of +hash references, where each hash reference is a valid identifier. The C