From: Florian Forster Date: Mon, 18 Jun 2007 22:12:05 +0000 (+0200) Subject: Collectd::Unixsock: Implemented the `listval' method. X-Git-Tag: collectd-4.1.0~48 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=9d885378da816c09d177792abf5aadd1eab81403;p=collectd.git Collectd::Unixsock: Implemented the `listval' method. --- 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