Munin::Node::Client - Client module for munin nodes.
use Munin::Node::Client; my $node = Munin::Node::Client->connect(Host => '127.0.0.1', Port => '4949'); my $version = $node->version; my @hostnames = $node->nodes; # get the hostnames my @items = $node->list(); # or $node->list($hostnames[0]); $node->quit;
Munin::Node::Client is a client module for munin nodes. This helps simple scripts to talk to munin nodes.
Here all functions are specified, for all functions that return in list context (such as with hashes), the scalar context is undocumented and might get a function in the future.
Connects to a node and returns an Munin::Node::Client object. Currently only support plain connections, ssl and tls are planned. Returns undef if connection fails (and $! probably contains something useful). Returns false if connection is not a munin connection. my $node = Munin::Node::Client->connect(Host => '127.0.0.1:4949');
Returns the last error message. print $node->error();
Returns the node's version my $version = $node->version();
Returns the available hostnames on this 'node' in a list. my @hosts = $node->nodes(); print "$_\n" for(@plugins);
Returns the list of plugins for a host (or default host when left out) my @plugins = $node->list($host); print "$_\n" for(@plugins);
Returns the configuration settings of a plugin as a hash with hasrefs my %config = config($plugin); my $globals = $config{globals}; my $datasrc = $config{datasource}; print $globals{graph_title}; print $datasrc{system}->{label};
Returns the values of a plugin as a hash my %value = fetch($plugin); print $value{system};
quits/disconnects the connection to the node. $node->quit();
alias for quit
IO::Socket::INET
Sebastian Stellingwerff <sebastian@expr42.net>
Copyright (C) 2008 by Sebastian Stellingwerff
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.0 or, at your option, any later version of Perl 5 you may have available.
To install Munin::Node::Client, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Munin::Node::Client
CPAN shell
perl -MCPAN -e shell install Munin::Node::Client
For more information on module installation, please visit the detailed CPAN module installation guide.