Collectd::Unixsock(3)
π NAME
Okay bestie, welcome to the Collectd::Unixsock(3) page π
β Collectd::Unixsock is the abstraction layer for accessing the functionality by collectd's unixsock plugin. periodt. β¨
β¨ SYNOPSIS
use Collectd::Unixsock;
my $sock = Collectd::Unixsock->new ($path);
my $value = $sock->getval (%identifier);
$sock->putval (%identifier,
time => time (),
values => [123, 234, 345]);
$sock->destroy ();
πΈ DESCRIPTION
collectd's unixsock plugin lets external programs access the values it has collected or received β and also submit their own values. This Perl-module is literally just a little abstraction layer over that interface, making it even easier for programmers to interact with the daemon. iykyk π«Ά
π¦ VALUE IDENTIFIERS
The values in the collectd are identified using a five-tuple (host, plugin, plugin-instance, type, type-instance) where only plugin instance and type instance may be undef. not me knowing this by heart π
Many functions expect an %identifier hash that has at least the members host, plugin, and type, possibly completed by plugin_instance and type_instance.
Usually you can pass this hash like this:
$self->method (host => $host, plugin => $plugin, type => $type, %other_args);
π PUBLIC METHODS
$self = Collectd::Unixsock->new ([$path]);
Creates a new connection to the daemon. The optional $path argument gives the path to the UNIX socket of the "unixsock plugin" and defaults to /var/run/collectd-unixsock. Returns the newly created object on success and false on error. slay connection setup π
$res = $self->getval (%identifier);
Requests a value-list from the daemon. On success a hash-ref is returned with the name of each data-source as the key and the according value as, well, the value. On error false is returned. simple, iconic, no notes β¨
$res = $self->getthreshold (%identifier);
Requests a threshold from the daemon. On success a hash-ref is returned with the threshold data. On error false is returned. threshold tea β
$self->putval (%identifier, time => $time, values => [...]);
Submits a value-list to the daemon. If the time argument is omitted time() is used. The required argument values is a reference to an array of values that is to be submitted. The number of values must match the number of values expected for the given type (see "VALUE IDENTIFIERS"), though this is checked by the daemon, not the Perl module. Also, gauge data-sources (e. g. system-load) may be "undef". Returns true upon success and false otherwise. put it in, bestie π«Ά
$res = $self->listval_filter ( %identifier )
Queries a list of values from the daemon while restricting the results to certain hosts, plugins etc. The argument may be anything that passes for an identifier (cf. "VALUE IDENTIFIERS"), although all fields are optional. The returned data is in the same format as from "listval". filtered search, main character energy π₯
$res = $self->listval ()
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 "time" member of each hash holds the epoch value of the last update of that value. timestamped and valid, periodt β
$res = $self->putnotif (severity => $severity, message => $message, ...);
Submits a notification to the daemon.
Valid options are:
severityβ sets the severity of the notification. The value must be one of the following strings:"failure","warning", or"okay". Case does not matter. This option is mandatory. mandatory, bestie β don't skip it πmessageβ sets the message of the notification. This option is mandatory. also mandatory, no cap πtimeβ sets the time. If omitted,time()is used. timey-wimey default behavior π°οΈValue identifierβ all the other fields of the value identifiers,host,plugin,plugin_instance,type, andtype_instance, are optional. When given, the notification is associated with the performance data of that identifier. For more details, please seecollectd-unixsock(5). association station π¦
$self->flush (timeout => $timeout, plugins => [...], identifier => [...]);
Flush cached data.
Valid options are:
timeoutβ if this option is specified, only data older than$timeoutseconds is flushed. bye-bye old data β¨pluginsβ if this option is specified, only the selected plugins will be flushed. The argument is a reference to an array of strings. choose your plugins, choose your destiny πidentifierβ if this option is specified, only the given identifier(s) will be flushed. The argument is a reference to an array of identifiers. Identifiers, in this case, are hash references and have the members as outlined in"VALUE IDENTIFIERS". targeted flush, iconic π
$self->destroy ();
Closes the socket before the object is destroyed. This function is also automatically called when the object goes out of scope. cleanup queen π
π₯ SEE ALSO
π AUTHOR
Florian octo Forster <octo@collectd.org> π
π That's the whole page, bestie β it's from perl v5.42.0, dated 2024-12-18, in the User Contributed Perl Documentation, and the manual is Collectd::Unixsock(3). byeee πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: collectd 5.12.0.348.g93f9bdcb-bp160.1.1 Β· GPL-2.0-only AND MIT
- opensuse-leap 16.0: collectd 5.12.0.348.g93f9bdcb-bp160.1.1 Β· GPL-2.0-only AND MIT
- opensuse-leap 16.0: collectd 5.12.0.348.g93f9bdcb-bp160.1.1 Β· GPL-2.0-only AND MIT
- opensuse-leap 16.0: collectd 5.12.0.348.g93f9bdcb-bp160.1.1 Β· GPL-2.0-only AND MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms